add_clean_index()
add_clean_index( string $table, string $index )
向指定表添加索引。
Adds an index to a specified table.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$table | (string) | 必需 | 数据库表名。 |
$index | (string) | 必需 | 数据库表索引列。 |
返回(Return)
(true)真,执行完毕。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
1.0.1 | wp-admin/includes/upgrade.php:2381 | 0 | 2 |
笔记(Notes)
有时在数据库中创建表之后,我们发现向该表添加索引有利于加快涉及该表的查询。
add_clean_index() 为WP2原创文章,链接:https://www.wp2.cn/functions/add_clean_index/