I installed mariadb 10.2.10 with innodb_file_per_table
option enabled.
Then I create table with Innodb
engine and inserted 1 M row into.
Now I look and local (..data/mydbname/table_name.ibd
) file is grown, but grown system ibdata1
file also. Why? I expected that because of innodb_file_per_table
is enabled, only local .ibd
should grown, but not ibdata1
.
Why size of ibdata1
also grows up? What I misunderstood ?
Best Answer
A number of operations use
ibdata1
temporarily. The actual data for the given table will be entirely in the.ibd
file.It's rather normal for ibdata1 to be at least tens of MB, even with all tables in their .ibd files.
Do you have the following case?
innodb_file_per_table=OFF
table1
-- this will go intoibdata1
innodb_file_per_table=ON
table2
-- this will go intotable2.ibd
table1
-- this will still go intoibdata1
The way to move an existing table to
ibd
is to set ON, then doIf this does not explain your situation, please keep an eye on (1) what operations are being performed on any table, and (2) the size of ibdata1. If it grows again, the (1) may give us some more clues.
Note especially any operations involving large tables.