What is better and faster?
Million records in one table or 400 records in 2500 tables? For reference - I want to store each user’s inventory in separate tables or unload everything and pull it out by user id?
What is better and faster?
Million records in one table or 400 records in 2500 tables? For reference - I want to store each user’s inventory in separate tables or unload everything and pull it out by user id?
If you are worried that your table with a million records will be overloaded - then you worry in vain! MySQL can work with millions of records.
Here are some tips if you need to work with big data:
I agree with sanmai and add one more thing. Definitely, you do not need to create such a huge number of tables: aside from irrationality, this greatly complicates the logic of the application (when creating new tables, maintaining links between tables up to date). Try using link tables that will store the relationship between the user and his subject. 1 link - 1 entry.
Each new table consumes a server resource for maintaining an open file. Even if you configure open_files_limit using the usual method, server resources will still be used for things that are not needed. In addition, the buffer pool can behave interestingly. Therefore, if you do not know that it will definitely be worse, it is better to keep homogeneous data within one server in one table.
Million records are a trifle today.
Source: https://ru.stackoverflow.com/questions/733440/
All Articles