Hi and I have been working on a project involving a rather large database. My question is "For a database with over 20529860 rows, is it better to have 3330 tables spreaded equally or to split into multiple databases or would it be better to have 49950 tables in the database containing the information?" The reason I ask is that having all those rows in the one table makes it really slow with the Where clause and I'm not sure which way is the best way to design this database with mysql. I found that anything over 15MB in one table takes too long to lookup so if I had to guess I would spread it over the 49950 tables ((255-33)*15*15) but sounds like a ridiculous number of tables to store the one set of data. So does anybody have any ideas on how to store potentially 1,000,000,000 rows in mysql. Each row only contains a few bytes. Thanks.
Recommended Answers
Jump to PostI found that anything over 15MB in one table takes too long to lookup
I never faced any problem with much larger tables (in GBs).
Are you properly indexing your tables? For performance, you can split the tables on year/month basis if you have datatime field. Otherwise you can …
Jump to PostHey.
If you have a table with a VARCHAR field, you can often improve search performance on it by changing the field to the CHAR type. It has a static length, which allows MySQL to calculate a static row size for all the rows, rather then having to calculate …
Jump to PostSo is the char field type faster than text field type? Because that's what I really need to know although it's a bugga it will consume more space for faster performance.
Not really, no. The field itself isn't faster.
What makes it faster is that it will always have …
Jump to PostPlease note tho, that the performance gain from using this method is usually very minor when compared to other optimization methods, such as properly indexing the fields.
A well placed index can be the difference between counting query speeds in minutes and milliseconds. (True story!)
All 16 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.