Subject | Re: [firebird-support] Re: Index for ascending and descending order? |
---|---|
Author | Kjell Rilbe |
Post date | 2009-04-16T04:24:48Z |
jeff_j_dunlap wrote:
gain if you have an index for each ordering your user might request.
That means both a ascending and a descending index for the timestamp column.
But if your result set is small, the faster ordering of the result set
is probably outweighed by the extra work the engine has to do on updates
to maintain the extra index or indexes.
Finally, why don't you just try it out for yourself? Fill your database
with some realistic test data and do some timing on the fetch!
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
> I currently do select a subset of data using select and use ORDER BY toIf you expect to display large result sets, I would expect a performance
> order the data. But before I release my web application, I want
> everything to be as efficient as possible and don't want the database to
> have to order tables each time a user chooses to order data differently.
gain if you have an index for each ordering your user might request.
That means both a ascending and a descending index for the timestamp column.
But if your result set is small, the faster ordering of the result set
is probably outweighed by the extra work the engine has to do on updates
to maintain the extra index or indexes.
Finally, why don't you just try it out for yourself? Fill your database
with some realistic test data and do some timing on the fetch!
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64