假设我创建了降序索引
CREATE INDEX `MyTable.MyIndex`
USING BTREE ON `MyTable` (`DateFrom` DESC, `DateTo` DESC);
我想从 information_schema
获取有关它的信息。
根据 documentation information_schema.statistics
表完成这项工作。
但是我找不到有关索引列顺序的任何信息(即 ASC
或 DESC
)。
我如何找到该信息?
最佳答案
适用于 MySQL 版本 < 8
表统计信息在文档中的什么地方写的?
此外,我在 the create index doc 中发现这个:
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 - 从 MySQL 中的信息模式获取索引方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10947197/