Subject | Re: [firebird-support] Re: slow: "select first(1) * from table where partnumber >= :search order by partnumber" |
---|---|
Author | Ann W. Harrison |
Post date | 2005-06-22T17:56:43Z |
b404_r66 wrote:
sorting those rows to product the FIRST 1.
Only the simplest of queries actually walk the index. As a general
rule, selecting the FIRST repeatedly is an n-squared operation, so if
you want to
a sequential pointer.
Regards,
Ann
> PLAN SORT ((LAGERKARTE INDEX (IX_LAGERKARTE_BESTELLNR,All the plans are using the index to select the qualifying rows then
> IX_LAGERKARTE_BESTELLNR)))
>
> Is using the same plan. So an ascending index might help on descending
> orders as well?
sorting those rows to product the FIRST 1.
Only the simplest of queries actually walk the index. As a general
rule, selecting the FIRST repeatedly is an n-squared operation, so if
you want to
> .. emulate single record displays and thethe best strategy is to create a sorted stream and move through it with
> movement of a sequentiel pointer through a sorted column.
a sequential pointer.
Regards,
Ann