Basic HTML version of Foils prepared 7 October 97

Foil 31 How to Choose Columns to be Indexed

From Untitled presentation ARL Database Tutorial -- February 98. by Gang Cheng, C.W. Ou, Geoffrey C. Fox


Consider indexing columns that are used frequently in WHERE clauses
Consider indexing columns that are used frequently to join tables in SQL statements
Only index columns when only a few rows have the same value in the columns indexed
Do not index columns with few distinct values
Do not index columns that are frequently modified
Do not index columns that only appear in WHERE clauses with functions or operator
Consider indexing foreign keys (see later) of referential integrity constraints in cases in which a large number of concurrent INSERT, UPDATE, and DELETE statement access the parent and child tables
When choosing whether to index a column, consider whether the performance gain for queries is worth the performance loss for INSERT, UPDATE, and DELETE statements and use of the space required to store the index



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Jan 27 1998