It is said, from data loading perspective its better to have small number of indexes with multiple columns than multiple indexes with small number of columns in each?
Kindly tell me the reason for this.
It is said, from data loading perspective its better to have small number of
Share
The reason is that each index requires a separate data structure to be maintained by the db engine. So f you have many small indexes you have many such structures. If you have one with many columns you have one structure.
But actually there is better reasons to use one large index as opposed to many small:
1) Less synchronization work to be done! Only one index
2) You can have a clustered index (of course not too big) which is == to speed. Usually you can’t define multiple cluster indexes.
So in other words: It’s less stressful on the db engine since it can juggle with less data structures. More over maybe you are doing something wrong if you have so many indexes – design issue here. Not that it’s necessary to have a design issue but 95% of the cases I’ve seen many index = design error. So you use less indexes (best one only clustered) with more columns:) Insert/update may be slower but this you have to decide for your particular case: what is done more frequently ore select or persist of the data? If select follow my suggestion if not many small indexes may make more sense (or not 🙂