Hi there, i have a database with many thousands of rows and 50 odd columns. Its quite conceivable that my users may wish to search on ANY of those 50 columns, so to increase search speeds I was wondering what cost to my system (be it in performance or resources) would there be if i created an index on each of the 50 columns.
I assume there is a downside?
ps - I have plenty of disk/memory and cpu (some would say my box was massively overspecced, but im not telling anyone about it :x :D)
r937, Im gathering here you are not suggesting i should create Millions of indexes, as such I assume you think I have asked a silly question in the first place and that i shouldnt create an index on each column
any chance the user can search on more than one of those 50 columns at a time?
you know, like
WHERE column9 = 'foo'
AND column37 = 'bar'
if this is a possibility, then 50 indexes won’t be enough, you’ll need 50! (50 factorial, which is about 30 vigintillion, or 1,000,000 to the 10th power) to cover all possibilities
thanks for your advice. 98% of my queries (probably more) will be against a single column, but they could genuinely be against any one of those 50 columns with no one column being necessarily more popular than another. So i guess in that case creating an index for each of them can only do more good than harm …right?
I just wanted to know whether doing so would honestly cause me performance degradation in any way? this was the crux of my original question. If it only costs me more memory then I am happy, I have a server with 64GB of RAM for a database i could quite happily run with a 2GB system… (ps i realise its not ALL about memory)