Millions insert in mysql


I have about ~2mil messages in database. I'am loading for player, by his name, and it takes about ~2~-4 seconds to show. What when will by 200mil messages, and i need SELECT ? it takes 1,2 min to show ? what to do?

learn more sql here

You should have split up / used another system to save the messages in the Database. You could have one table for all names that starts on "A" and another table with "B" and so on (depending on how many players u've got).

Also, you can read about load balancing. I don't think it's a good idea keeping all information in one table, especially when you have those amounts of data in it.

Thanks for idea. What query should i do if i want to create tables, from that large messages? like there is name and message, and i want to create table sms_%s, and then write there that messages of that player.

I would really consider only storing them for a specific amount of time and perhaps deleting the rows in OnGameModeInit if they're older than this date.

MySQL can hold billions of things well if you use indexes correct.

Forum Jump:

Users browsing this thread: 1 Guest(s)