Max tables in a MySQL database

前端 未结 5 790
没有蜡笔的小新
没有蜡笔的小新 2021-02-19 07:19

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? Sin

相关标签:
5条回答
  • 2021-02-19 07:29

    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.

    0 讨论(0)
  • 2021-02-19 07:29

    WordPress Multisite creates dozens of tables for every new subsite in the same database.
    So you can be so good at only 160 tables.
    It might be an issue to manage them with PhpMyAdmin or other software to see and scroll through the tables. But if you work with the code it should not be a problem.

    0 讨论(0)
  • 2021-02-19 07:30

    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.

    0 讨论(0)
  • 2021-02-19 07:45

    160 tables isn't radically huge.

    16,000 might be...probably would be...more unreasonable - such databases exist in ERP or CRM systems (even into the 40-50K tables range, but many of those tables are not actually used, or are only barely used).

    Even so, the typical DBMS will 'handle' such large databases, but there is more strain on the system catalog than usual in such systems.

    0 讨论(0)
  • 2021-02-19 07:49

    160 is still ok. it makes SQL command more faster than making too many contents under a single table. In my case I have 8,545,214 tables in a single Mysql database. I dont want to store millions of user in a single database that's why I used multiple table to store each post a user done. it makes mysql more faster than searching on a single table with millions of rows.

    0 讨论(0)
提交回复
热议问题