SELECT R.SALEUSEROP, R.SALEID, R.SALETYPE, R.SALEDATE, R.SALELOCATIONTO, R.SALELOCATIONFROM, R.ARTICLE, SUM(R.QUANTITY) QUANTITY, NVL(R.GOODSOWNER, 0) GOODSOWNER, R.SALEPAYCASH, R.SALECLIENTINDEX, DSALE.SUPPLIERDOC, DSALE.SUPPLIERINVOICE, DSALE.SUPPLINVOICECREATE, R.SALESPECITEM, DECODE(R.SALEQ, 0, 0, ROUND(R.SALESUM / R.SALEQ, 4)) ITEMPRICE, R.SALEVATRATE, ROUND(SUM(DECODE(R.SALEQ, 0, 0, R.SALESUM * R.QUANTITY / R.SALEQ)), 4) TOTALPRICE FROM FFDOCUMENTS DSALE, FVMAPREP R WHERE DSALE.DOCTYPE(+) = R.SALETYPE AND DSALE.ID(+) = R.SALEID AND R.SALEOP = :B1 AND (:B2 IS NULL OR :B2 = R.SALEUSEROP) AND R.SALEDATE BETWEEN :B4 AND :B5 AND ((:B6 = TO_DATE('19000101', 'YYYYMMDD') AND :B7 = TO_DATE('99990101', 'YYYYMMDD')) OR EXISTS (SELECT 1 FROM SMDOCLOG DC WHERE DC.DOCTYPE = R.SALETYPE AND DC.ID = R.SALEID AND TRUNC(DC.EVENTTIME) BETWEEN :B6 AND :B7 AND NOT DC.ACTIONCODE IN (0, 11, 15))) AND ((:B10 IS NULL AND EXISTS (SELECT 1 FROM TTSHOPLIST WHERE ID IN (R.SALELOCATIONFROM, R.SALELOCATIONTO))) OR (:B10 IS NOT NULL AND EXISTS (SELECT 1 FROM TTSHOPLIST WHERE ID IN (DECODE(:B10, 0, NVL(R.SALELOCATIONTO, R.SALELOCATIONFROM), NVL(R.SALELOCATIONFROM, R.SALELOCATIONTO)))))) GROUP BY NVL(R.GOODSOWNER, 0), R.SALEID, R.SALETYPE, R.SALESPECITEM, R.SALEUSEROP, R.SALEDATE, R.SALELOCATIONTO, R.SALELOCATIONFROM, R.ARTICLE, R.SALEPAYCASH, R.SALECLIENTINDEX, R.SALESUM, R.SALEQ, DSALE.SUPPLIERDOC, DSALE.SUPPLIERINVOICE, DSALE.SUPPLINVOICECREATE, R.SALEVATRATE
Statement Id=4203172 Type= Cost=2,77925427927569E-308 TimeStamp=21-08-06::16::29:52 (1) SELECT STATEMENT CHOOSE Est. Rows: 1 Cost: 2 854 (21) SORT GROUP BY Est. Rows: 1 Cost: 2 854 (20) FILTER (13) FILTER (12) NESTED LOOPS OUTER Est. Rows: 1 Cost: 2 850 (9) VIEW (Embedded SQL) Est. Rows: 1 Cost: 2 849 (8) UNION-ALL (4) FILTER (3) TABLE ACCESS BY INDEX ROWID SUPERMAG.FFMAPREP [Analyzed] (3) Blocks: 29 604 Est. Rows: 25 of 1 542 528 Cost: 1 577 Tablespace: USERS (2) NON-UNIQUE INDEX RANGE SCAN SUPERMAG.FFMAPREP_SALEDATE [Analyzed] Est. Rows: 6 941 Cost: 21 (7) FILTER (6) TABLE ACCESS BY INDEX ROWID SUPERMAG.FFMAPREP_ [Analyzed] (6) Est. Rows: 1 Cost: 1 Tablespace: USERS (5) NON-UNIQUE INDEX RANGE SCAN SUPERMAG.FFMAPREP_SALEDATE_ [Analyzed] Est. Rows: 1 (11) TABLE ACCESS BY INDEX ROWID SUPERMAG.FFDOCUMENTS [Analyzed] (11) Blocks: 106 Est. Rows: 1 of 12 488 Cost: 1 Tablespace: USERS (10) UNIQUE INDEX UNIQUE SCAN SUPERMAG.FFCDOCUMENTS_PHYSPK [Analyzed] Est. Rows: 1 (16) FILTER (15) TABLE ACCESS BY INDEX ROWID SUPERMAG.SMDOCLOG [Analyzed] (15) Blocks: 1 289 Est. Rows: 1 of 114 329 Cost: 1 Tablespace: USERS (14) NON-UNIQUE INDEX RANGE SCAN SUPERMAG.SMDOCLOG_IDIDX [Analyzed] Est. Rows: 1 Cost: 3 (18) INLIST ITERATOR (17) UNIQUE INDEX RANGE SCAN SUPERMAG.TTCSHOPLIST_PK [Not Analyzed] Est. Rows: 82 (19) UNIQUE INDEX UNIQUE SCAN SUPERMAG.TTCSHOPLIST_PK [Not Analyzed] Est. Rows: 1 Cost: 1
SELECT STATEMENT, GOAL = CHOOSE Cost=96255 Cardinality=810 Bytes=229230 SORT GROUP BY Cost=96255 Cardinality=810 Bytes=229230 FILTER NESTED LOOPS OUTER Cost=96221 Cardinality=810 Bytes=229230 VIEW Object owner=SUPERMAG Cost=94617 Cardinality=802 Bytes=169222 UNION-ALL TABLE ACCESS BY INDEX ROWID Object owner=SUPERMAG Object name=FFMAPREP Cost=94616 Cardinality=801 Bytes=49662 INDEX RANGE SCAN Object owner=SUPERMAG Object name=FFMAPREP_SALEDATE Cost=643 Cardinality=801 TABLE ACCESS BY INDEX ROWID Object owner=SUPERMAG Object name=FFMAPREP_ Cost=1 Cardinality=1 Bytes=213 INDEX RANGE SCAN Object owner=SUPERMAG Object name=FFMAPREP_SALEDATE_ Cardinality=1 TABLE ACCESS BY INDEX ROWID Object owner=SUPERMAG Object name=FFDOCUMENTS Cost=2 Cardinality=750334 Bytes=54024048 INDEX UNIQUE SCAN Object owner=SUPERMAG Object name=FFCDOCUMENTS_PHYSPK Cost=1 Cardinality=750334 TABLE ACCESS BY INDEX ROWID Object owner=SUPERMAG Object name=SMDOCLOG Cost=4 Cardinality=1 Bytes=21 INDEX RANGE SCAN Object owner=SUPERMAG Object name=SMDOCLOG_IDIDX Cost=3 Cardinality=1 INLIST ITERATOR INDEX RANGE SCAN Object owner=SUPERMAG Object name=TTCSHOPLIST_PK Cost=2 Cardinality=82 Bytes=1066 INDEX UNIQUE SCAN Object owner=SUPERMAG Object name=TTCSHOPLIST_PK Cost=1 Cardinality=1 Bytes=13