<small id='m4tut'></small><noframes id='m4tut'>

    <legend id='m4tut'><style id='m4tut'><dir id='m4tut'><q id='m4tut'></q></dir></style></legend>

      <tfoot id='m4tut'></tfoot>

      • <bdo id='m4tut'></bdo><ul id='m4tut'></ul>
    1. <i id='m4tut'><tr id='m4tut'><dt id='m4tut'><q id='m4tut'><span id='m4tut'><b id='m4tut'><form id='m4tut'><ins id='m4tut'></ins><ul id='m4tut'></ul><sub id='m4tut'></sub></form><legend id='m4tut'></legend><bdo id='m4tut'><pre id='m4tut'><center id='m4tut'></center></pre></bdo></b><th id='m4tut'></th></span></q></dt></tr></i><div id='m4tut'><tfoot id='m4tut'></tfoot><dl id='m4tut'><fieldset id='m4tut'></fieldset></dl></div>

      为什么索引视图不能有 MAX() 聚合?

      时间:2023-10-25
        <legend id='3n3d5'><style id='3n3d5'><dir id='3n3d5'><q id='3n3d5'></q></dir></style></legend>

        1. <small id='3n3d5'></small><noframes id='3n3d5'>

              <bdo id='3n3d5'></bdo><ul id='3n3d5'></ul>
              <tfoot id='3n3d5'></tfoot>

                  <tbody id='3n3d5'></tbody>
                <i id='3n3d5'><tr id='3n3d5'><dt id='3n3d5'><q id='3n3d5'><span id='3n3d5'><b id='3n3d5'><form id='3n3d5'><ins id='3n3d5'></ins><ul id='3n3d5'></ul><sub id='3n3d5'></sub></form><legend id='3n3d5'></legend><bdo id='3n3d5'><pre id='3n3d5'><center id='3n3d5'></center></pre></bdo></b><th id='3n3d5'></th></span></q></dt></tr></i><div id='3n3d5'><tfoot id='3n3d5'></tfoot><dl id='3n3d5'><fieldset id='3n3d5'></fieldset></dl></div>

                本文介绍了为什么索引视图不能有 MAX() 聚合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我一直在尝试一些索引视图并给我留下了深刻的印象,但我几乎总是需要一个最大值或一个最小值,并且不明白为什么它不能用于这些,谁能解释为什么?

                I have been trying out a few index views and am impressed but I nearly always need a max or a min as well and can not understand why it doesn't work with these, can anyone explain why?

                我知道他们是不允许的,我就是不明白为什么!!!允许计数等为什么不允许 MIN/MAX,我正在寻找解释...

                I KNOW they are not allowed, I just can't understand why!!! Count etc. is allowed why not MIN/MAX, I'm looking for explanation...

                推荐答案

                不允许使用这些聚合,因为它们不能仅根据更改的值重新计算.

                These aggregates are not allowed because they cannot be recomputed solely based on the changed values.

                某些聚合,例如 COUNT_BIG()SUM(),只需查看更改的数据即可重新计算.这些在索引视图中是允许的,因为如果基础值发生变化,则可以直接计算该变化的影响.

                Some aggregates, like COUNT_BIG() or SUM(), can be recomputed just by looking at the data that changed. These are allowed within an indexed view because, if an underlying value changes, the impact of that change can be directly calculated.

                其他聚合,例如 MIN()MAX(),不能仅通过查看正在更改的数据来重新计算.如果您删除当前为最大值或最小值的值,则必须在整个表中搜索并找到新的最大值或最小值.

                Other aggregates, like MIN() and MAX(), cannot be recomputed just by looking at the data that is being changed. If you delete the value that is currently the max or min, then the new max or min has to be searched for and found in the entire table.

                同样的原则适用于其他聚合,如 AVG() 或标准变体聚合.SQL 不能仅根据更改的值重新计算它们,而是需要重新扫描整个表以获取新值.

                The same principle applies to other aggregates, like AVG() or the standard variation aggregates. SQL cannot recompute them just from the values changed, but needs to re-scan the entire table to get the new value.

                这篇关于为什么索引视图不能有 MAX() 聚合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:LIKE '%...%' 通配符查询的 PL/SQL 性能调优 下一篇:mysql fix 使用 where;

                相关文章

                  <legend id='9JatC'><style id='9JatC'><dir id='9JatC'><q id='9JatC'></q></dir></style></legend>

                1. <i id='9JatC'><tr id='9JatC'><dt id='9JatC'><q id='9JatC'><span id='9JatC'><b id='9JatC'><form id='9JatC'><ins id='9JatC'></ins><ul id='9JatC'></ul><sub id='9JatC'></sub></form><legend id='9JatC'></legend><bdo id='9JatC'><pre id='9JatC'><center id='9JatC'></center></pre></bdo></b><th id='9JatC'></th></span></q></dt></tr></i><div id='9JatC'><tfoot id='9JatC'></tfoot><dl id='9JatC'><fieldset id='9JatC'></fieldset></dl></div>

                  <small id='9JatC'></small><noframes id='9JatC'>

                  <tfoot id='9JatC'></tfoot>
                    • <bdo id='9JatC'></bdo><ul id='9JatC'></ul>