|
|
|
|
|
by branko_d
2233 days ago
|
|
> If you have an index on <companyId, userId>, and you query with a userID only, that index wont be used. Surprisingly, it could be used in some circumstances, just not for the regular seek. If the index is small (compared to the base table), the DBMS may decide to perform a full index scan (instead of the full table scan), especially if your SELECT list doesn't contain columns which are not in the index. And Oracle can employ so called "skip scan" if it realizes that the number of distinct companies is small. This is essentially a separate seek under each distinct company. |
|