|
|
|
|
|
by SigmundA
1902 days ago
|
|
Yes every row of the index needs to be scanned not every row of the table which is faster than scanning the table. I am most familiar with MS SQL server and it will most certainly do an index scan for what it thinks is a highly selective predicate with "suffix wildcards" and it can return results faster than scanning the table. If the index covers the result columns it will scan the index and never touch the table otherwise it will do a key lookup to the table. |
|
Unless the index contains all the columns you're dealing with, the optimizer will determine that just scanning the table will cost less than scanning an index AND then looking up the data in the table (bookmark lookups in MSSQL).