Re: INDEX DESC

2004-06-27 Thread Robert A. Rosenberg
At 15:30 -0400 on 06/23/2004, Michael Stassen wrote about Re: INDEX DESC: The manual http://dev.mysql.com/doc/mysql/en/CREATE_INDEX.html says An index_col_name specification can end with ASC or DESC. These keywords are allowed for future extensions for specifying ascending or descending index

Re: INDEX DESC

2004-06-27 Thread Robert A. Rosenberg
At 16:38 -0400 on 06/23/2004, Michael Stassen wrote about Re: INDEX DESC: 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

Re: INDEX DESC

2004-06-24 Thread Jochem van Dieten
Michael Stassen wrote: SELECT init FROM inits GROUP BY init ORDER BY init; +--+ | init | +--+ | A| | B| | C| ... | X| | Y| | Z| +--+ 26 rows in set (0.39 sec) SELECT init FROM inits GROUP BY init ORDER BY init DESC; +--+ | init | +--+ | Z| | Y| |

Re: INDEX DESC

2004-06-24 Thread Michael Stassen
Jochem van Dieten wrote: Michael Stassen wrote: SELECT init FROM inits GROUP BY init ORDER BY init; +--+ | init | +--+ | A| | B| | C| ... | X| | Y| | Z| +--+ 26 rows in set (0.39 sec) SELECT init FROM inits GROUP BY init ORDER BY init DESC; +--+ | init |

Re: INDEX DESC

2004-06-23 Thread Paul DuBois
At 11:36 -0400 6/23/04, Alejandro Heyworth wrote: Does anyone know when INDEX DESC will be implemented? I'm storing time values and want to access the data from the most recent time value without sorting the result set. I don't see any relationship between your two sentences? -- Paul DuBois,

Re: INDEX DESC

2004-06-23 Thread Jeremy Zawodny
On Wed, Jun 23, 2004 at 11:36:52AM -0400, Alejandro Heyworth wrote: Does anyone know when INDEX DESC will be implemented? I'm storing time values and want to access the data from the most recent time value without sorting the result set. Why is sorting required at all? Indexes *are* sorted

Re: INDEX DESC

2004-06-23 Thread gerald_clark
I suspect he is refering to 3.23's inability to use an index on a ORDER BY xxx DESC Jeremy Zawodny wrote: On Wed, Jun 23, 2004 at 11:36:52AM -0400, Alejandro Heyworth wrote: Does anyone know when INDEX DESC will be implemented? I'm storing time values and want to access the data from the most

Re: INDEX DESC

2004-06-23 Thread Michael Stassen
Alejandro Heyworth wrote: Does anyone know when INDEX DESC will be implemented? I'm storing time values and want to access the data from the most recent time value without sorting the result set. Paul DuBois wrote: I don't see any relationship between your two sentences? Jeremy Zawodny wrote: Why

Re: INDEX DESC

2004-06-23 Thread Alejandro Heyworth
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

Re: INDEX DESC

2004-06-23 Thread Jeremy Zawodny
On Wed, Jun 23, 2004 at 02:28:15PM -0500, gerald_clark wrote: I suspect he is refering to 3.23's inability to use an index on a ORDER BY xxx DESC In other words ancient history :-) Jeremy -- Jeremy D. Zawodny | Perl, Web, MySQL, Linux Magazine, Yahoo! [EMAIL PROTECTED] |

Re: INDEX DESC

2004-06-23 Thread gerald_clark
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

Re: INDEX DESC

2004-06-23 Thread gerald_clark
Jeremy Zawodny wrote: On Wed, Jun 23, 2004 at 02:28:15PM -0500, gerald_clark wrote: I suspect he is refering to 3.23's inability to use an index on a ORDER BY xxx DESC In other words ancient history :-) Not only that, but without ORDER BY, no order is assured. Jeremy -- MySQL General

Re: INDEX DESC

2004-06-23 Thread Michael Stassen
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

Re: INDEX DESC

2004-06-23 Thread SGreen
Subject: Re: INDEX DESC

RE: INDEX DESC

2004-06-23 Thread John 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

Re: INDEX DESC

2004-06-23 Thread Matt W
Hi Michael, - Original Message - From: Michael Stassen Sent: Wednesday, June 23, 2004 2:30 PM Subject: Re: INDEX DESC Jeremy Zawodny wrote: Why is sorting required at all? Indexes *are* sorted already. I expect he's referring to mysql's poor performance when doing ORDER

Re: INDEX DESC

2004-06-23 Thread Keith Ivey
Alejandro Heyworth wrote: 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 That may be true, but only because you haven't been adding and deleting records. It's not something

Re: INDEX DESC

2004-06-23 Thread Alejandro Heyworth
That could be. If so, it's a MySQL 3.23 limitation that was fixed in MySQL 4.0. So, what we are agreeing on is that MySQL 4.x does in fact support both DESC and ASC indexes? If this is the case and we're doing something wrong here, cool! I definitely think the docs should reflect this

Re: INDEX DESC

2004-06-23 Thread Paul DuBois
At 17:06 -0400 6/23/04, Alejandro Heyworth wrote: That could be. If so, it's a MySQL 3.23 limitation that was fixed in MySQL 4.0. So, what we are agreeing on is that MySQL 4.x does in fact support both DESC and ASC indexes? No, what we're saying is that in 3.23, MySQL did not efficiently

Re: INDEX DESC

2004-06-23 Thread Matt W
Hi Gerald, - Original Message - From: gerald_clark Sent: Wednesday, June 23, 2004 2:28 PM Subject: Re: INDEX DESC I suspect he is refering to 3.23's inability to use an index on a ORDER BY xxx DESC That's not always true. 3.23 WILL use the index for ORDER BY ... DESC in a query like

Re: INDEX DESC

2004-06-23 Thread Paul DuBois
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

Re: INDEX DESC

2004-06-23 Thread Paul DuBois
At 15:30 -0400 6/23/04, Michael Stassen wrote: Alejandro Heyworth wrote: Does anyone know when INDEX DESC will be implemented? I'm storing time values and want to access the data from the most recent time value without sorting the result set. Paul DuBois wrote: I don't see any relationship

Re: INDEX DESC

2004-06-23 Thread Michael Stassen
Matt W wrote: Hi Michael, - Original Message - From: Michael Stassen I expect he's referring to mysql's poor performance when doing ORDER BY indexed_column DESC relative to ORDER BY indexed_column ASC. The performance is only poor when using an index for DESC, *if the index is PACKED*.