I have 2 tables:
tblValidItems - | - tblItems
validID itemID
------- ------
3 1
5 2
6 3
... 4
~ 8 K items 5
.....
~ 20 K items
My query is to select certain things in tblItems that are also in tblValidItems:
SELECT tblItems.itemID FROM tblItems
JOIN tblValidItems ON tblItems.itemID = tblValidItems.validID
I tried the query with and without an index on both tables, but the results varied vary little:
- With a indexes on both tables - 127ms
- With no index on either table - 132ms
This surprised me because I thought an index would dramatically effect the speed of this query. Why dons't it?