Say I have roughly 200 million records and have an indexed column
user_id on a
product table. If I select back 1 million records by doing the following query :
select * from product where user_id = 1(Assuming my
Would the other 199 million rows' column data affect the efficiency of my query ?
- Consider 199 million rows were completely populated (containing blobs / varchars)
- Consider 199 million rows were only partially populated, and carried a lot of null values
I've always understood this as the query would perform the same in either scenario - since
user_id is indexed and could bypass traversing through all the data - but I'd like to get confirmation on this.
If there's another question / resource that answers this - feel free to redirect me elsewhere. Just looking for some confirmation (and an explanation if my assumption incorrect).