Chapter 15 -- The Query Processor

Chapter 15

One of the most important components of the SQL Server engine is the query processor. Actually, there is no specific component called the query processor; rather, several related components work closely together to process the queries that you or your applications submit to the SQL Server engine for processing. Some of these components are involved in parsing your queries and simplifying them in various ways. Others are involved in the actual execution of your query.

Probably the most important and sophisticated of all the components involved in processing your queries is the query optimizer. The optimizer's job is to produce an execution plan for your query or for each query in a batch or stored procedure. The plan lists the steps to be carried out in order to execute your query and includes such information as which index or indexes to use when accessing data from each table in the query. The plan also includes the strategy for processing each JOIN operation, each GROUP BY operation, and each sort.

In this chapter, we'll look at the phases of query processing, paying particular attention to the query optimizer. I'll show you the different ways that indexes can be used, and I'll describe strategies for processing the joining of tables or the grouping of data. You'll also learn about the statistical information that SQL Server has available to determine the optimum execution plan, as well as the various mechanisms that SQL Server can employ to reuse an execution plan that was developed for a previous query.



Inside Microsoft SQL Server 2000
Inside Microsoft SQL Server 2000
ISBN: 0735609985
EAN: 2147483647
Year: 2005
Pages: 179
Authors: Kalen Delaney

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net