Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Index on small tables

Author  Topic 

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2013-01-03 : 02:54:49
Dear All,
Creating a index on a table which has less then 50 rows,will it be a benefit?

Thanks,
Javeed.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-03 : 03:49:09
It depends ...though on most occasions it might not be used as its easier to scan entire table to get values rather than traversing through index tree.
But that being said, if number of columns are large and if index is covering one or selectivity is large, optimiser might choose to use the index

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-03 : 03:59:29
talking benefitwise, the effect would negligible,if at all, for an index on such a small table

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2013-01-03 : 04:53:26
A friend had a case where a small table benefited a lot from a clustered index when it was used in a nested loop many times in the query plan - but that was an odd scenario nad was due to the internal strauctures built rather than the index itself.

The only way to tell is to try it and see.
You should probably have a unique contraint on every table.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -