开发者

What column to index on and making table search fast

I have a table that holds stats for a game, this table will have hundreds of thousands of lines in but i need to it be searchable for the stats pages of the game.

I am not sure what I need to do regarding indexing and how to keep the table searchable in a realistic time. I normally index the Id fie开发者_如何学运维ld which is a primary key. I don't really understand indexing so am not sure if I am doing the correct thing.

Can anyone lend some advice please? I am using a MySQL database.

Thanks.


Rule of thumb - index columns that you are using in the WHERE clause and those being used in the ORDER BY.

You should always, however, test the effects of the change - sometimes adding indexes can cause performance problems.

I suggest reading one of the many tutorials on optimizing mysql and following the advice with your table.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