Consultor Eletrônico



Kbase 18020: When are indexes NOT used in an SQL statement?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   12/17/2004
Status: Unverified

GOAL:

When are indexes NOT used in an SQL statement?

GOAL:

Help when tuning an SQL statement.

FIX:

An index is an optional structure associated with tables that you can define to speed SQL statement execution on a table.

Depending of the issued SQL statement, an index will or will not be used.

In general, an index is NOT used with a compound statement (a statement that contain one or more select statements joined with set operators)

However, the constituent parts of the compound statements can use indexes

An index is NOT used with the following operators:
(1) <>
(2) IS NOT NULL
(3) NOT IN with list (use NOT EXISTS instead)
(4) LIKE with a date or number column
(5) LIKE with a comparison string that starts with a wild card