Subject | Index for ascending and descending order? |
---|---|
Author | Jeff Dunlap |
Post date | 2009-04-15T18:52:21Z |
I have a question about ORDER BY and ascending and descending orders.
I plan to display some data ordered by a timestamp field and plan to allow the user to order either in ascending or descending order.
Do I need to create two different indexes, one ordered in ascending and the other in descending?
The reason for asking is that I am slowly weaning off a local flat file database that writes indexes that are automatically optimized for either ascending or descending order (for non-compounded indexes only of course), thus you create a single index on a field without specifying ascending or descending orders.
Thank you in advance
I plan to display some data ordered by a timestamp field and plan to allow the user to order either in ascending or descending order.
Do I need to create two different indexes, one ordered in ascending and the other in descending?
The reason for asking is that I am slowly weaning off a local flat file database that writes indexes that are automatically optimized for either ascending or descending order (for non-compounded indexes only of course), thus you create a single index on a field without specifying ascending or descending orders.
Thank you in advance