When doing a select that is ordered by a column that is indexed and has a
limit, does mysql not use the index if the order by is descending?

Here's an example:
select parent,number,lastpost from posts where topic=1 and board='abc' and
approved='yes' order by lastpost desc limit 9,12

My app is a message board and I'm using date descending as the order.  

One thought I had is to create a new column like desctime and set the value
of each post to something like the time value for say 1/1/2025 minus the
lastpost time - that should set it far enough out I wouldn't have to every
worry about it.

Another thought I guess would be to just store the value as a negative value.

If it doesn't use the index in descending order, does anyone have any
suggestions on my thoughts here or other ideas on how to work around this
most efficiently?  

And are there future plans for indexing on desc order?


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to