Avoiding the Full-Table Scan
A full-table scan occurs when the database server reads every record in a table in order to execute a SQL statement. Full-table scans are normally an issue when dealing with queries or the SELECT statement. However, a full-table scan can also come into play when dealing with updates and deletes. A full-table scan occurs when the columns in the WHERE clause do not have an index associated with them. A full-table scan is like reading a book from cover to cover and trying to find a keyword. Most often, you will opt to use the index.
You can avoid a full-table scan by creating an index on columns that are used as conditions in the WHERE clause of a SQL statement. Indexes provide a direct path to the data the same way ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access