Subject | Re: [firebird-support] Re: Index for ascending and descending order? |
---|---|
Author | Ann W. Harrison |
Post date | 2009-04-16T16:15:48Z |
svanderclock wrote:
selecting 999,800 records you don't want.
faster by selecting and sorting. Retrieving records in index order
is faster if you care only about the time to get the first record.
Good luck,
Ann
>> Once again: you don't.By selecting the last 200 on some identifiable criteria and not
>> Indexes are useful for data filtering. For ordering they are less useful.
>
> what???? of course not !! for ordering index can be very very important !! if
> you have a result set of 1.000.000 record and want to diplay only the 200 last
> items, and also you are a web server than handle thousand of request every second,
> how you do if you don't have index on ordering ???
selecting 999,800 records you don't want.
>Even if your result set is large, you'll finish the whole operation
> It's easy : if you result set is little then it's better to use the index in
> the filtering, if you result set is important it's better to use the index
> on the ordering ! this thing like this, the optimizer can't choose the best
> way, and this why we MUST sometime use ourself the PLAN ! i see some query
> that can go from 1 minute to 0.1 seconde depend of with way you choose
>
faster by selecting and sorting. Retrieving records in index order
is faster if you care only about the time to get the first record.
Good luck,
Ann