Subject Re: Indexing Questions
Author Adam
--- In firebird-support@yahoogroups.com, "Anthony Tanas" <anthony@...>
wrote:
>
> > 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.
>
> The queries I am concerned with are un-ordered. I load them into
objects,
> the order I select them in doesn't matter for my purpose.
>
> But I do select them based on APPOINTMENTDATE (i.e. 'WHERE
APPOINTMENTDATE =
> :APPOINTMENTDATE')...I was thinking an index would improve
performance for
> it? And I was thinking since I mostly select more recent dates
relative to
> all the appointments in the table that descending was what I needed?
>

No, the only difference between an ascending or descending index is
when it is used for sorting. Otherwise, neither has any benefit over
the other.

Adam