Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Order by ... DESC question
Thu, Dec 17 2009 8:03 AMPermanent Link

Uli Becker
Hi,

"select * from buchungen order by buchungsdatum desc"

takes 1.2 seconds to filter about 11,000 from 40,000 records.

"select * from buchungen order by buchungsdatum"

needs just 0.1 seconds. Does the descending order prevent the query from
using the index on "buchungsdatum"?

Uli
Thu, Dec 17 2009 8:34 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Uli

>needs just 0.1 seconds. Does the descending order prevent the query from
>using the index on "buchungsdatum"?

Quick answer - yes.

Just as in DBISAM indices in ElevateDB are unidirectional. There's also the added complication of collation. You need to make sure everything matches for an index to be of use.

Roy Lambert [Team Elevate]
Thu, Dec 17 2009 9:42 AMPermanent Link

Uli Becker
Roy,

> Just as in DBISAM indices in ElevateDB are unidirectional. There's also the added complication of collation. You need to make sure everything matches for an index to be of use.

Thanks. So I'll try to create two indexes, one asc and one desc. Any
reason why that shouldn't work?

Uli
Thu, Dec 17 2009 12:40 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Uli

>Thanks. So I'll try to create two indexes, one asc and one desc. Any
>reason why that shouldn't work?

Not that I know of, but if I'm wrong I'm sure someone will tell us.

Roy Lambert [Team Elevate]
Image