gpt4 book ai didi

MySQL KEY 参数创建中的编号

转载 作者:行者123 更新时间:2023-11-29 22:03:50 25 4
gpt4 key购买 nike

我查看了一些 SQL 脚本,想知道 KEY 运算符后面的大括号中的数字是什么意思?

我提供了脚本的截断示例(来自 Wordpress),您可以在第 4 行中看到它。

CREATE TABLE IF NOT EXISTS `wp_usermeta` (
`umeta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`umeta_id`),
KEY `meta_key` (`meta_key`(191))
) ENGINE=InnoDB;

最佳答案

来自MySQL Documentation :

Indexes can be created that use only the leading part of columnvalues, using col_name(length) syntax to specify an index prefixlength:

  • Prefixes can be specified for CHAR, VARCHAR, BINARY, and VARBINARY columns.

  • BLOB and TEXT columns also can be indexed, but a prefix length must be given.

  • Prefix lengths are given in characters for nonbinary string types and in bytes for binary string types. That is, index entries consist of the first length characters of each column value for CHAR, VARCHAR, and TEXT columns, and the first length bytes of each column value for BINARY, VARBINARY, and BLOB columns.

关于MySQL KEY 参数创建中的编号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32358855/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com