相关疑难解决方法(0)

mysql修复使用where;

我的SQL查询:

SELECT *
FROM updates_cats
WHERE uid =118697835834
ORDER BY created_date ASC
Run Code Online (Sandbox Code Playgroud)

目前指数:

index1(uid, created_date)
Run Code Online (Sandbox Code Playgroud)

EXPLAIN EXTENDED结果:

1 SIMPLE updates_cats ref index1 index1 8 const 2 100.00 Using where
Run Code Online (Sandbox Code Playgroud)

如何修复Extra字段使用哪里可以使用索引?

编辑:显示创建表:

CREATE TABLE `updates_cats` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
 `u_cat_id` bigint(20) NOT NULL DEFAULT '0',
 `uid` bigint(20) NOT NULL,
 `u_cat_name` text COLLATE utf8_unicode_ci NOT NULL,
 `total_updates` int(11) unsigned NOT NULL DEFAULT '0',
 `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
 PRIMARY KEY (`id`),
 KEY `index1` (`uid`,`created_date`)
) ENGINE=MyISAM AUTO_INCREMENT=23522 …
Run Code Online (Sandbox Code Playgroud)

mysql sql indexing query-optimization where

16
推荐指数
1
解决办法
2万
查看次数

标签 统计

indexing ×1

mysql ×1

query-optimization ×1

sql ×1

where ×1