从MySQL中的信息模式获取索引方向 [英] Get index direction from information schema in MySQL
问题描述
假设我创建了降序索引
CREATE INDEX `MyTable.MyIndex`
USING BTREE ON `MyTable` (`DateFrom` DESC, `DateTo` DESC);
我想从information_schema
获取有关它的信息.
I want to get information about it from information_schema
.
根据文档 information_schema.statistics
表可以工作.
但是我找不到有关索引的列顺序的任何信息(即ASC
或DESC
).
According to documentation information_schema.statistics
table does the job.
However I can't find any information about column order for indexes (i.e. ASC
or DESC
).
我如何找到该信息?
推荐答案
表统计信息在文档中写在哪里?
Where is it written in the documentation that the table statistics does the job ?
此外,我在创建索引文档中找到了这:
index_col_name规范可以以ASC或DESC结尾.
这些关键字允许将来用于指定升序或降序索引值存储的扩展.
目前,它们已被解析但被忽略;索引值始终按升序存储.
An index_col_name specification can end with ASC or DESC.
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.
这篇关于从MySQL中的信息模式获取索引方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!