May 2019
Intermediate to advanced
484 pages
11h 23m
English
As mentioned in the Query optimization essentials section of Chapter 2, Understanding Query Processing, SQL Server does cost-based optimization. But this has an expensive startup cost and so SQL Server will try to avoid this cost for simple queries that may only have one possible query execution plan.
The Trivial Plan stage generates plans for which there are no alternatives, and which require a cost-based decision. The following examples can be executed in the AdventureWorks sample database.
The following is a SELECT … INTO or INSERT INTO statement over a single table with no conditions:
SELECT NationalIDNumber, JobTitle, MaritalStatusINTO HumanResources.Employee2FROM HumanResources.Employee;
The preceding query ...
Read now
Unlock full access