At 16:09 -0400 6/23/04, Alejandro Heyworth wrote:
>I don't see any relationship between your two sentences?
Thanks for the responses.
I guess I was not clear enough in my last post.
You can define an index to sort values in a particular order... ASC
is the default.
DESC is an option, but it is not implemented yet. I want to know
when it will be implemented.
I would like the values in my table to be stored in DESC order.
For example, I want to read ranges of values from my db in the
opposite order of how they are currently being indexed without using
an extra ORDER BY in my select. This ORDER BY forces an internal
sort to put the result set in DESC order which slows my SELECT.
That's not how relational databases work.
If you'd like your results returned in a particular order,
ORDER BY is mandatory. Otherwise, the server is free to
return results in any order it likes.
Currently, if I insert integer values into a table with an index ASC
(or DESC) on the INT column , a general SELECT will return the
values in ascending order.
1 2 3 4 5
I want to naturally store the data as:
5 4 3 2 1
without adding an ORDER BY int_col DESC
There are no options for specifying the order in which rows are stored,
with the exception of ALTER TABLE tbl_name ORDER BY ... Even that
exception goes out the window as soon as you start adding new rows,
because the ALTER TABLE statement won't affect how new rows are stored.
It would make a world of difference to our app since we are dealing
with huge ranges of joint compression information that need to be
read out sequentially.
It shouldn't make any difference. If you're using MySQL 3.23, please
consider upgrading to 4.0, which fixes the problem that ORDER BY DESC
doesn't use indexes.
I hope this is clearer.
So, does anyone know when it will be implemented?
--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]