Subject | When do I need descending index ? |
---|---|
Author | Michael Vilhelmsen |
Post date | 2003-10-09T08:35:57Z |
Hi
Lets say I have e table containing 2 million records.
The table has 50 fields.
I have indexes on some 10 fields, which I use when the user generates
reports. All indexes are ascending.
The use has the option to order the report both ascending and
descending.
The select could be something like:
select * from MyTable where Field1>=1000 and Field1<=257000
order by Field1, field2, field3, field3
Usually they are ordered ascending, but every once in a while the
user order them descending.
Would I then gain anything if I also have a descending index on the
same fields ?
Michael
Lets say I have e table containing 2 million records.
The table has 50 fields.
I have indexes on some 10 fields, which I use when the user generates
reports. All indexes are ascending.
The use has the option to order the report both ascending and
descending.
The select could be something like:
select * from MyTable where Field1>=1000 and Field1<=257000
order by Field1, field2, field3, field3
Usually they are ordered ascending, but every once in a while the
user order them descending.
Would I then gain anything if I also have a descending index on the
same fields ?
Michael