The Where Clause


The previous chapter explored the index structure and discussed the cause of poor index performance. In the next step, we learn how to spot these causes in SQL statements. First, looking at the where clause.

The where clause defines the search condition of an SQL statement, and thus falls into the core domain of an index: finding data quickly. Although the where clause has a huge impact on performance, it is often phrased carelessly so that the database has to scan a large part of the index. That means, a badly written where clause adds the first ingredient to a slow query.

This chapter explains how different operators affect index usage and how to make sure that an index is usable for many queries. The last section presents common anti-patterns and alternatives that deliver better performance.

Recent Questions at Ask.Use-The-Index-Luke.com

0
votes
1
answer
229
views

query regd the CBO decision

Apr 17 at 10:27 Hulda(suspended)
index-choice optimizer
0
votes
3
answers
2.0k
views

Examples for Function Based Indexes?

Mar 25 at 15:52 Castorp 1
function-based
0
votes
1
answer
610
views

Updating multiple rows using a subquery in SQL

Jan 08 at 09:52 Jan 26
subquery update sql