How to View Query Execution History Over Time in SQL Server

In SQL Server, Query Store aggregates performance statistics into time intervals, allowing you to see how query performance changes over time. This historical view helps you identify when performance degraded, spot patterns like daily or hourly spikes, and correlate performance changes with deployments or data changes.

This assumes that Query Store is enabled on the database in question. So assuming Query Store is enabled on the database, you can use the following queries to check the execution history of queries over time.

Read more

What is a Missing Index in SQL Server?

SQL Server has a concept of “missing indexes”. And no, it’s not referring to an index that used to be there but has now disappeared. Rather, the missing index concept is designed to help us improve the performance of our database.

A missing index is an index that doesn’t yet exist on your table but probably should. SQL Server actually tracks queries that would benefit from indexes and stores suggestions in a set of dynamic management views (DMVs) called the missing index DMVs.

When you run a query and the optimizer thinks that this would be way faster with an index on those columns, it logs that suggestion. Over time, these suggestions accumulate, giving you a prioritized list of indexes that could improve your database’s performance.

Read more

How to Install SQL Server on a Mac in 2026

Running a full-featured Microsoft SQL Server on a Mac used to be a headache, but as of 2026, it is smoother than ever. Thanks to improvements in Docker Desktop and macOS’s Rosetta 2 translation, you can now run the enterprise-grade engine (including the new SQL Server 2025 Preview) directly on your M1, M2, M3, or M4 Mac.

This guide will walk you through setting up a modern SQL Server environment from scratch.

Read more

What is a Slowly Changing Dimension?

In data warehousing, a slowly changing dimension (SCD) is a dimension table where the attributes change over time, but not very frequently. The term “slowly changing” refers to the fact that these changes happen occasionally (perhaps days, weeks, or months apart) rather than constantly like transactional data.

The challenge is figuring out how to handle these changes while maintaining accurate historical analysis. When a customer moves to a new state or a product gets recategorized, you need a strategy that preserves the integrity of your historical data.

Read more

What is Polyglot Persistence?

Polyglot persistence is an architectural approach where an application uses multiple different database technologies, each chosen for its specific strengths and matched to particular data storage needs. Instead of forcing all your data into one database system, you use the right database for each job. For example, a relational database for transactional data, a document store for flexible content, a cache for session data, and a graph database for relationships.

Read more

Using DATEDIFF() with LEAD() to Calculate Time Until Future Events

When you’re analyzing how events unfold over time in a SQL database, one of the biggest challenges can be efficiently comparing what’s happening now to what comes next. Each event typically appears as its own row with a timestamp, but meaningful insight often comes from understanding how those timestamps relate to one another. Fortunately SQL Server provides some useful tools for this kind of sequential analysis.

Rather than relying on bulky self-joins or multi-step logic, SQL window functions offer a streamlined way to track these transitions. For example, by pairing the LEAD() function with DATEDIFF(), you can instantly measure the gap between consecutive events and surface insights that would otherwise require far more complex queries.

Read more

How to Unforce a Query Execution Plan in SQL Server

When you’ve forced an execution plan in SQL Server’s query store and later want to allow the optimizer to choose plans freely again, you’ll need to unforce the plan. You might want to do this because you’ve fixed the underlying issue or the forced plan is no longer optimal. Whatever the reason, the solution is straightforward and easy.

Read more

What is a CRDT?

A CRDT (Conflict-Free Replicated Data Type) is a special type of data structure designed for distributed systems that guarantees multiple replicas of data will eventually converge to the same state without requiring coordination between nodes. Even when different users simultaneously modify the same data in different locations, CRDTs automatically resolve conflicts in a mathematically consistent way that ensures all replicas eventually agree.

The main insight behind CRDTs is that certain operations can be designed to be commutative, meaning the order in which you apply them doesn’t matter. If operation A followed by operation B produces the same result as operation B followed by operation A, you can apply updates in any order and still reach the same final state. This property eliminates the need for complex conflict resolution logic.

Read more