# Partitions Files

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](/docs/server/server-usage/tables/create-table.md#data-directoryindex-directory) table options. This is useful to store different partitions on different devices.

Note that, if the [innodb\_file\_per\_table](/docs/server/server-usage/storage-engines/innodb/innodb-system-variables.md) 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:

| File name                         | Notes                                                                                                               |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| table\_name.frm                   | Contains the table definition. Non-partitioned tables have this file, too.                                          |
| table\_name.par                   | 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. |

For example, an InnoDB table with 4 partitions will have the following files:

```bash
orders.frm
orders.par
orders#P#p0.ibd
orders#P#p1.ibd
orders#P#p2.ibd
orders#P#p3.ibd
```

If we convert the table to MyISAM, we will have these files:

```bash
orders.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
```

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/server-usage/partitioning-tables/partitions-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
