Why does the optimizer do this ? uhmmmmmm
Posted in 1996
Something I noticed with Set Explain;
Index:
Unique Index: location_pk, bldg_no, div_number
QUERY:
------
select location_pk, loc_type from raw_inventory where location_pk =311006511
Estimated Cost: 2
Estimated # of Rows Returned: 3
1) informix.raw_inventory: SEQUENTIAL SCAN
Filters: informix.raw_inventory.location_pk = 311006511
QUERY:
------
select location_pk from raw_inventory where location_pk = 311006511
Estimated Cost: 1
Estimated # of Rows Returned: 3
1) informix.raw_inventory: INDEX PATH
(1) Index Keys: location_pk bldg_no div_number (Key-Only)
Lower Index Filter: informix.raw_inventory.location_pk =
311006511
==================================================================== If you are
using a composite index and only use the first part of the index in your where
clause. You will get a performance hit if you select anything other than that
column.
If the where clause included the entire key, you can select other cohe where
clause included the entire key, you can select other columns without any
peformance delays.