It sounds like the values you want to index our timestamps. If this is the case you can do something tricky like using an integer column, and storing -(unixtimesamp) values so that what mysql sees as ASC will really be your data in DESC order. Of course there is some overhead involved now in doing a unary - operation on each value and in converting the unixtimestamp to whatever format you need it in.
I wouldn't recommend relying on the index to keep records sorted anyway, there is no gurantee they will be you really ought to use the order by even when selecting ASC. John A. McCaskey -----Original Message----- From: gerald_clark [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 23, 2004 1:30 PM To: Alejandro Heyworth Cc: [EMAIL PROTECTED] Subject: Re: INDEX DESC 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. Values are stored wherever the engine finds room. > > > 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. > > 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 Not guaranteed without ORDER BY. > > > I want to naturally store the data as: > 5 4 3 2 1 > without adding an ORDER BY int_col DESC You still must. > > > 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. > > I hope this is clearer. > > So, does anyone know when it will be implemented? > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]