|
|
|
|
|
by therealdrag0
2236 days ago
|
|
And IIRC this holds MongoDB and I'd assume other non-SQL DBs. If you have an index on <companyId, userId>, and you query with a userID only, that index wont be used. But if the index was <userId, companyId> then that index would be used. Or if you supplied both userId and companyId in your query, then either index would work. |
|