A Tidy Database is a Fast Database: Why Index Management Matters
Learn about the ways in which you might better manage indexes for a better performing and efficient database.
2024-11-11
3,367 reads
Learn about the ways in which you might better manage indexes for a better performing and efficient database.
2024-11-11
3,367 reads
In this article, I share how an SQL Server filtered index solved the problem of preventing duplicates for new rows in a table.
2024-07-03
The ability to pause and then resume index rebuilds has been added to SQL Server. This is a fantastic feature, and with the release of SQL Server 2019, we can now replicate it on the actual create index process. Learn how to use this feature in this short article.
2023-06-26
9,614 reads
2021-04-27
828 reads
In Part 1 of this article we looked at a specific use case (probably exaggerated) that gave us an idea about how CPU and IO performance might be affected by a bad page split. We continue this analysis looking at what really happens to the data on the leaf pages of a clustered index with […]
2020-07-02
4,438 reads
In this tip we look at the impact of building SQL Server indexes in ascending versus descending order and the impact.
2020-02-04
Learn about the advantages and disadvantages of using INCLUDE columns in your index.
2021-04-30 (first published: 2019-09-17)
27,680 reads
With origins from the world of “Submarine ‘Dolphin’ Qualification” questions, an “Oolie” is a difficult question to answer, or the knowledge or fact needed to answer such a question, that may or may not pertain to one's duties but tests one's knowledge of a system or process to the limit. Introduction Contrary to what many […]
2019-08-08
6,215 reads
In this tip we look at a PowerShell script you can use to collect index information for all of your SQL Server instances that you manage.
2019-06-26
Can be useful when inserting a lot of data into a table.
2019-02-26 (first published: 2019-02-14)
5,117 reads
By Rayis Imayev
(2025-Feb-12) I will jump straight to the problem statement without a "boring" introduction, which, in...
By Steve Jones
I wrote about getting the Redgate Test Data Manager set up in 10 minutes...
I wrote a stream-of-consciousness post a few months ago about what I do in...
Hi Does anybody know if it is possible to run a backup from a...
Comments posted to this topic are about the item The Rank Window
Comments posted to this topic are about the item The End of Azure Data...
I have this table and data:
CREATE TABLE [dbo].[SalesTracking] ( [SalesDate] [datetime] NULL, [SalesPersonID] [int] NULL, [CustomerID] [int] NOT NULL, [PONumber] [varchar] (80) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [paid] [bit] NULL, [total] int ) ON [PRIMARY] GO CREATE CLUSTERED INDEX [SalesTrackingCDX] ON [dbo].[SalesTracking] ([SalesDate]) ON [PRIMARY] GO INSERT dbo.SalesTracking (SalesDate, SalesPersonID, CustomerID, PONumber, paid, total) VALUES ('2024-03-15 10:45:55.067', 1, 1,'PO965' ,1, 100), ('2023-09-24 10:45:55.067', 1, 2,'PO627' ,1, 200), ('2022-07-02 10:45:55.067', 1, 3,'PO6' ,1, 300), ('2022-11-03 10:45:55.067', 1, 4,'PO283' ,1, 400), ('2022-11-26 10:45:55.067', 1, 5,'PO735' ,1, 500), ('2023-04-28 10:45:55.067', 1, 6,'PO407' ,1, 600), ('2022-09-09 10:45:55.067', 1, 7,'PO484' ,1, 700), ('2024-03-13 10:45:55.067', 1, 8,'PO344' ,1, 700), ('2024-04-24 10:45:55.067', 1, 9,'PO254' ,1, 800), ('2022-06-19 10:45:55.067', 1, 10,'PO344',1, 800) GOWhen I run this query, how many unique values are returned for the SalesRank column?
SELECT st.SalesDate , st.SalesPersonID , st.total , RANK () OVER (PARTITION BY st.SalesPersonID ORDER BY st.total desc) AS SaleRank FROM dbo.SalesTracking AS st;See possible answers