Parsing

In order for a Transact-SQL query to be optimized by the SQL Server query optimizer, it must first be parsed into a tree of relational operators. These are the logical operators necessary to carry out the work the query has requested. For example, a simple query that joins the Northwind Customers and Orders tables might be parsed into a relational operator tree that includes an Inner Join logical operator between the two inputs.

SQL Server attempts to avoid redundantly parsing and optimizing queries by hashing the text of each newly submitted query and caching it in memory, along with the original query text and a link to the execution context and the execution plan that the original query resulted in. It checks the hashed query text ...

Get Guru's Guide to SQL Server Architecture and Internals, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.