Rebuild Indexes vs Update Statistics

Parsons, Tim 20 Reputation points
2026-10-13T16:13:04.51+00:00

I have a 165TB database on SQL2022 server and is part of a DAG.

ETL (load/delete) is done every night on 35k tables and the largest table average load is 5-6 million rows.

The largest table is 6.5TB (30 tables over 1TB) and has six Non-Clustered indexes with 15%-55% fragmentation.

We are experiencing high I/O, poor query plans, high storage usage and ETL times progressively taking longer.

What would be best for performance: Updating statistics or rebuilding indexes and why?

SQL Server Database Engine
0 comments No comments

Answer accepted by question author
Erland Sommarskog 138K Reputation points MVP Volunteer Moderator
2026-10-13T17:20:39.5166667+00:00

The short answer is: It depends.

I realise that this is not the answer you want to hear, but there are rarely short simple answers to situations like this. Typically, you have to dig into one query at a time to see how it can be improved by better indexing. Since you are loading lots of data, breaking up the operations in chunks can also help, if done in the right way.

As for your question: Keep in mind that rebuilding an index updates the statistics the index as well, and with fullscan. That is, you get statistics that are based on all the data rather than just a sample. So this is a bad thing to do:

ALTER INDEX ALL ON tbl REBUILD
UPDATE STATISTICS tbl

The second statement will replace fullscan statistics with sampled statistics which are less accurate. (But in many cases, they are still perfectly satisfactory.)

Rebuilding all indexes on 35000 tables may take more time than you have to for the operation. One thing to keep in mind that fragmentation in the sense that pages do not come in order on the disk matters a lot less today with SSDs than what it did in the days of spinning disk. But another thing is how much data there is on every page. If every page is half-full, this means that you 50% of your buffer cache contains - vacuum. I don't which sort of fragmentation you are talking about, but I suspect that it is the former, because that is easier to compute for SQL Server.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.