The actual data that underlies database objects can be stored in a tablespace. It serves to allot storage for all DBMS-managed segments and offers a layer of abstraction between logical and physical data. When generating database segments, a tablespace can be referred to by name once it has been formed. This article gives details about tablespace and its elements.
What is a tablespace?
Each table in MySQL has a table definition, data, and indexes. InnoDB, the MySQL storage engine, stores table data and indexes in a tablespace. InnoDB creates a global shared tablespace that can hold table data and indexes in addition to a data dictionary and other pertinent metadata.
For every table and partition, InnoDB may also create a separate tablespace. The header of each of these distinct tablespaces carries a number that uniquely identifies it, and they are all stored in files with the .ibd extension.
A tablespace has segments, each of which has one or more extents for the corresponding table.
Pages make up 64 extents. Because 64 × 16 KB Equals 1 MB thus the extent is 64 pages, which is essentially a random selection for a “chunk” of storage.
Pages are 16k, which is supposedly tuned for effective disk-level storage and retrieval. When more pages are required, they are given out in extended quantities.
How to configure it in AWS RDS?
In a MySQL parameter group, Amazon RDS offers a setting named innodb_file_per_table
. By setting the parameter value to 0 or 1, this option determines whether InnoDB adds new table data and indexes to the common tablespace or to individual tablespaces.
When using Amazon RDS, the innodb_file_per_table
parameter’s default value is set to 1, allowing you to delete certain InnoDB tables and free up space for the DB instance. Setting the innodb_file_per_table
parameter to 1 is advised in the majority of usage scenarios.
Hope you find this article helpful.