gpt4 book ai didi

MySQL 用索引解释过滤列跳跃 4,100

转载 作者:可可西里 更新时间:2023-11-01 06:43:21 25 4
gpt4 key购买 nike

我的查询:

EXPLAIN EXTENDED SELECT  `artwork`.`id` ,  `artwork`.`added` 
FROM `artwork`
ORDER BY `artwork`.`added` DESC
LIMIT 0 , 6

当我在“added”上添加索引以避免使用 filesort 并使用 index 而不是 explained 的输出时

id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE artwork ALL NULL NULL NULL NULL 302 100.00 Using filesort

id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE artwork index NULL added 4 NULL 6 5033.33

我担心 filtered 会上升大约 4,100 - 我无法在 Google 上找到 filtered 是什么意思

最佳答案

嘿,这实际上是个好消息。它显示您的限制从结果集中删除了多少行。在这种情况下,这将是您的 LIMIT 语句。 See the manual :

The filtered column indicates an estimated percentage of table rows that will be filtered by the table condition. That is, rows shows the estimated number of rows examined and rows × filtered / 100 shows the number of rows that will be joined with previous tables. This column is displayed if you use EXPLAIN EXTENDED.

关于MySQL 用索引解释过滤列跳跃 4,100,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4140107/

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