gpt4 book ai didi

mysql - 力指数缺点

转载 作者:行者123 更新时间:2023-11-28 23:10:17 25 4
gpt4 key购买 nike

我正在使用 FORCE INDEX。最终我可以使用所需的列作为 KEY..

但我只是想知道FORCE INDEX有什么缺点

最佳答案

你可以阅读这个article :

Does this mean that we should always use a Force Index hint?

NO! Using FORCE INDEX() indiscriminately can also easily backfire. The distribution of the data or the values of query parameters can change, and the key that you thought was best for the query can, over time, become a less preferred plan. FORCE KEY should be used when you understand exactly why you are using it, and are 100% sure that there is no way the key that is being forced could become bad.

Note, that most often the need for FORCE KEY arises when the query is not very straightforward and there is no “awesome” winner key that the optimizer can easily spot. Such needs can often be addressed by re-writing the query and/or adding better keys.

关于mysql - 力指数缺点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46178480/

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