Subject Last
Author Sandeep

This thing is troubling me too much so I'm going to ask this
question again.

When I do last on a table with 700 records it takes 3 secs. I don't
have a descending index on that field. But if I add a descending
index it's a snap.

If the prepared sql statement doesn't puts Order by fieldA desc
clause it doesn't takes that long to execute. The descending index
becomes helpful only if the number of records are more (more than
10,000). So if that order by clause is added only if the record
number in table is more than 10,000 (or some predefined value /
maybe have a property which can be set to indicate to use desc
caluse when doing last) it would make it very quick when doing last.
And would avoid the need for having another index for every index



Software Developer