On Thu, Aug 23, 2001 at 11:11:38AM -0700, Steven Roussey wrote:
> >
> > 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).
And it's also worth knowing that this is fixed in 4.0.
Jeremy
--
Jeremy D. Zawodny, <[EMAIL PROTECTED]>
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936
MySQL 3.23.41-max: up 8 days, processed 107,141,973 queries (140/sec. avg)
---------------------------------------------------------------------
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