Optimizing a Terabyte-Scale Azure SQL Database by info.odysseyx@gmail.com September 7, 2024 written by info.odysseyx@gmail.com September 7, 2024 0 comment 6 views 6 Question Description:A customer designed a database schema for a terabyte-scale Azure SQL database, but the original design did not include a unique key. As data volumes grow, performance issues become more severe. To address these performance issues, Azure SQL uses hidden indexes that use unique identifiers, which have a maximum limit of 2,147,483,648. If the number of data rows in the table exceeds 2.1 billion, performing an insert or update operation will result in the following error: Message 666, Level 16, State 2, Line 25 These errors can lead to partial or complete database outage, which can have a serious impact on business operations. Mitigation strategies: 1. Quick solution: Specify ONLINE=ON and RESUMABLE=ON to make the index creation online and resumable. This allows the operation to use smaller transactions, so that if it fails for any reason, it can be resumed from the point of failure. 2. Permanent fixes: Rebuild the clustered index with a unique key by adding a new column. Here are the steps: References Unique identifier How to design a clustered index Create a clustered index Source link Share 0 FacebookTwitterPinterestEmail info.odysseyx@gmail.com previous post Exciting Java Web Developer Job Opportunities in Noida – Freshersworld Client Hiring Now next post Join Resolin Technology in Jorhat: Exciting HR and Operations Manager Positions Now Open You may also like Get to know Microsoft 365 Copilot in Microsoft OneDrive October 4, 2024 Connecting to Azure Cache for Redis with Entra ID in Azure Government October 4, 2024 Modern Charts in Microsoft Access is GA! October 4, 2024 Cowrie honeypot and its Integration with Microsoft Sentinel. October 4, 2024 Improved Accessibility ribbon in PowerPoint for Windows and Mac October 4, 2024 Introducing the Use Cases Mapper workbook October 4, 2024 Leave a Comment Cancel Reply Save my name, email, and website in this browser for the next time I comment.