Lets say I have a table that will never have more than 10 records. Does putting an index on it have any tangible benifit? Would it have negative results?
What about 20 records? 50? 500? At what point does a table actually see tangible benefits of an index, assuming modern, beefy, dedicated server hardware for the database.
Like anything and everything SQL, IT DEPENDS.
For a 10 record table you probably will never see the index used. The optimizer will see the difference between a table scan and an index scan as being nil.
For larger tables, it’s going to depend. There is no “cut off point” where it becomes beneficial for every table. It will depend on row width, selectivity of the field you index, width of the index, if it’s clustered or non-clustered, etc.
I would say if you start having performance issues, see if an index makes a difference. If a table is over 1000 rows I normally index it if I will be joining on it, since the space used and time to create/maintain the index is trivial (assuming you aren’t deleting/inserting a lot in a table that small).