Subject RE: [firebird-support] Looking for advice on indexes
Author Leyne, Sean

> W dniu 03.05.2013 19:18, Leyne, Sean pisze:

> > For this query, a DESCENDING compound index with the ID and
> WORK_DATE would be best.
> >
> Are you sure that it should be ID not SITE_ID?

Sorry, typo!

Yes, it should be SITE_ID

> I've created DESCENDING index for SITE_ID, WORK_DATE and it looks really
> fast despite fact that all records have been read (according to IB Expert
> Performance Analisys).

That is not what I would expect. (It should have read 1 row per SITE_ID to confirm that the "max" value was valid for the candidate row).

What is the selectivity/distribution of values in your table?