joe-QzMH92Wc/[EMAIL PROTECTED] wrote:
I'm finding that ORDER BY is surprisingly slow, and it makes me
wonder if I'm doing something wrong. Here's the situation:
I need to select a large set of records out of a table, sort them by
one column, and then get just a subset of the sorted list. (For
example, I might want records 40-60 ordered by date, which is a
completely different set than records 40-60 ordered by user ID.) I
start with the full list of record IDs I want, and a query something
like this:
SELECT <fields> FROM <table> WHERE recID IN (<record IDs> ORDER BY
dateFld
Why not just
select <fields> from <table> order by dateFld;
? Can you show the exact query you use? There must be more to your
query - something that prevents an index on dateFld from being used.
Igor Tandetnik