有一个order by a asc ,b desc,c desc 的排序
建了个索引 create index index_o on A(a asc,b desc,c desc)
但是没有用 难道order by 后面的只有在全升序或者全降序的条件下才有用?
数据库是mysql5
有一个order by a asc ,b desc,c desc 的排序
建了个索引 create index index_o on A(a asc,b desc,c desc)
但是没有用 难道order by 后面的只有在全升序或者全降序的条件下才有用?
数据库是mysql5
[quote]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. [/quote]
嗯,当前索引列只有 ASC 有效。连 6.0 都不支持 DESC。
参考
[url]http://dev.mysql.com/doc/refman/5.4/en/create-index.html[/url]