Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Max tables in a MySQL database

Tags:

database

mysql

Is it bad to have too many tables in a database? I have about 160 tables in one database. Is it better to split it into several database rather than using a single database? Single database is more convenient for me.

like image 999
Mark Avatar asked Oct 03 '10 06:10

Mark


People also ask

What is the maximum number of tables in SQL database?

Informational Solution: The maximum number of "permanent" tables in a database is 67,108,863 - or in hex, 3ffffff.

What is maximum size of MySQL database?

MyISAM permits data and index files to grow up to 256TB by default, but this limit can be changed up to the maximum permissible size of 65,536TB (2567 − 1 bytes).

Can MySQL handle large databases?

MySQL was not designed for running complicated queries against massive data volumes which requires crunching through a lot of data on a huge scale. MySQL optimizer is quite limited, executing a single query at a time using a single thread.


2 Answers

There are no server limits on the number of tables in a MySQL database. You will definitely have no problems with 160 tables, and you don't need to split them into multiple databases.

You will not gain performance by splitting your tables into multiple databases. If performance remains an issue, you could consider using per-table tablespaces in order to place some sets of tables on different physical disks.

like image 91
Daniel Vassallo Avatar answered Sep 21 '22 06:09

Daniel Vassallo


according to MySQL reference manual:

MySQL has no limit on the number of tables. The underlying file system may have a limit on the number of files that represent tables. Individual storage engines may impose engine-specific constraints. InnoDB permits up to 4 billion tables.

like image 42
Marku Avatar answered Sep 22 '22 06:09

Marku