Sunday, September 18, 2011

Avoid Full Table Scans

Full table scans are where the database will read the entire table without an index.
Some of the reasons why full table scans are performed:

1. no WHERE clause
2. no index on any field in WHERE clause
3. poor selectivity on an indexed field
4. too many records meet WHERE conditions
5. using SELECT * FROM
6. function used on the indexed column in the query

Tip - Generate Explain plans to understand how database optimizer treats the query

No comments:

Post a Comment