gpt4 book ai didi

SQL执行计划显示 "Actual Number of Rows",大于表大小

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

我有一个相当复杂的联接的执行计划,它显示在表上执行索引查找,“实际行数”读数约为 70,000,而实际上表中总共只有约 600 行(估计行数仅为 127)。

请注意,所有统计信息都是最新的,并且查询的输入参数与编译过程时输入的参数完全相同。

为什么实际行数如此之高,“实际行数”这个数字的真正含义是什么?

我唯一的理论是,大量行与嵌套循环有关,并且此索引查找正在执行多次 - “实际行数”实际上代表所有执行的总行数。如果是这种情况,估计的行数是否也意味着所有执行的总行数?

最佳答案

ActualRows 计算物理运算符调用 GetNext() 的次数。

您还应该查看 ActualRebinds, ActualRewinds and ActualEndOfScans了解内部循环被重新评估了多少次:

A rebind means that one or more of the correlated parameters of the join changed and the inner side must be reevaluated. A rewind means that none of the correlated parameters changed and the prior inner result set may be reused.

关于SQL执行计划显示 "Actual Number of Rows",大于表大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1006385/

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