Filtered Index

External Article

A Rolling Filtered Index in SQL Server

  • Article

I recently resolved an issue where a query pulling data from the last 30 days would time out due to the table’s size and the lack of a supporting index. Creating a supporting index is possible, but not ideal; it will be very large and may not be useful for most queries and use cases. I wonder how I could implement a filtered index that follows time and is always limited to the last n days.

2025-09-10

Blogs

Chatting with Power BI: Who Benefits from This Conversation?

By

"Dave: Open the pod bay doors, HAL.HAL: I’m sorry, Dave. I’m afraid I can’t...

A Quick Look at Redgate Data Modeler

By

Redgate acquired a data modeling tool from Vertabelo recently and I wanted to explore...

Prepping for Certification, Part 2 of ?

By

The advantage of understanding the make-up of the exam: I can tailor my efforts...

Read the latest Blogs

Forums

SQL Server 2025 Build List

By Steve Jones - SSC Editor

Comments posted to this topic are about the item SQL Server 2025 Build List

Filtered Indexes: The Developer’s Secret Weapon in SQL Server

By Chandan Shukla

Comments posted to this topic are about the item Filtered Indexes: The Developer’s Secret...

Is Data Modeling Common?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Is Data Modeling Common?

Visit the forum

Question of the Day

Getting The Database Name

I run this code to connect to SQL Server 2022 from the command line.

sqlcmd -S localhost -E
At the command line, I run these two commands:
SELECT ORIGINAL_DB_NAME()
GO
What is returned?

See possible answers