indexing null values curious case?
From: Vishnu Potukanuma <vishnupotukanuma_at_gmail.com>
Date: Thu, 21 Nov 2019 13:47:09 +0530
Message-ID: <CAP-RywwruTs8Sa1wC4YJKZsq+TX-qkX6HS+woAuvpfRu-WcxnQ_at_mail.gmail.com>
Hi,
row#1[8006] flag: -------, lock: 2, len=13
but things as expected, index doesn't store entries when the leading column is null.
Index: IDX
resc_io: 1039.000000 resc_cpu: 237414695 ix_sel: 0.000000 ix_sel_with_filters: 1.000000 Access Path: index (FFS)
Cost: 1045.663711 Resp: 1045.663711 Degree: 1
Date: Thu, 21 Nov 2019 13:47:09 +0530
Message-ID: <CAP-RywwruTs8Sa1wC4YJKZsq+TX-qkX6HS+woAuvpfRu-WcxnQ_at_mail.gmail.com>
Hi,
col 0; len 2; (2): c1 02 col 1; NULL col 2; len 6; (6): 01 c0 21 dc 00 00
row#1[8006] flag: -------, lock: 2, len=13
col 0; len 2; (2): c1 03 col 1; NULL col 2; len 6; (6): 01 c0 21 dc 00 02
but things as expected, index doesn't store entries when the leading column is null.
here the oracle goes with the index scan and returns zero results. which is
inconsistent result.
optimizer trace considers that index with (student_id, '');
Access Path: TableScan
Cost: 21017.655599 Resp: 21017.655599 Degree: 0
Cost_io: 20995.000000 Cost_cpu: 807173669 Resp_io: 20995.000000 Resp_cpu: 807173669 Access Path: index (index (FFS))
Index: IDX
resc_io: 1039.000000 resc_cpu: 237414695 ix_sel: 0.000000 ix_sel_with_filters: 1.000000 Access Path: index (FFS)
Cost: 1045.663711 Resp: 1045.663711 Degree: 1
Cost_io: 1039.000000 Cost_cpu: 237414695 Resp_io: 1039.000000 Resp_cpu: 237414695
- Costing Index IDX SPD: Return code in qosdDSDirSetup: NOCTX, estType = INDEX_SCAN SPD: Return code in qosdDSDirSetup: NOCTX, estType = INDEX_FILTER Access Path: index (IndexOnly) Index: IDX resc_io: 5.000000 resc_cpu: 235407 ix_sel: 6.6556e-04 ix_sel_with_filters: 6.6556e-04 Cost: 5.006607 Resp: 5.006607 Degree: 1 Best:: AccessPath: IndexRange Index: IDX Cost: 5.006607 Degree: 1 Resp: 5.006607 Card: 999.000000 Bytes: 0.000000
probably we are hitting an undeveloped section of optimizer? producing a wrong plan is ok, but producing wrong results?
Thanks,
vishnu
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Nov 21 2019 - 09:17:09 CET