Bug #13375 Index with Desc sort feature
Submitted: 21 Sep 2005 11:14 Modified: 20 Dec 2006 5:39
Reporter: Sebastián Araya Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: DDL Severity:S4 (Feature request)
Version:4.x, 5.x, 6.0 OS:Any (All)
Assigned to: Geir Høydalsvik CPU Architecture:Any

[21 Sep 2005 11:14] Sebastián Araya
  In case you need to sort in descending way, you need to build a new field which can be used to perform the index creation, because MySQL only index ascending collation.

How to repeat:
  As section 13.1.4 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 value storage. Currently they are parsed but ignored; index values are always stored in ascending order. 

Suggested fix:
  Index in ascending and descending order.
[20 Dec 2006 5:39] Valeriy Kravchuk
Thank you for a reasonable feature request.
[4 Apr 2009 17:39] Mark Callaghan
Supporting DESC index keys is a feature request.
Changing MySQL to not parse and ignore unsupported features is a bug fix.


'parsed but ignored' is a bad idea
[4 May 2011 19:48] MySQL Verification Team
bug #61060 is a duplicate of this
[4 May 2011 20:17] Stephen Jackson
This is standard in Postgres, SQL Server, Oracle, Sybase etc etc etc. Can we please see this implemented in MySQL?

Its in the documentation for create index syntax with the comment  

"These keywords are permitted for future extensions for specifying ascending or descending index value storage. Currently, they are parsed but ignored; index values are always stored in ascending order."

Its retarded and very wasteful to make extra columns with negated values so we can make an order by "asc desc asc" into "desc desc desc" for example....

Pretty please?
[4 May 2011 20:54] Dave Edwards
I echo all the above comments. Having the ability to create an index DESC is really a fundamental requirement and this feature should be high up on the list for implementation.


Dave Edwards
[8 Aug 2011 9:03] Kristian Srensen
Please please please implement this.
[7 Nov 2011 17:44] Matthew Painter
I would definitely argue that this is actually two tickets: a a feature request, and a bug.

People would expect that as the syntax is supported at the time of index creation, the index will be properly created.

What happens if you create an index with DESC? The index gets created as ASC? This is not creating what I have requested, so is a bug.

Were the DDL to fail so that you cannot create DESC indexes, adding in support for DESC indexes would be a feature request, don't you think?

So the bug is: DESC indexes created as ASC
So the enhancement is: DESC index support

Further, the MySQL workbench allows you to edit indexes so they are ASC or DESC - should this feature be removed from the workbench?

Having it accept it silently makes it seem that you have this functionality :)
[7 Nov 2011 17:47] MySQL Verification Team
Matthew, the list of silently ignored syntax is the topic of bug #47771 :)
[7 Nov 2011 17:49] Matthew Painter
Thanks Shane :) Madness....
[7 Nov 2011 18:29] Mark Callaghan
And the number one search result for "parsed but ignored" on Google:

is dedicated to this issue:
[15 May 2012 19:59] Joseph Hagerty
Goodness gracious, this should be top priority. MySql looks like a children's toy without this feature.
[14 Oct 2012 12:51] Mikhail Gavrilov
Agree with all. Very needed feature...
[27 Mar 2013 19:52] yonathan garti
[20 Oct 2016 16:28] Alexey Kopytov
This bug is fixed in the 8.0 optimizer labs release: http://mysqlserverteam.com/mysql-8-0-labs-descending-indexes-in-mysql/