
Answer-first summary for fast verification
Answer: ALTER INDEX ALL on table1 REBUILD
## Detailed Explanation To maximize columnstore compression for table1 in Azure Synapse Analytics dedicated SQL pool after loading 5 TB of data, the correct approach is to use `ALTER INDEX ALL on table1 REBUILD`. ### Why Option D is Correct: - **REBUILD operation completely recreates the columnstore index**, forcing all data to be compressed into the columnstore format - After large data loads (like 5 TB), some data may remain in the delta store (rowstore) rather than being compressed into the columnstore segments - REBUILD ensures maximum compression by processing all data through the columnstore compression engine - This is particularly important in Azure Synapse Analytics dedicated SQL pools where large data loads can result in suboptimal compression ### Why Other Options Are Not Suitable: **Option A (DBCC INDEXDEFRAG)**: This command is for defragmenting indexes and is not applicable to columnstore indexes in Azure Synapse Analytics. It doesn't address compression optimization. **Option B (DBCC DBREINDEX)**: While this does rebuild indexes, it's a legacy command that has been replaced by ALTER INDEX REBUILD. More importantly, DBCC commands may not be fully supported or may behave differently in Azure Synapse Analytics compared to traditional SQL Server. **Option C (ALTER INDEX ALL on table1 REORGANIZE)**: REORGANIZE performs lightweight maintenance by: - Compacting small rowgroups - Cleaning up deleted rows - Moving data from delta store to columnstore However, REORGANIZE does **not** provide the same level of compression optimization as REBUILD. It's suitable for routine maintenance but not for maximizing compression after large data loads. ### Best Practice Consideration: For Azure Synapse Analytics dedicated SQL pools, Microsoft documentation specifically recommends using ALTER INDEX REBUILD to optimize columnstore compression after large data loads. The REBUILD operation ensures that all data is properly compressed into the columnstore format, which is essential for achieving optimal query performance and storage efficiency with 5 TB of data.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You have an Azure Synapse Analytics dedicated SQL pool named Pool1 that contains a table named table1. After loading 5 TB of data into table1, you need to maximize columnstore compression for the table.
Which Transact-SQL statement should you execute?
A
DBCC INDEXDEFRAG (pool1, table1)
B
DBCC DBREINDEX (table1)
C
ALTER INDEX ALL on table1 REORGANIZE
D
ALTER INDEX ALL on table1 REBUILD
No comments yet.