If you are thinking of having millions of tables, I cannot imagine that you are actually creating millions of logically distinct tables. Rather, I would strongly suspect that you are creating tables dynamically based on data. That is, instead of creating a FIELD for, say, a user ID and storing one or more records for each user, you plan to create a new TABLE for each user ID. And then you will have thousands and thousands of tables in which everyone has the same fields. If this is what you are doing: don't. Stop.
The table should represent the logical TYPE of the object for which you want to store data. You can make a city table, and then have one entry for each city. One of the fields in the city table may indicate in which country the city is located. DO NOT create a separate table for each country in which all cities for each country are located. France and Germany are examples of βcountriesβ and must go at the same table. These are not different things, a thing of France and a German thing.
Here's the key question: what data do I want to store in each record? If you have 1000 tables, all have the same columns, then almost certainly it should be a single table with a field that has 1000 possible values. If you are really serious about different information about France than about Germany, like in France, you need a list of provinces with a capital and population, but for Germany you need a list of companies with industry and a chairman of the board of directors, then everything is in order, it should be two different tables. But at this moment, the difference is most likely not in France, but in Germany, but something else.
source share