VII.3.3. Designing High-Velocity Queries

The previous sections of this chapter give you some recommendations on how to create a positive environment for high-performance databases, as well as some guidelines for implementing a responsive indexing infrastructure. This section looks at how you can speed up your interactions with your data and how to construct the most efficient queries possible. We also give you some tips on how to streamline your data-modifying interactions.

Figure VII.3-5. A collection of statistics, along with details.

VII.3.3.1. Understand query execution plans

The previous chapter is devoted to helping you come to grips with the SQL Server Query Optimizer and how to take advantage of its power. One suggestion we make is for you to learn how to interpret execution plans because SQL Server uses these reports to tell you exactly how it plans to process your query. Armed with this information, you can take steps to remedy any queries that don't quite measure up. For example, Figure 3-6 shows an execution plan for a moderately complex query.

In addition to providing all these helpful details about the upcoming execution plan, SQL Server also notifies you of any potential trouble spots.

VII.3.3.2. Avoid leading wildcards

As a database designer or application developer, you always strive to take advantage of indexes for queries against large tables. Otherwise, ...

Get Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies® 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.