在查询中写CTAS与外连接的最佳方法

问题描述 投票:1回答:1

我想用ctas创建一个表,下面是我的查询,需要24分钟,有什么办法可以改善我的查询吗?

create table CHUB1
nologging
parallel
as          
select  /*+ PARALLEL */ D.CUSt_ID,
                D.FIRST_NM,
                D.MIDDLE_NM
          from  Chub_DETAIL_OT  D,--29 m records
                Chub_ADDR_OT A,--28 m records
                CHUB_PHONES P,--22 m records
                CHUB_EMAILS E --5 m records
         where  1=1
           and  A.CUSTOMER_ID(+) = D.CUSTOMER_ID
           and  P.CUSTOMER_ID(+) = D.CUSTOMER_ID
           and  E.CUSTOMER_ID(+) = D.CUSTOMER_ID;

数据库:Oracle 12c,如果你需要更多的细节,请告诉我。

oracle12c
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.