Why can't indexed views have a MAX() aggregate?

后端 未结 4 643
轮回少年
轮回少年 2020-12-10 00:14

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

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-10 01:13

    Besides the reasons specified by Remus, there is less practical need to support MIN and MAX. Unlike COUNT() or SUM(), MAX and MIN are fast to calculate - you are all set after just one lookup; you don't need to read a lot of data.

提交回复
热议问题