"Full table scans are not always bad. Indexes are not always good."
An index-based access method is less efficient at reading rows than a full scan when you measure it in terms of rows available per unit of work (usually for each logical read). However, many tools interpret a full table scan as a sign of inefficiency.
Letβs take an example when you read several hundred invoices in the invoice table and view the payment method in a small search table. Using an index to check the lookup table for each invoice probably means three or four logical io for the invoice. However, a full scan of the lookup table in preparation for a hash join from the invoice data will probably require only a few logical readings, and the hash join itself will be completely absent in memory with almost no cost.
However, many tools will look at this and see a βfull table scanβ and ask them to use the index. If you do, you can simply cancel your code.
By the way, the dependence on indexes, as in the above example, leads to the fact that the "Hit ratio of the buffer cache" increases. This is why BCHR is basically nonsense as a predictor of system performance.
David Aldridge Dec 19 '08 at 17:34 2008-12-19 17:34
source share