Running SUM across large amount of rows

Running SUM across large amount of rows

回答1

You can take a look to the column store in SQL Server. In short, you are able to create a column store index on your tables - different from the traditional row store index.

These indexes are specially design for optimizing aggregate queries when huge amount of data is involved (for example, like in Data Warehouse star and snowflake schemes).

From the docs:

Columnstore indexes can achieve up to 100x better performance on analytics and data warehousing workloads and up to 10x better data compression than traditional rowstore indexes.

because:

  • Data compression - you can many benefits from here; for example, columnstore indexes read compressed data from disk, which means fewer bytes of data need to be read into memory;
  • Column elimination - columnstore indexes skip reading in columns that are not required for the query result and further reduces I/O for query execution and therefore improves query performance (not like rowstore indexes)
  • Rowgroup elimination - optimize table scans using metadata to eliminate specific rowgroups based on your filtering criteria;
  • Batch Mode Execution - prior to SQL Server 2019, only queries involving such indexes, can benefit from batch mode processing which reduce your execution time further (check this video to see how great is the this mode)
作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(19)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2020-06-20 哈佛大学公开课 幸福课 积极心理学
2019-06-20 Ajax
2019-06-20 jQuery FileUpload doesn't trigger 'done'
2019-06-20 Sending forms through JavaScript[form提交 form data]
2019-06-20 Sending form data
2019-06-20 Your first HTML form
2019-06-20 form submission
点击右上角即可分享
微信分享提示