Limits on Number of Databases and Tables Monitoring Internal Temporary Table Creation Note 8.4.5 Limits on Number of Databases and Tables 8.4.6 Limits on Table Size storage format applies when the  TempTable  storage engine exceeds the  temptable_max_ram  limit and starts allocating space from disk as memory-mapped files or  InnoDB  on-disk internal temporary tables. When in-memory internal temporary tables are managed by the  MEMORY  storage engine, fixed-length row format is used.  VARCHAR  and  VARBINARY  column values are padded to the maximum column length, in effect storing them as  CHAR  and  BINARY  columns. Previous to MySQL 8.0.16, on-disk internal temporary tables were managed by the  InnoDB  or  MyISAM storage engine (depending on the  internal_tmp_disk_storage_engine  setting). Both engines store internal temporary tables using dynamic-width row format. Columns take only as much storage as needed, which reduces disk I/O, space requirements, and processing time compared to on-disk tables that use fixed-length rows. Beginning with MySQL 8.0.16,  internal_tmp_disk_storage_engine  is not supported, and internal temporary tables on disk are always handled by  InnoDB . When using the  MEMORY  storage engine, statements can initially create an in-memory internal temporary table and then convert it to an on-disk table if the table becomes too large. In such cases, better performance might be achieved by skipping the conversion and creating the internal temporary table on disk to begin with. The  big_tables  variable can be used to force disk storage of internal temporary tables. When an internal temporary table is created in memory or on disk, the server increments the Created_tmp_tables  value. When an internal temporary table is created on disk, the server increments the  Created_tmp_disk_tables  value. If too many internal temporary tables are created on disk, consider increasing the  tmp_table_size  and  max_heap_table_size  settings. Due to a known limitation,  Created_tmp_disk_tables  does not count on-disk temporary tables created in memory-mapped files. By default, the TempTable storage engine overflow mechanism creates internal temporary tables in memory- mapped files. This behavior is controlled by the  temptable_use_mmap  and temptable_max_mmap  variables. The  memory/temptable/physical_ram  and  memory/temptable/physical_disk  Performance Schema instruments can be used to monitor  TempTable  space allocation from memory and disk. memory/temptable/physical_ram  reports the amount of allocated RAM.  memory/temptable/ physical_disk  reports the amount of space allocated from disk when memory-mapped files are used as the TempTable overflow mechanism. If the  physical_disk  instrument reports a value other than 0 and memory-mapped files are used as the TempTable overflow mechanism, the  temptable_max_ram threshold was reached at some point. Data can be queried in Performance Schema memory summary tables such as  memory_summary_global_by_event_name . See Section 27.12.20.10, “Memory Summary Tables” . MySQL has no limit on the number of databases. The underlying file system may have a limit on the number of directories. 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. 1741