Take the tour ×  I'm a bit of a newbie to SQL who has been
thrown in on the deep end with a server that gets about 2
million queries an hour.  I'm trying to optimise our database
and I noticed this in our database runtime information:
Obviously that is far from optimal. And other red flags are
showing too which are probably related to this root problem I
believe.  Now, we have a database structure that is not exactly
well indexed. We have a unsigned INT as primary key on our
tables and then just unindexed columns.  I wonder how I should
approach this. Do I need to add indexes to every column? Would
that even help? How should I approach this problem?
share|improve this question You do realized 789 as a running
total of 2m queries/h is very small? However, do not add indexes
to just anything (which would mean a performance hit on
write/update), but adding them to the specific columns on which
joins take place seems logical, as does adding them on columns /
groups of columns frequently used in where clauses.