Skip to content

Erik Darling Data

SQL Server Consulting, Education, and Training

Erik Darling Data
  • Blog
  • Learn
    • Pre-Recorded Classes
    • In-Person Events
  • Scripts
    • sp_HumanEvents
    • sp_PressureDetector
    • sp_QuickieStore
  • Contact
  • Request a Call

Tag: Query Plan

Understand Your Plan: Operators That Write Data (Spools, Spools, Spools)

Posted on March 7, 2022May 16, 2022 by Erik Darling

Four Non Mods


This post isn’t about modifying data. I don’t believe in doing that; get your data right the first time and you’ll avoid a lot of issues. You’ll also never need to worry about Merge.

I kid, of …

Posted in Execution Plans, SQL Server, T-SQLTagged create index in sql server, create temp table sql, DBA, Deadlock, Erik Darling, Erik Darling Data, how to create temp table in sql, Index Tuning, Indexing, Parallelism, Performance, performance tuning, Query, Query Plan, Query Tuning, sp_executesql, SQL, sql indexes, SQL Server, SQL Server Consultant, SQL Server Index, SQL Server Training, sql temp table, temporary table sql1 Comment on Understand Your Plan: Operators That Write Data (Spools, Spools, Spools)

Understand Your Plan: Processing Data With A Join Operator

Posted on March 4, 2022May 16, 2022 by Erik Darling

Your Girlfriend


Anyone who tells you there are only three types of joins in SQL Server isn’t your friend.

Okay, maybe that’s harsh. Maybe they’re just getting you prepared for the bonne promenade through all the many different faces a …

Posted in Execution Plans, SQL Server, T-SQLTagged create index in sql server, create temp table sql, DBA, Deadlock, Erik Darling, Erik Darling Data, how to create temp table in sql, Index Tuning, Indexing, Parallelism, Performance, performance tuning, Query, Query Plan, Query Tuning, sp_executesql, SQL, sql indexes, SQL Server, SQL Server Consultant, SQL Server Index, SQL Server Training, sql temp table, temporary table sql2 Comments on Understand Your Plan: Processing Data With A Join Operator

Understand Your Plan: Processing Data With An Aggregate Operator

Posted on March 3, 2022May 16, 2022 by Erik Darling

Smack Dab


Aggregates can be useful for all sorts of things in a query plan, and can show up in many different forms.

It would be tough to cover all of them in a single post, but what I’d like …

Posted in Execution Plans, SQL Server, T-SQLTagged create index in sql server, create temp table sql, DBA, Deadlock, Erik Darling, Erik Darling Data, how to create temp table in sql, Index Tuning, Indexing, Parallelism, Performance, performance tuning, Query, Query Plan, Query Tuning, sp_executesql, SQL, sql indexes, SQL Server, SQL Server Consultant, SQL Server Index, SQL Server Training, sql temp table, temporary table sql1 Comment on Understand Your Plan: Processing Data With An Aggregate Operator

Understand Your Plan: Getting Data With A Scan Operator

Posted on March 2, 2022May 16, 2022 by Erik Darling

They Live


I’m not sure why scans got such a bad rap. Perhaps it’s a leftover from the Bad Old Days© when people worried about logical fragmentation and page splits.

What I mean to say is: scans are often treated …

Posted in Execution Plans, SQL Server, T-SQLTagged create index in sql server, create temp table sql, DBA, Deadlock, Erik Darling, Erik Darling Data, how to create temp table in sql, Index Tuning, Indexing, Parallelism, Performance, performance tuning, Query, Query Plan, Query Tuning, sp_executesql, SQL, sql indexes, SQL Server, SQL Server Consultant, SQL Server Index, SQL Server Training, sql temp table, temporary table sql1 Comment on Understand Your Plan: Getting Data With A Scan Operator

Understand Your Plan: Getting Data With A Seek Operator

Posted on March 1, 2022May 16, 2022 by Erik Darling

Rumble, Young Man, Rumble


People. People complain. People complain about SQL Server. That’s probably why I get paid to deal with it, but whatever.

One complaint I get to hear week in and week out is that SQL Server isn’t …

Posted in Execution Plans, SQL Server, T-SQLTagged create index in sql server, create temp table sql, DBA, Deadlock, Erik Darling, Erik Darling Data, how to create temp table in sql, Index Tuning, Indexing, Parallelism, Performance, performance tuning, Query, Query Plan, Query Tuning, sp_executesql, SQL, sql indexes, SQL Server, SQL Server Consultant, SQL Server Index, SQL Server Training, sql temp table, temporary table sql3 Comments on Understand Your Plan: Getting Data With A Seek Operator

Understand Your Plan: Reading Operator Times In SQL Server Execution Plans

Posted on February 28, 2022May 16, 2022 by Erik Darling

Wiseacre


When I was sitting down to figure out what to write about this, one of the topics that I thought would be interesting was the width of lines/arrows in query plans.

I sat here for half a day pecking …

Posted in Execution Plans, SQL Server, T-SQLTagged create index in sql server, create temp table sql, DBA, Deadlock, Erik Darling, Erik Darling Data, how to create temp table in sql, Index Tuning, Indexing, Parallelism, Performance, performance tuning, Query, Query Plan, Query Tuning, sp_executesql, SQL, sql indexes, SQL Server, SQL Server Consultant, SQL Server Index, SQL Server Training, sql temp table, temporary table sql4 Comments on Understand Your Plan: Reading Operator Times In SQL Server Execution Plans

No, Really: Don’t Optimize For Ad Hoc Workloads As A Best Practice

Posted on February 25, 2022May 16, 2022 by Erik Darling

Better Late


A few weeks back, my friend Randolph (B|T) and I collaborated a bit on a blog post about Optimize For Ad Hoc Workloads.

