Re: Is this using the key?
Posted in 1997
nils@quantum.co.za (Guru) wrote:
:Hi,
:
: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
There is realy only one way to tell if an index is beeing used: Use
set explain on and look at the sqexplain.out file that is generated.This statement should be able to use the index. If it doesn't you
should check out your update statistics statements. (You do run update
statistics every so often?)
:(please respond by e-mail as well)
:
:Thanks
:Nils Woxholt
:nils@quantum.co.za
Nils.Myklebust@idg.no
NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway
My opinions are those of my company
The Informix FAQ is at http://www.iiug.org