Subject RE: [firebird-support] Indexing Questions
Author Alan McDonald
> I want to index an APPOINTMENT table to speed up my selects. The
> two fields
> I frequently select on are APPOINTMENTDATE and APPOINTMENTTIME.
>
> I believe I should index APPOINTMENTDATE *descending*, since I generally
> access more future dates then past dates. Am I correct?
>
> Should I index both fields combined in one index or index them
> individually
> in separate indexes?
>
> Thanks,
>
> Anthony
>

if your queries are mainly
ORDER BY APPOINTMENTDATE DESC

then create a desc index on this field.
if your queries are mainly
ORDER BY APPOINTMENTDATE
then put a default ascending index on it.

apply the same logic to the time field. there is no need to create compound
indexes.
I would have, however, just made a timestamp field as one filed which
contain datetime - why did you separate them? Your client can still separate
them for display and manipulation if that's what is wanted.
Alan