Index Only Scan On Partitioned Table
e.g. 1
( select reportable_id from vertex_report.cash WHERE reportable_id = '12345'; )
Plan | |
---|---|
SELECT STATEMENT CHOOSE SELECT STATEMENT CHOOSE Cost: 3 Bytes: 36 Cardinality: 3 | |
1 INDEX RANGE SCAN INDEX VERTEX_REPORT.I$CASH$REPORTABLE INDEX RANGE SCAN INDEX VERTEX_REPORT.I$CASH$REPORTABLE Cost: 3 Bytes: 36 Cardinality: 3 |
--
However, if the table is partitioned, say on date, the query interogates both the partitioned index and the partition of the table (can be seen in an explain plan of eg2). Why does it not use just the partitioned index only as the data is in the partitioned index. Why does it also need to go to the table partition associated with that partitioned index. Can just the index scan be forced?