したがって、やや複雑な SQL クエリがあります。私たちのシステムのパフォーマンスは、約 1.1 秒で結果を返します。顧客の環境では、クエリは約 2.4 ~ 2.5 秒で返されます。両方のサーバーで統計を実行すると、一貫した取得に大きな違いがあることがわかりました。キャッシングの違いがあるかどうかを確認するためにいくつかのパラメーターを比較しましたが、何を見ればよいか完全にはわかりません。システム上で DB_FILE_MULTIBLOCK_READ_COUNT が 8 だったのに対し、私たちの 128 であることに気付きました。
または、一貫した取得が非常に異なることは問題ではありませんか?
**Our Statistics**
0 recursive calls
0 db block gets
28344 consistent gets
0 physical reads
188 redo size
1664150 bytes sent via SQL*Net to client
36494 bytes received via SQL*Net from client
3272 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
49053 rows processed
**Client Statistics**
0 recursive calls
1 db block gets
306456 consistent gets
288 physical reads
188 redo size
1879562 bytes sent via SQL*Net to client
36494 bytes received via SQL*Net from client
3272 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
49053 rows processed
私たちの計画:
49053 行が選択されました。
Execution Plan
----------------------------------------------------------
Plan hash value: 60030630
--------------------------------------------------------------------------------
-------------------------------------------------
| Id | Operation | Name
| Rows | Bytes |TempSpc| Cost (%CPU)| Time |
--------------------------------------------------------------------------------
-------------------------------------------------
| 0 | SELECT STATEMENT |
| 454M| 160G| | 262K (7)| 00:52:27 |
|* 1 | HASH JOIN RIGHT OUTER |
| 454M| 160G| | 262K (7)| 00:52:27 |
| 2 | VIEW |
| 9 | 1935 | | 6 (17)| 00:00:01 |
| 3 | MERGE JOIN |
| 9 | 198 | | 6 (17)| 00:00:01 |
| 4 | TABLE ACCESS BY INDEX ROWID | TBLWORKFLOWSTAGES
| 9 | 144 | | 2 (0)| 00:00:01 |
| 5 | INDEX FULL SCAN | PK_TBLWORKFLOWSTAGES
| 9 | | | 1 (0)| 00:00:01 |
|* 6 | SORT JOIN |
| 9 | 54 | | 4 (25)| 00:00:01 |
| 7 | TABLE ACCESS FULL | TBLWORKFLOWSTAGETREE
| 9 | 54 | | 3 (0)| 00:00:01 |
|* 8 | HASH JOIN RIGHT OUTER |
| 454M| 69G| | 258K (6)| 00:51:48 |
| 9 | TABLE ACCESS FULL | TBLTASKDEFINITIONS
| 4 | 148 | | 3 (0)| 00:00:01 |
|* 10 | HASH JOIN |
| 454M| 53G| 22M| 255K (4)| 00:51:10 |
|* 11 | INDEX FAST FULL SCAN | IDX_IAM_AS_ID_IN_ID_ACCESS
| 983K| 11M| | 1842 (2)| 00:00:23 |
|* 12 | FILTER |
| | | | | |
|* 13 | HASH JOIN RIGHT OUTER |
| 39M| 4385M| | 9180 (71)| 00:01:51 |
| 14 | TABLE ACCESS FULL | TBLASSETSTATUSES
| 4 | 24 | | 3 (0)| 00:00:01 |
|* 15 | HASH JOIN |
| 79M| 8313M| | 8614 (69)| 00:01:44 |
|* 16 | HASH JOIN RIGHT SEMI |
| 8316 | 446K| | 2167 (2)| 00:00:27 |
| 17 | INDEX FULL SCAN | PK_TBLWORKFLOWSTAGETREEPARENTS
| 7 | 21 | | 1 (0)| 00:00:01 |
| 18 | VIEW |
| 49895 | 2533K| | 2165 (2)| 00:00:26 |
| 19 | UNION-ALL |
| | | | | |
| 20 | NESTED LOOPS ANTI |
| 1 | 144 | | 1 (0)| 00:00:01 |
| 21 | NESTED LOOPS |
| 1 | 106 | | 1 (0)| 00:00:01 |
| 22 | INDEX FULL SCAN | PK_TBLWORKMGMTGP
| 1 | 13 | | 0 (0)| 00:00:01 |
|* 23 | TABLE ACCESS BY INDEX ROWID| TBLASSETTASKS
| 1 | 93 | | 1 (0)| 00:00:01 |
|* 24 | INDEX UNIQUE SCAN | PK_TBLASSETTASKS
| 1 | | | 1 (0)| 00:00:01 |
|* 25 | INDEX FULL SCAN | PK_TBLASSETTASKCOPIES
| 1 | 38 | | 0 (0)| 00:00:01 |
| 26 | NESTED LOOPS ANTI |
| 49894 | 6626K| | 2164 (2)| 00:00:26 |
| 27 | NESTED LOOPS |
| 49894 | 4775K| | 2163 (2)| 00:00:26 |
|* 28 | TABLE ACCESS FULL | TBLASSETTASKS
| 122K| 10M| | 2147 (1)| 00:00:26 |
|* 29 | INDEX UNIQUE SCAN | PK_TBLWORKMGMTINST
| 1 | 5 | | 0 (0)| 00:00:01 |
|* 30 | INDEX FULL SCAN | PK_TBLASSETTASKCOPIES
| 1 | 38 | | 0 (0)| 00:00:01 |
|* 31 | TABLE ACCESS FULL | TBLASSETS
| 827M| 41G| | 622 (1)| 00:00:08 |
--------------------------------------------------------------------------------
-------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - access("QUERYTABLE"."AST_CURRENT_WFST_ID"="DISPLAYTABLE1"."WFST_ID"(+))
6 - access("WFST"."WFS_ID"="WFS"."WFS_ID")
filter("WFST"."WFS_ID"="WFS"."WFS_ID")
8 - access("DISPLAYTABLE2"."TD_ID"(+)="QUERYTABLE"."TD_ID")
10 - access("TBLASSETS"."AS_ID"="TBLINSPECTORASSETMAP"."AS_ID")
11 - filter("TBLINSPECTORASSETMAP"."IN_ID"=1 AND ("TBLINSPECTORASSETMAP"."IAM_
ASSET_ACCESS_LEVEL"=0 OR
"TBLINSPECTORASSETMAP"."IAM_ASSET_ACCESS_LEVEL"=1))
12 - filter("TBLASSETSTATUSES"."ASSET_STATUS_HIDE_REPORTS" IS NULL OR "TBLASSE
TSTATUSES"."ASSET_STATUS_HIDE_REPORTS"=0)
13 - access("TBLASSETSTATUSES"."ASSET_STATUS_ID"(+)="TBLASSETS"."ASSET_STATUS_
ID")
15 - access("QUERYTABLE"."AS_ID"="TBLASSETS"."AS_ID")
16 - access("QUERYTABLE"."AST_CURRENT_WFST_ID"="PARENT_WFST_ID")
23 - filter("TBLASSETTASKS"."AST_TYPE"=3 AND "AST_DELETED"=0)
24 - access("TBLASSETTASKS"."AST_ID"="TBLWORKMGMTGP"."AST_ID")
25 - access("TBLASSETTASKS"."AST_GUID"="COPY_AST_GUID")
filter("TBLASSETTASKS"."AST_GUID"="COPY_AST_GUID")
28 - filter("TBLASSETTASKS"."AST_TYPE"=4 AND "AST_DELETED"=0)
29 - access("TBLASSETTASKS"."AST_ID"="TBLWORKMGMTINST"."AST_ID")
30 - access("TBLASSETTASKS"."AST_GUID"="COPY_AST_GUID")
filter("TBLASSETTASKS"."AST_GUID"="COPY_AST_GUID")
31 - filter("AS_DELETED"=0 AND ("TBLASSETS"."AS_ASSET_DEF"=0 OR "TBLASSETS"."A
S_ASSET_DEF"=1))
Note
-----
- SQL profile "SYS_SQLPROF_014054654a1d0000" used for this statement
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
28343 consistent gets
0 physical reads
0 redo size
1664150 bytes sent via SQL*Net to client
36494 bytes received via SQL*Net from client
3272 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
49053 rows processed
彼らの計画:
Execution Plan
----------------------------------------------------------
Plan hash value: 854387336
--------------------------------------------------------------------------------
------------------------------------------
| Id | Operation | Name
| Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------
------------------------------------------
| 0 | SELECT STATEMENT |
| 1 | 353 | 1321 (1)| 00:00:16 |
| 1 | NESTED LOOPS OUTER |
| 1 | 353 | 1321 (1)| 00:00:16 |
| 2 | NESTED LOOPS OUTER |
| 1 | 149 | 1319 (1)| 00:00:16 |
|* 3 | FILTER |
| | | | |
| 4 | NESTED LOOPS OUTER |
| 1 | 114 | 1318 (1)| 00:00:16 |
| 5 | NESTED LOOPS |
| 1 | 110 | 1317 (1)| 00:00:16 |
| 6 | NESTED LOOPS |
| 1 | 103 | 1317 (1)| 00:00:16 |
| 7 | NESTED LOOPS SEMI |
| 1 | 54 | 1316 (1)| 00:00:16 |
| 8 | VIEW |
| 49426 | 2509K| 1315 (1)| 00:00:16 |
| 9 | NESTED LOOPS ANTI |
| 49426 | 6178K| 1315 (1)| 00:00:16 |
| 10 | VIEW | VW_JF_SET$10554C5A
| 49427 | 4344K| 1314 (1)| 00:00:16 |
| 11 | UNION-ALL |
| | | | |
| 12 | NESTED LOOPS |
| | | | |
| 13 | NESTED LOOPS |
| 1 | 106 | 1 (0)| 00:00:01 |
| 14 | INDEX FULL SCAN | PK_TBLWORKMGMTGP
| 1 | 13 | 0 (0)| 00:00:01 |
|* 15 | INDEX UNIQUE SCAN | PK_TBLASSETTASKS
| 1 | | 0 (0)| 00:00:01 |
|* 16 | TABLE ACCESS BY INDEX ROWID| TBLASSETTASKS
| 1 | 93 | 1 (0)| 00:00:01 |
| 17 | NESTED LOOPS |
| 49426 | 4730K| 1313 (1)| 00:00:16 |
|* 18 | TABLE ACCESS BY INDEX ROWID| TBLASSETTASKS
| 49426 | 4488K| 1310 (1)| 00:00:16 |
|* 19 | INDEX RANGE SCAN | TBLINSPECTIONREPORT_IR_TYPE
| 49456 | | 106 (1)| 00:00:02 |
|* 20 | INDEX UNIQUE SCAN | PK_TBLWORKMGMTINST
| 1 | 5 | 0 (0)| 00:00:01 |
|* 21 | INDEX FULL SCAN | PK_TBLASSETTASKCOPIES
| 1 | 38 | 0 (0)| 00:00:01 |
|* 22 | INDEX RANGE SCAN | PK_TBLWORKFLOWSTAGETREEPARENTS
| 1 | 2 | 0 (0)| 00:00:01 |
|* 23 | TABLE ACCESS BY INDEX ROWID | TBLASSETS
| 1 | 49 | 1 (0)| 00:00:01 |
|* 24 | INDEX RANGE SCAN | IDX_ASSET_STATUS_ASID_DELETED
| 1 | | 0 (0)| 00:00:01 |
| 25 | INLIST ITERATOR |
| | | | |
|* 26 | INDEX RANGE SCAN | IDX_IAM_AS_ID_IN_ID_ACCESS
| 2 | 14 | 0 (0)| 00:00:01 |
| 27 | TABLE ACCESS BY INDEX ROWID | TBLASSETSTATUSES
| 1 | 4 | 1 (0)| 00:00:01 |
|* 28 | INDEX UNIQUE SCAN | PK_TBLASSETSTATUS
| 1 | | 0 (0)| 00:00:01 |
| 29 | TABLE ACCESS BY INDEX ROWID | TBLTASKDEFINITIONS
| 1 | 35 | 1 (0)| 00:00:01 |
|* 30 | INDEX UNIQUE SCAN | PK_TBLTASKDEFINITIONS
| 1 | | 0 (0)| 00:00:01 |
| 31 | VIEW PUSHED PREDICATE |
| 1 | 204 | 2 (0)| 00:00:01 |
| 32 | NESTED LOOPS |
| 1 | 18 | 2 (0)| 00:00:01 |
| 33 | TABLE ACCESS BY INDEX ROWID | TBLWORKFLOWSTAGETREE
| 1 | 4 | 1 (0)| 00:00:01 |
|* 34 | INDEX UNIQUE SCAN | PK_TBLWORKFLOWSTAGEFLOW
| 1 | | 0 (0)| 00:00:01 |
| 35 | TABLE ACCESS BY INDEX ROWID | TBLWORKFLOWSTAGES
| 9 | 126 | 1 (0)| 00:00:01 |
|* 36 | INDEX UNIQUE SCAN | PK_TBLWORKFLOWSTAGES
| 1 | | 0 (0)| 00:00:01 |
--------------------------------------------------------------------------------
------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
3 - filter("TBLASSETSTATUSES"."ASSET_STATUS_HIDE_REPORTS" IS NULL OR
"TBLASSETSTATUSES"."ASSET_STATUS_HIDE_REPORTS"=0)
15 - access("TBLASSETTASKS"."AST_ID"="TBLWORKMGMTGP"."AST_ID")
16 - filter("TBLASSETTASKS"."AST_TYPE"=3 AND "AST_DELETED"=0)
18 - filter("AST_DELETED"=0)
19 - access("TBLASSETTASKS"."AST_TYPE"=4)
20 - access("TBLASSETTASKS"."AST_ID"="TBLWORKMGMTINST"."AST_ID")
21 - access("ITEM_1"="COPY_AST_GUID")
filter("ITEM_1"="COPY_AST_GUID")
22 - access("AST_CURRENT_WFST_ID"="PARENT_WFST_ID")
23 - filter("TBLASSETS"."AS_ASSET_DEF"=0 OR "TBLASSETS"."AS_ASSET_DEF"=1)
24 - access("AS_ID"="TBLASSETS"."AS_ID" AND "AS_DELETED"=0)
26 - access("TBLASSETS"."AS_ID"="TBLINSPECTORASSETMAP"."AS_ID" AND "TBLINSPECT
ORASSETMAP"."IN_ID"=1 AND
("TBLINSPECTORASSETMAP"."IAM_ASSET_ACCESS_LEVEL"=0 OR "TBLINSPECTO
RASSETMAP"."IAM_ASSET_ACCESS_LEVEL"=1))
28 - access("TBLASSETSTATUSES"."ASSET_STATUS_ID"(+)="TBLASSETS"."ASSET_STATUS_
ID")
30 - access("DISPLAYTABLE2"."TD_ID"(+)="TD_ID")
34 - access("WFST"."WFST_ID"="AST_CURRENT_WFST_ID")
36 - access("WFST"."WFS_ID"="WFS"."WFS_ID")
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
337565 consistent gets
0 physical reads
0 redo size
1728165 bytes sent via SQL*Net to client
23140 bytes received via SQL*Net from client
3272 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
49051 rows processed