Learn how MariaDB stores partitioned tables on the filesystem, typically creating separate .ibd files for each partition when using InnoDB.
A partitioned table is stored in multiple files. By default, these files are stored in the MariaDB (or InnoDB) data directory. It is possible to keep them in different paths by specifying DATA_DIRECTORY and INDEX_DIRECTORY table options. This is useful to store different partitions on different devices.
Note that, if the innodb_file_per_table server system variable is set to 0 at the time of the table creation, all partitions are stored in the system tablespace.
The following files exist for each partitioned tables:
table_name.frm
Contains the table definition. Non-partitioned tables have this file, too.
table_name.par
For example, an InnoDB table with 4 partitions will have the following files:
If we convert the table to MyISAM, we will have these files:
This page is licensed: CC BY-SA / Gnu FDL
Contains the partitions definitions.
table_name#P#partition_name.ext
Normal files created by the storage engine use this pattern for names. The extension depends on the storage engine.
orders.frm
orders.par
orders#P#p0.ibd
orders#P#p1.ibd
orders#P#p2.ibd
orders#P#p3.ibdorders.frm
orders.par
orders#P#p0.MYD
orders#P#p0.MYI
orders#P#p1.MYD
orders#P#p1.MYI
orders#P#p2.MYD
orders#P#p2.MYI
orders#P#p3.MYD
orders#P#p3.MYI