liveBook · Manning

Query executor

As explained in 100 SQL Server Mistakes and How to Avoid Them

The query executor is the SQL Server component that runs an established query execution plan.

The query executor runs an established query execution plan. It works with the storage engine to read or write the required data, while other components manage transactions, locks, and cached pages. section 1.2.1

Avoid treating plan execution as independent from surrounding SQL Server choices:

  • Poorly written T-SQL, cursors, or unmaintained statistics and indexes can hinder the optimizer before a plan reaches the executor. section 1.2.1
  • Transaction isolation affects performance, while locking preserves transactional consistency; NOLOCK can expose rows that were never committed. section 1.2.1
  • Plan cache can let later executions avoid optimization, and buffer cache supplies data pages instead of direct disk reads. section 1.2.1

A product lookup

A parameterized SELECT against dbo.Products can execute through the established plan, retrieve rows through the storage engine, and use NOLOCK—but that hint may return uncommitted data. section 1.2.1

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Explains component interactions and cache effects, but defers detailed optimizer, isolation, and locking treatment.
Examples
Uses a parameterized Products lookup with a NOLOCK hint and a diagram of query flow through the Database Engine.
What it assumes
Assumes an established query execution plan and a basic understanding of T-SQL query execution.
What you can do after
Evaluate how plans, caching, transactions, locks, and storage access affect a query’s execution.
How it connects
Connects execution plans to the optimizer, storage engine, transaction manager, lock manager, buffer manager, and plan cache.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.