Query Store Usage Scenarios

What is Query Store? Query Store is a tool to troubleshoot query performance by capturing a range of information about query usage, CPU, memory consumption, I/O and execution time, and retaining every Execution Plan for analysis. So, if query store stores my query information, what kind of scenarios I could use this information? To fix … Continue reading Query Store Usage Scenarios

Script to get the tables size in SQL Server

A simple script to know how much space the tables are taking from the disk. SELECT t.name AS TableName , s.name AS SchemaName , p.rows AS RowCounts , CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalMB , CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedMB , CAST(ROUND(((SUM(a.total_pages) - SUM(a.used_pages)) … Continue reading Script to get the tables size in SQL Server

Don’t shrink the trees

The most common and widely used index that we know are nonclustered index. These indexes are created using the famous b-tree (balanced tree). B-tree is a data-structured tree where we have the root and leaves. A nonclustered index contains the index key values and row locators that point to the storage location of the table … Continue reading Don’t shrink the trees