gpt4 book ai didi

sql - count(索引列)比count(*)快吗?

转载 作者:行者123 更新时间:2023-12-02 19:16:24 24 4
gpt4 key购买 nike

Possible Duplicate:
Performance of COUNT SQL function

大家好,我有非常大的表,我需要知道每个表中的记录数,我的问题是如果我运行它是否会减少运行时间:

select count(indexed column like my PK) from tbTest

而不是

select count(*) from tbTest

最佳答案

参见Performance of COUNT SQL function

需要注意的重要一点是它们并不等同

关于sql - count(索引列)比count(*)快吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3159421/

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