より高速な結果を得るために、以下のクエリ /index を改善する方法を提案してください。
クエリ
SELECT Tab1.pk, Tab1.c_RetryCount, Tab1.c_TimeCreated
FROM Table1 Tab1
WHERE ( ( Tab1.c_node = :1
OR Tab1.c_node IS NULL )
AND ( ( Tab1.c_RetryCount < :2
AND Tab1.c_TimeUpdated < :3 )
OR Tab1.c_RetryCount < :4 )
AND Tab1.c_SentStatus = :5 )
AND ( Tab1.c_Active = 1 )
AND ( Tab1.c_DelFlag = 0 )
AND ( Tab1.c_Shard = :6 )
ORDER BY Tab1.c_RetryCount ASC, Tab1.c_TimeCreated ASC
企画ハッシュ値:2132878353
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | | | 4 (100)| |
| 1 | SORT ORDER BY | | 43 | 2279 | 4 (25)| 00:00:01 |
| 2 | CONCATENATION | | | | | |
|* 3 | TABLE ACCESS BY INDEX ROWID| Table1 | 1 | 53 | 1 (0)| 00:00:01 |
|* 4 | INDEX RANGE SCAN | I_VOY52S_H881K4 | 1 | | 1 (0)| 00:00:01 |
|* 5 | TABLE ACCESS BY INDEX ROWID| Table1 | 42 | 2226 | 2 (0)| 00:00:01 |
|* 6 | INDEX RANGE SCAN | I_VOY52S_H881K4 | 2 | | 2 (0)| 00:00:01 |
-------------------------------------------------------------------------------------------------
述語情報 (操作 ID で識別):
3 - filter(("Tab1"."c_DelFlag"=0 AND "Tab1"."c_ACTIVE"=1))
4 - access("Tab1"."c_Shard"=:6 AND "Tab1"."c_node" IS NULL
AND "Tab1"."c_SENTSTATUS"=:5)
filter(("Tab1"."c_SENTSTATUS"=:5 AND ("Tab1"."c_RETRYCOUNT"<:4 OR
("Tab1"."c_TIMEUPDATED"<:3 AND "Tab1"."c_RETRYCOUNT"<:2))))
5 - filter(("Tab1"."c_DelFlag"=0 AND "Tab1"."c_ACTIVE"=1))
6 - access("Tab1"."c_Shard"=:6 AND "Tab1"."c_node"=:1 AND
"Tab1"."c_SENTSTATUS"=:5)
filter(("Tab1"."c_SENTSTATUS"=:5 AND ("Tab1"."c_RETRYCOUNT"<:4 OR
("Tab1"."c_TIMEUPDATED"<:3 AND "Tab1"."c_RETRYCOUNT"<:2)) AND
LNNVL("Tab1"."c_node" IS NULL)))
表 Table1 の索引:
I_VOY52S_19HS9Y5 (c_SENTSTATUS, c_ACTIVE, c_DelFlag)
I_VOY52S_1CPSX8O (c_node)
I_VOY52S_H881K4 (c_Shard, c_node, c_RETRYCOUNT, c_TIMEUPDATED, c_SENTSTATUS)
P_VOY52S_142KZ99 (pk)