Very large tables in SQL Server

后端 未结 10 771
醉梦人生
醉梦人生 2020-12-30 10:50

We have a very large table (> 77M records and growing) runing on SQL Server 2005 64bit Standard edition and we are seeing some performance issues. There are up to a hundred

10条回答
  •  半阙折子戏
    2020-12-30 11:26

    [there is a clustered index with 6 fields, and two other indexes on single fields.]

    Without knowing any details about the fields, I would try to find a way to make the clustered index smaller.

    With SQL Server, all the clustered-key fields will also be included in all the non-clustered indices (as a way to do the final lookup from non-clustered index to actual data page).

    If you have six fields at 8 bytes each = 48 bytes, multiply that by two more indices times 77 million rows - and you're looking at a lot of wasted space which translates into a lot of I/O operations (and thus degrades performance).

    For the clustered index, it's absolutely CRUCIAL for it to be unique, stable, and as small as possible (preferably a single INT or such).

    Marc

提交回复
热议问题