SELECT DH.ID as ID, DH.CreatedAt, CL.Name as ClientName, DH.Location, DH.TotalSum, DH.BaseDocTypeAndID, DH.DocState, (select FileName||' '||to_char(Amount) from Supermag.SVInsertedDocsOR DI where DI.DocType = DH.DocType and DI.ID = DH.ID and rownum = 1 ) as InsertedDocs, DH.OrderDate, DH.OrderCredit, DH.SupplyDate, DH.SupplierDebt, DH.MaxOrderSum, DH.Algorithm, DH.SupplyTime FROM SuperMag.SVDocumentsOR DH , SuperMag.SMClientInfo CL WHERE DH.DocType = 'OR' AND DH.CreatedAt = TO_DATE('20130128','YYYYMMDD') AND DH.DocState = 2 AND DH.Location = 9 AND (CL.ID(+)= DH.ClientIndex)
Plan 88 SELECT STATEMENT ALL_ROWS Cost: 6 Bytes: 118 Cardinality: 1 Partition #: 0 3 SORT AGGREGATE Cost: 0 Bytes: 31 Cardinality: 1 Partition #: 0 2 FILTER Cost: 0 Bytes: 0 Cardinality: 0 Partition #: 0 1 INDEX RANGE SCAN SUPERMAG.SMCDOCBLOBFILES_FILENAME [Analyzed] Cost: 1 Bytes: 31 Cardinality: 1 Partition #: 0 6 COUNT STOPKEY Cost: 0 Bytes: 0 Cardinality: 0 Partition #: 0 5 FILTER Cost: 0 Bytes: 0 Cardinality: 0 Partition #: 0 4 INDEX RANGE SCAN SUPERMAG.SMCDOCBLOBFILES_FILENAME [Analyzed] Cost: 1 Bytes: 160 Cardinality: 1 Partition #: 0 9 SORT AGGREGATE Cost: 0 Bytes: 19 Cardinality: 1 Partition #: 0 8 TABLE ACCESS BY INDEX ROWID SUPERMAG.SMFINLINK [Analyzed] Cost: 1 Bytes: 19 Cardinality: 1 Partition #: 0 7 INDEX RANGE SCAN SUPERMAG.SMCFINLINK_PK [Analyzed] Cost: 1 Bytes: 0 Cardinality: 1 Partition #: 0 33 SORT AGGREGATE Cost: 0 Bytes: 70 Cardinality: 1 Partition #: 0 32 FILTER Cost: 0 Bytes: 0 Cardinality: 0 Partition #: 0 18 NESTED LOOPS OUTER Cost: 48 Bytes: 135660 Cardinality: 1938 Partition #: 0 15 NESTED LOOPS OUTER Cost: 29 Bytes: 98838 Cardinality: 1938 Partition #: 0 13 NESTED LOOPS SEMI Cost: 28 Bytes: 69768 Cardinality: 1938 Partition #: 0 11 TABLE ACCESS BY GLOBAL INDEX ROWID SUPERMAG.SMDOCUMENTS [Analyzed] Cost: 27 Bytes: 67730 Cardinality: 2605 Partition #: 15 Partitions accessed #2 10 INDEX RANGE SCAN SUPERMAG.SMDOCUMENTS_CLIENT [Analyzed] Cost: 1 Bytes: 0 Cardinality: 4570 Partition #: 0 12 INDEX UNIQUE SCAN SUPERMAG.SMCPARTNERUSERLOC_PK [Analyzed] Cost: 1 Bytes: 370 Cardinality: 37 Partition #: 0 14 INDEX UNIQUE SCAN SUPERMAG.SMCWAYBILLSIN_PK [Analyzed] Cost: 1 Bytes: 15 Cardinality: 1 Partition #: 0 17 TABLE ACCESS BY INDEX ROWID SUPERMAG.SMFINOBLIGATION [Analyzed] Cost: 1 Bytes: 19 Cardinality: 1 Partition #: 0 16 INDEX UNIQUE SCAN SUPERMAG.SMCFINOBLIGATION_PK [Analyzed] Cost: 1 Bytes: 0 Cardinality: 1 Partition #: 0 31 FILTER Cost: 0 Bytes: 0 Cardinality: 0 Partition #: 0 26 NESTED LOOPS OUTER Cost: 4 Bytes: 27 Cardinality: 1 Partition #: 0 24 NESTED LOOPS OUTER Cost: 3 Bytes: 22 Cardinality: 1 Partition #: 0 22 NESTED LOOPS Cost: 2 Bytes: 17 Cardinality: 1 Partition #: 0 20 TABLE ACCESS BY INDEX ROWID SUPERMAG.SMSTAFF [Analyzed] Cost: 1 Bytes: 12 Cardinality: 1 Partition #: 0 19 INDEX UNIQUE SCAN SUPERMAG.SMSTAFF_LOGIN [Analyzed] Cost: 1 Bytes: 0 Cardinality: 1 Partition #: 0 21 INDEX UNIQUE SCAN SUPERMAG.SMCCLIENTINFO_PK [Analyzed] Cost: 1 Bytes: 5 Cardinality: 1 Partition #: 0 23 INDEX UNIQUE SCAN SUPERMAG.SMCSUPPLIERS_PK [Analyzed] Cost: 1 Bytes: 5 Cardinality: 1 Partition #: 0 25 INDEX UNIQUE SCAN SUPERMAG.SMCCLIENTS_PK [Analyzed] Cost: 1 Bytes: 5 Cardinality: 1 Partition #: 0 27 INDEX RANGE SCAN SUPERMAG.SMCSUPPLIERSASSORTSTAFF_PK [Analyzed] Cost: 1 Bytes: 13 Cardinality: 1 Partition #: 0 30 NESTED LOOPS Cost: 2 Bytes: 34 Cardinality: 1 Partition #: 0 28 INDEX RANGE SCAN SUPERMAG.SMCSUPPLIERSASSORTSTAFF_PK [Analyzed] Cost: 1 Bytes: 26 Cardinality: 1 Partition #: 0 29 INDEX UNIQUE SCAN SUPERMAG.SMCSUPPLIERSASSORT_PK [Analyzed] Cost: 1 Bytes: 8 Cardinality: 1 Partition #: 0 36 SORT AGGREGATE Cost: 0 Bytes: 19 Cardinality: 1 Partition #: 0 35 TABLE ACCESS BY INDEX ROWID SUPERMAG.SMFINLINK [Analyzed] Cost: 1 Bytes: 19 Cardinality: 1 Partition #: 0 34 INDEX RANGE SCAN SUPERMAG.SMCFINLINK_PK [Analyzed] Cost: 1 Bytes: 0 Cardinality: 1 Partition #: 0 60 SORT AGGREGATE Cost: 0 Bytes: 70 Cardinality: 1 Partition #: 0 59 FILTER Cost: 0 Bytes: 0 Cardinality: 0 Partition #: 0 45 NESTED LOOPS OUTER Cost: 48 Bytes: 135660 Cardinality: 1938 Partition #: 0 42 NESTED LOOPS OUTER Cost: 29 Bytes: 98838 Cardinality: 1938 Partition #: 0 40 NESTED LOOPS SEMI Cost: 28 Bytes: 69768 Cardinality: 1938 Partition #: 0 38 TABLE ACCESS BY GLOBAL INDEX ROWID SUPERMAG.SMDOCUMENTS [Analyzed] Cost: 27 Bytes: 67730 Cardinality: 2605 Partition #: 42 Partitions accessed #2 37 INDEX RANGE SCAN SUPERMAG.SMDOCUMENTS_CLIENT [Analyzed] Cost: 1 Bytes: 0 Cardinality: 4570 Partition #: 0 39 INDEX UNIQUE SCAN SUPERMAG.SMCPARTNERUSERLOC_PK [Analyzed] Cost: 1 Bytes: 370 Cardinality: 37 Partition #: 0 41 INDEX UNIQUE SCAN SUPERMAG.SMCWAYBILLSIN_PK [Analyzed] Cost: 1 Bytes: 15 Cardinality: 1 Partition #: 0 44 TABLE ACCESS BY INDEX ROWID SUPERMAG.SMFINOBLIGATION [Analyzed] Cost: 1 Bytes: 19 Cardinality: 1 Partition #: 0 43 INDEX UNIQUE SCAN SUPERMAG.SMCFINOBLIGATION_PK [Analyzed] Cost: 1 Bytes: 0 Cardinality: 1 Partition #: 0 58 FILTER Cost: 0 Bytes: 0 Cardinality: 0 Partition #: 0 53 NESTED LOOPS OUTER Cost: 4 Bytes: 27 Cardinality: 1 Partition #: 0 51 NESTED LOOPS OUTER Cost: 3 Bytes: 22 Cardinality: 1 Partition #: 0 49 NESTED LOOPS Cost: 2 Bytes: 17 Cardinality: 1 Partition #: 0 47 TABLE ACCESS BY INDEX ROWID SUPERMAG.SMSTAFF [Analyzed] Cost: 1 Bytes: 12 Cardinality: 1 Partition #: 0 46 INDEX UNIQUE SCAN SUPERMAG.SMSTAFF_LOGIN [Analyzed] Cost: 1 Bytes: 0 Cardinality: 1 Partition #: 0 48 INDEX UNIQUE SCAN SUPERMAG.SMCCLIENTINFO_PK [Analyzed] Cost: 1 Bytes: 5 Cardinality: 1 Partition #: 0 50 INDEX UNIQUE SCAN SUPERMAG.SMCSUPPLIERS_PK [Analyzed] Cost: 1 Bytes: 5 Cardinality: 1 Partition #: 0 52 INDEX UNIQUE SCAN SUPERMAG.SMCCLIENTS_PK [Analyzed] Cost: 1 Bytes: 5 Cardinality: 1 Partition #: 0 54 INDEX RANGE SCAN SUPERMAG.SMCSUPPLIERSASSORTSTAFF_PK [Analyzed] Cost: 1 Bytes: 13 Cardinality: 1 Partition #: 0 57 NESTED LOOPS Cost: 2 Bytes: 34 Cardinality: 1 Partition #: 0 55 INDEX RANGE SCAN SUPERMAG.SMCSUPPLIERSASSORTSTAFF_PK [Analyzed] Cost: 1 Bytes: 26 Cardinality: 1 Partition #: 0 56 INDEX UNIQUE SCAN SUPERMAG.SMCSUPPLIERSASSORT_PK [Analyzed] Cost: 1 Bytes: 8 Cardinality: 1 Partition #: 0 87 FILTER Cost: 0 Bytes: 0 Cardinality: 0 Partition #: 0 73 NESTED LOOPS OUTER Cost: 6 Bytes: 118 Cardinality: 1 Partition #: 0 70 NESTED LOOPS OUTER Cost: 5 Bytes: 84 Cardinality: 1 Partition #: 0 67 NESTED LOOPS OUTER Cost: 4 Bytes: 77 Cardinality: 1 Partition #: 0 64 NESTED LOOPS Cost: 3 Bytes: 48 Cardinality: 1 Partition #: 0 61 INDEX UNIQUE SCAN SUPERMAG.SMCPARTNERUSERLOC_PK [Analyzed] Cost: 1 Bytes: 10 Cardinality: 1 Partition #: 0 63 TABLE ACCESS BY GLOBAL INDEX ROWID SUPERMAG.SMDOCUMENTS [Analyzed] Cost: 2 Bytes: 38 Cardinality: 1 Partition #: 67 Partitions accessed #3 62 INDEX RANGE SCAN SUPERMAG.SMDOCUMENTS_CREATEDAT [Analyzed] Cost: 1 Bytes: 0 Cardinality: 1548 Partition #: 0 66 TABLE ACCESS BY INDEX ROWID SUPERMAG.SMDATEDOCS [Analyzed] Cost: 1 Bytes: 29 Cardinality: 1 Partition #: 0 65 INDEX RANGE SCAN SUPERMAG.SMDATEDOCS_ORDER [Analyzed] Cost: 1 Bytes: 0 Cardinality: 1 Partition #: 0 69 TABLE ACCESS BY INDEX ROWID SUPERMAG.SMSUPPLIERS [Analyzed] Cost: 1 Bytes: 7 Cardinality: 1 Partition #: 0 68 INDEX UNIQUE SCAN SUPERMAG.SMCSUPPLIERS_PK [Analyzed] Cost: 1 Bytes: 0 Cardinality: 1 Partition #: 0 72 TABLE ACCESS BY INDEX ROWID SUPERMAG.SMCLIENTINFO [Analyzed] Cost: 1 Bytes: 34 Cardinality: 1 Partition #: 0 71 INDEX UNIQUE SCAN SUPERMAG.SMCCLIENTINFO_PK [Analyzed] Cost: 1 Bytes: 0 Cardinality: 1 Partition #: 0 86 FILTER Cost: 0 Bytes: 0 Cardinality: 0 Partition #: 0 81 NESTED LOOPS OUTER Cost: 4 Bytes: 27 Cardinality: 1 Partition #: 0 79 NESTED LOOPS OUTER Cost: 3 Bytes: 22 Cardinality: 1 Partition #: 0 77 NESTED LOOPS Cost: 2 Bytes: 17 Cardinality: 1 Partition #: 0 75 TABLE ACCESS BY INDEX ROWID SUPERMAG.SMSTAFF [Analyzed] Cost: 1 Bytes: 12 Cardinality: 1 Partition #: 0 74 INDEX UNIQUE SCAN SUPERMAG.SMSTAFF_LOGIN [Analyzed] Cost: 1 Bytes: 0 Cardinality: 1 Partition #: 0 76 INDEX UNIQUE SCAN SUPERMAG.SMCCLIENTINFO_PK [Analyzed] Cost: 1 Bytes: 5 Cardinality: 1 Partition #: 0 78 INDEX UNIQUE SCAN SUPERMAG.SMCSUPPLIERS_PK [Analyzed] Cost: 1 Bytes: 5 Cardinality: 1 Partition #: 0 80 INDEX UNIQUE SCAN SUPERMAG.SMCCLIENTS_PK [Analyzed] Cost: 1 Bytes: 5 Cardinality: 1 Partition #: 0 82 INDEX RANGE SCAN SUPERMAG.SMCSUPPLIERSASSORTSTAFF_PK [Analyzed] Cost: 1 Bytes: 13 Cardinality: 1 Partition #: 0 85 NESTED LOOPS Cost: 2 Bytes: 34 Cardinality: 1 Partition #: 0 83 INDEX RANGE SCAN SUPERMAG.SMCSUPPLIERSASSORTSTAFF_PK [Analyzed] Cost: 1 Bytes: 26 Cardinality: 1 Partition #: 0 84 INDEX UNIQUE SCAN SUPERMAG.SMCSUPPLIERSASSORT_PK [Analyzed] Cost: 1 Bytes: 8 Cardinality: 1 Partition #: 0