ORACLE100203,Windows 2003(AMD64)
[php]
Insert into TYBb2JxcKcqc ( invid, orgid, storclass, cwarehouseid, num )
( SELECT b.cinvbasid invid, h.pk_calbody orgid, bd_stordoc.def1 storclass, h.cwarehouseid,
nvl ( SUM ( b.ninnum ), 0 )- nvl ( SUM ( b.noutnum ), 0 ) nnum
FROM ic_general_b b, ic_general_h h, bd_stordoc, bd_invbasdoc
where h.cgeneralhid = b.cgeneralhid
and h.cwarehouseid = bd_stordoc.pk_stordoc
and b.cinvbasid = bd_invbasdoc.pk_invbasdoc
and ( ( ( ( h.cbilltypecode = '40' or
h.cbilltypecode = '41' or
h.cbilltypecode = '4E' or
h.cbilltypecode = '44' or
( h.cbilltypecode = '45' and b.fchecked = 0 and
( h.cbiztype in ( select pk_busitype from bd_busitype where verifyrule'J' )
or h.cbiztype is null )
) or h.cbilltypecode ='46' or h.cbilltypecode = '47' or h.cbilltypecode = '48'
or h.cbilltypecode = '49' or h.cbilltypecode = '4A' or h.cbilltypecode= '4B'
) AND ninnum IS NOT NULL or
( ( h.cbilltypecode = '4C' and
( h.cbiztype in
( select pk_busitype from bd_busitype where verifyrule'C' ) or h.cbiztype is null
)
) or h.cbilltypecode = '4D' or h.cbilltypecode = '4Y' or
h.cbilltypecode = '4F' or h.cbilltypecode = '4G' or
h.cbilltypecode = '4H' or h.cbilltypecode = '4I' or
h.cbilltypecode = '4J' or h.cbilltypecode = '4O'
) AND noutnum IS NOT NULL
) and h.dr = 0 and b.dr = 0 and h.cgeneralhid = b.cgeneralhid
) and ( ( h.cbilltypecode = '40' or h.cbilltypecode = '41' or
h.cbilltypecode = '44' )
or ( b.dbizdate < '2007-07-25' )
) and ( 1 = 1 ) and ( 1 = 1 ) and ( 1 = 1 ) and
( h.cwarehouseid = '1006AA100000000003CM' ) and
( 1 = 1 ) and ( 1 =1 ) and ( 1 = 1 ) and
( h.pk_calbody IN ( Select pk_calbody from TYBb2JxcBD1 ) )
and ( bd_invbasdoc.pk_invcl IN ( Select pk_invcl from TYBb2JxcBD2 ) )
) GROUP BY b.cinvbasid, h.pk_calbody, bd_stordoc.def1, h.cwarehouseid )
Optimizer Plan:
-----------------------------------------------------------------------------------------------
| Operation
| PHV/Object Name |Rows | Bytes | Cost|
-----------------------------------------------------------------------------------------------
|INSERT STATEMENT
|--------3140510875--------| || 5163 |
|HASH GROUP BY
|
| 1 |263 | 5163 |
| FILTER
|
| |