Now that I’m a Microsoft Approved Blogger™️ and you all …

Posted in SQL ServerTagged create index in sql server, create temp table sql, DBA, Deadlock, Erik Darling, Erik Darling Data, how to create temp table in sql, Index Tuning, Indexing, Parallelism, Performance, performance tuning, Query, Query Plan, Query Tuning, sp_executesql, SQL, sql indexes, SQL Server, SQL Server Consultant, SQL Server Index, SQL Server Training, sql temp table, temporary table sql3 Comments on No, Really: Don’t Optimize For Ad Hoc Workloads As A Best Practice

Getting The Top Value Per Group With Multiple Conditions In SQL Server: Row Number vs. Cross Apply With MAX

Posted on February 24, 2022May 16, 2022 by Erik Darling

Throat Music


In yesterday’s post, we compared a simple situation trying to find the post scoring post for each user.

In today’s post, we’re going to add another condition: we want the highest scoring post for each type of post …

Posted in Batch Mode, Execution Plans, Indexing, Query Tuning, SQL Server, T-SQLTagged create index in sql server, create temp table sql, DBA, Deadlock, Erik Darling, Erik Darling Data, how to create temp table in sql, Index Tuning, Indexing, Parallelism, Performance, performance tuning, Query, Query Plan, Query Tuning, sp_executesql, SQL, sql indexes, SQL Server, SQL Server Consultant, SQL Server Index, SQL Server Training, sql temp table, temporary table sqlLeave a Comment on Getting The Top Value Per Group With Multiple Conditions In SQL Server: Row Number vs. Cross Apply With MAX

Getting The Top Value Per Group In SQL Server: Row Number vs. Cross Apply Performance

Posted on February 23, 2022May 16, 2022 by Erik Darling

Introductions


There are many ways to express queries in SQL. How different rewrites perform will largely be a function of:

  • You not doing anything ridiculous
  • Queries having good indexes in place
  • The optimizer not seeing through your tricks and giving
…
Posted in Batch Mode, Execution Plans, Indexing, Query Tuning, SQL Server, T-SQLTagged create index in sql server, create temp table sql, DBA, Deadlock, Erik Darling, Erik Darling Data, how to create temp table in sql, Index Tuning, Indexing, Parallelism, Performance, performance tuning, Query, Query Plan, Query Tuning, sp_executesql, SQL, sql indexes, SQL Server, SQL Server Consultant, SQL Server Index, SQL Server Training, sql temp table, temporary table sqlLeave a Comment on Getting The Top Value Per Group In SQL Server: Row Number vs. Cross Apply Performance

MAXDOP: The T-Shirt

Posted on February 22, 2022May 16, 2022 by Erik Darling

Buttery Biscuits


In yesterday’s post, I showed you the promo video and abstract for my SQLBits precon.

In today’s post, I’m gonna offer you a little bribery to show up.

First, all attendees will get one of these lovely T-Shirts. …

Posted in MAXDOP, SQL ServerTagged create index in sql server, create temp table sql, DBA, Deadlock, Erik Darling, Erik Darling Data, how to create temp table in sql, Index Tuning, Indexing, Parallelism, Performance, performance tuning, Query, Query Plan, Query Tuning, sp_executesql, SQL, sql indexes, SQL Server, SQL Server Consultant, SQL Server Index, SQL Server Training, sql temp table, temporary table sql4 Comments on MAXDOP: The T-Shirt

Posts navigation

Older posts
Newer posts

Recent Posts

  • A Week In Other Databases: Jepsen.io
  • The Building Blocks for Self-Driving PostgreSQL
  • Indexed Views In SQL Server: No Filtered Indexes Or Filtered Statistics

Subscribe

Categories

  • Accelerated Database Recovery
  • Angry Aggregates
  • Batch Mode
  • Bugs
  • Cardinality
  • Change Data Capture
  • Change Tracking
  • CHECKDB
  • Cider
  • columnstore
  • Common Query Plan Patterns
  • Common Table Expression
  • Computed Columns
  • Consulting
  • Cost Threshold For Parallelism
  • Cursors
  • Deadlock
  • Dynamic SQL
  • Error Handling
  • Execution Plans
  • Extended Events
  • Filtered Indexes
  • Filtered Statistics
  • Forced Parameterization
  • FROID
  • Functions
  • Hardware
  • IF Branching
  • Implicit Transactions
  • Indexed Views
  • Indexing
  • Interviewing
  • Isolation Levels
  • Joe Obbish
  • Local Variables
  • Locking
  • Managed Instance
  • MAXDOP
  • Memory Grants
  • Office Hours
  • OPTIMIZE_FOR_SEQUENTIAL_KEY
  • OtherDB
  • Parallelism
  • Parameter Sniffing
  • Parameterization
  • Partitioning
  • perfview
  • Plan Cache
  • Plan Cache Liars
  • Plan Guides
  • Postgres
  • Query Store
  • Query Tuning
  • Row Goal
  • SARGability
  • Server Tuning
  • Software Vendor Mistakes
  • sp_HumanEvents
  • sp_PressureDetector
  • sp_QuickieStore
  • sp_WhoIsActive
  • Spills
  • Spools
  • SQL Saturday
  • SQL Server
  • SQL Server 2019
  • SQLBits
  • SSMS
  • Stack Column Store
  • Starting SQL
  • Statistics
  • Streaming
  • T-SQL
  • Table Variables
  • Tasting Menu
  • tempdb
  • Temporary Tables
  • TOP
  • Trace Flag
  • Training
  • Triggers
  • Variables
  • vNext
  • Wait Stats
Copyright © 2019-2023 Erik Darling Data