Re: Is this using the key?
Posted in 1997
> I have a table which has a date-time column as part of the key > If my select statement has "BETWEEN" two date-time values, > will the engine use the date-time column as part of the index? > > ie select * from table > where dte_tme between value_a and value_b > > where the key is dte_tme > is the index being used here? > > this is on SE version 7.12 on SCO openserver 5 Just enter "Set Explain On;" right before your query and let it run. Set explain will create a nice little file called sqexplain.out. This file will let you know what is going on. Remember that as you run update statistics periodically to give the system tables more information about real tables, the optimizer may change its mind on how it decides to get the data. I think chapter 4 of the performance guide is well worth a read. Good luck. -- Bob Carts - SAIC rcarts@agccs.lmco.com 703-813-2914