Subject | Re: [ib-support] Re: Query Slow - Help |
---|---|
Author | Helen Borrie |
Post date | 2003-06-08T13:25:49Z |
At 01:00 PM 8/06/2003 +0000, you wrote:
causing the optimizer not to use the index for the sort. With the ORDER
BY, it is using no index; without it, it is using the index on the primary
key.
Show us the plan - that is the only way to tell which indexes (if any) the
optimizer is using.
heLen
>--- In ib-support@yahoogroups.com, Helen Borrie <helebor@t...> wrote:Does this column Cust_no happen to be the primary key of the table?
>Helen,
> I have one more field in the query called CUST.Cust_no.And this
>field is having a index on CUST table.If i give order by CUST_NO, now
>it takes 3 minutes 2 seconds for fetching the same 27019 records,
> If i remove the order by clause, then it takes 2 minutes 55 secondsWhat you describe is a symptom of an index "stepping on" a primary key and
>for fetching 27019 records.
causing the optimizer not to use the index for the sort. With the ORDER
BY, it is using no index; without it, it is using the index on the primary
key.
Show us the plan - that is the only way to tell which indexes (if any) the
optimizer is using.
heLen