mysql - 从 MySQL 中的信息模式获取索引方向

标签 mysql indexing information-schema

假设我创建了降序索引

CREATE INDEX `MyTable.MyIndex`
USING BTREE ON `MyTable` (`DateFrom` DESC, `DateTo` DESC);

我想从 information_schema 获取有关它的信息。

根据 documentation information_schema.statistics 表完成这项工作。 但是我找不到有关索引列顺序的任何信息(即 ASCDESC)。

我如何找到该信息?

最佳答案

适用于 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/

相关文章:

sql - 如何列出 Informix 中的所有函数?

php - 将此字符串转换为日期格式以保存到 mysql

php - 如何使用mysql php更改查询中的日期格式

sql - SQL Server 中多个位字段的索引

r - 扩展将 data.table 作为参数的函数以使用完整表(而不是子集)

sql - Postgres 9.4 jsonb 数组作为表

netezza - Netezza 的信息架构 (INFORMATION_SCHEMA)

MySQL 数据库引擎 : MyISAM for information_schema but InnoDB for other databases

java - 我如何从一个表中调用 2 行以显示在 jtable 中

mysql - MySQL order by 子句中的连字符