Subject Re: slow query
Author Stephen Boyd
--- In firebird-support@yahoogroups.com, Svein Erling Tysvaer <svein.erling.tysvaer@...> wrote:
>
> What's the reported plan (and query speed) if you try
>
> SELECT *
> FROM BILLING_IMG_TABLE
> WHERE LOCATION = 'XX' AND NUMBER = 123 AND IMAGE_TYPE = 'XX'
> ORDER BY AS$IMAGE_NUMBER+0;
>

The plan for the above query is:

PLAN SORT ((BILLING_IMG_TABLE INDEX (BILLING_PRO_KEY)))

which is what I would expect. This tells me that the index is enabled and usable. In fact this is the same PLAN that is reported when I specifically name BILLING_PRO_KEY in a PLAN clause.

The above query returns the result almost immediately, which is also what I would expect.

There are no NULL keys in this index.