gpt4 book ai didi

MySQL - 'Using index condition' 与 'Using where; Using index'

转载 作者:可可西里 更新时间:2023-11-01 06:30:38 27 4
gpt4 key购买 nike

我想知道 Using index conditionUsing where 之间的区别;使用索引。我认为这两种方法都使用索引来获取第一个结果记录集,并使用 WHERE 条件进行过滤。

Q1。有什么区别?

Q2。哪个更好?

谢谢。

最佳答案

Using index condition : where condition contains indexed and non-indexed column and the optimizer will first resolve the indexed column and will look out the rows in the table for the other condition (index push down)

在哪里使用;使用索引 :“使用索引”意味着不扫描整个表。 'Using where' 仍然可以对非索引列进行表扫描,但如果 where 条件中有任何索引列,它将首先使用,更像是使用索引条件

哪个更好?'在哪里使用;如果查询具有索引全部覆盖,则使用索引'会比'使用索引条件'更好。

关于MySQL - 'Using index condition' 与 'Using where; Using index',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28759576/

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