Next: Transactions
Up: ADDITIONAL FEATURES OF SQL
Previous: Indexes
In general, we can speed up queries by changing it so that
it
- Reads fewer rows
- Avoids a sort, sorts fewer rows, or sorts on a simpler key
- Reads rows sequentially rather than non-sequentially
- Filter is the term used for conditions in the WHERE clause.
- Importance of table order in the from clause of a
select statement with filters. Tables with filters should
appear first.
- Rewrite a join through views.
- Do not sort if the sort key (or any part of it) is
not indexed.
- Provide indexes for join attributes
- Use UNION instead of OR condition
- Rebuild indexes after many updates
- Avoid correlated subqueries
- Avoid difficult regular expressions in the LIKE operation
- Use temporary tables to speed queries
Raj Sunderraman
Tue Apr 1 16:15:10 PST 1997