Query Store: ACTIVATE!

Does OPTION (RECOMPILE) Prevent Query Store from Saving an Execution Plan?

Recompile hints have been tough to love in SQL Server for a long time. Sometimes it’s very tempting to use these hints to tell the optimizer to generate a fresh execution plan for a query, but there can be downsides: This can drive up CPU usage for frequently run queries This limits the information SQL Server […]


My SQLPASS 2015 Session Evaluations

I recently gave a day long session at the SQLPASS Summit called “SQL Server Index Therapy Session“. 61 people attended, and let me tell you I was thrilled with that number. I’ve co-presented lots of day and week long sessions, but this was the first day long session that I’d ever done solo at a conference and 61 […]


The Mysterious telemetry_xevents Session in SQL Server 2016

When kicking the tires of SQL Server 2016 CTP3, I was interested to find a new session defined in the Extended Events folder. Hello, telemetry_xevents! Scripting it out, this session contains the following events: CREATE EVENT SESSION [telemetry_xevents] ON SERVER ADD EVENT sqlserver.data_masking_ddl_column_definition, ADD EVENT sqlserver.error_reported( WHERE ([severity]>=(20) OR ([error_number]=(18456) OR [error_number]=(17803) OR [error_number]=(701) OR […]


Did My Query Eliminate Table Partitions in SQL Server?

Working with table partitioning can be puzzling. Table partitioning isn’t always a slam dunk for performance: heavy testing is needed. But even getting started with the testing can be a bit tricky! Here’s a (relatively) simple example that walks you through setting up a partitioned table, running a query, and checking if it was able […]

Python the friendly snake

Resources for Learning Python

I’ve been thinking about taking up a new programming language as a hobby for a little while. There’s a vibrant software community here in Portland, and working in more languages than TSQL opens up lots more opportunities for fun. I have no intention of becoming a full-time Python programmer, I just believe it’s fun to […]

Taking the time to write about something makes you learn more

You know how sometimes you learn something, then you start to see it everywhere you look? That happens to me all the time, and I’ve even started to try to take advantage of it. There’s a name the phenomenon of encountering something once, then starting to see it everywhere: it’s the Baaader-Meinhof Phenomenon, also known as […]

How I learned to write TSQL

I primarily work with SQL Server, but my favorite book on TSQL is the one that I learned with: The Transact SQL Cookbook.  It’s been many years since I picked it up, but I have a ton of happy memories of staring into this book while riding a train to and from work, getting my […]

SQL Server’s Filtered Indexes: The “Third” Index Dimension

One perk to filtered indexes that may not be obvious at first is that you get an extra “dimension”– almost an extra kind of key column. This can be useful for some queries that can be tricky to index. Let’s we have a query with two inequalities in the predicate, like this: We can create […]