Index useage?
Posted in 1999
Stephen Roach — — source: Informix-list mailing list archive (1991-1998)
I'm running a delete with a join looking something like:
delete from table1
where exists (select *
table2 tab2
where tab2.pk = table1.pk
and tab2.flag = "Y")
table2 has an index on the pk column but the index is not used. If I
include the tab2.flag column in the index then it is used.
I thought that the optimiser would use the single column index and
then scan the result for the flag. On similar statements, this is
exactly what happens.
Any ideas?
---------------------------------------------------------
Steve Roach: Remove NOSPAM from address to reply:
roach@NOSPAMportalinc.com
steve_roach@NOSPAMhotmail.com