>
> mysql> explain select * from dominf.domip order by ip desc;
>
> 'ORDER BY something DESC' does not use an index. It must
> be ascending. See the manual.

Also, I forgot, if you do this often and it needs to be in DESC order, you
can always alter the app to create and use an extra column 'ip_desc unsigned
int not null' and set it in an insert to (0xFFFFFFFF - ip) and have an index
on ip_desc. (If the column was signed you would use 0x7FFFFFF - thevariable,
but ip numbers need to be stored as unsigned).


Sincerely,
Steven Roussey
http://Network54.com/?pp=e

PS: I'm trying to set aside a week in September to augment the MySQL code to
use an index even with DESC in these situations. MySQL AB has some
unfinished code to do this that I'm working from. I'm just familiarizing
myself with the context of the code right now.


---------------------------------------------------------------------
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