Subject | Re: Performance with joins and order by |
---|---|
Author | Christian Kaufmann |
Post date | 2004-08-04T07:54:48Z |
Hi Arno
order clause and now the query seems really faster. The plan is:
PLAN JOIN (RI ORDER IX_RANKINGITEM_WORLD,SR INDEX (PK_SWIMRESULT),A
INDEX (PK_ATHLETE),C INDEX (PK_CLUB))
So RANKINGID in the order clause seems to be important, even if all
records to retreive have the same value for it.
Thanks for the quick answer.
cu Christian
> The Query with the ORDER BY (SORT in PLAN) first fetch all resultsThat's what I thought.
> internally and perform a sort on the results. After that only 25
> If you really need a fast behaviour for this you can create a singleI already had an index on RANKINGID,PLACE. So I added RANKINGID to the
> index on RI.PLACE, but probably better is a compound index on
> RANKINGID, PLACE and but it in the same order in the ORDER BY
order clause and now the query seems really faster. The plan is:
PLAN JOIN (RI ORDER IX_RANKINGITEM_WORLD,SR INDEX (PK_SWIMRESULT),A
INDEX (PK_ATHLETE),C INDEX (PK_CLUB))
So RANKINGID in the order clause seems to be important, even if all
records to retreive have the same value for it.
Thanks for the quick answer.
cu Christian