Pt-online-schema-change increases table size

Hello, could you please help me? I have Percona Server 5.7 and latest Percona Toolkit installed.

I want to run pt-online-schema-change to get some diskspace

As per information schema I have a lot space to reclaim. Also, checking table status, I found that many tables consuming 2 GB when on OS side it occuppies 1.5 GB (this is an example)

After pt-online-schema-change run I see that table status shows increased table size as well as from OS side

Whats wrong? What additional information should I add?

Thanks in adnvace

1 Like

Hello,

Could you please check table size using and provide output there ?

select table_schema, table_name, table_rows, round(data_length / 1024 / 1024) DATA_MB, round(index_length / 1024 / 1024) INDEX_MB, round(data_free / 1024 / 1024) FREE_MB, round(data_length / 1024 / 1024)+round(index_length / 1024 / 1024)+round(data_free / 1024 / 1024) TOTAL_MB from information_schema.tables where table_name='table';

and you will see how many space you can reclaim from table using pt-online-schema-change.

Also it’s good to know how pt-online-schema-change is working - it first clone defenition of table and after that apply change which provided in alter section, and after that will copy every row from old to new table - and after that will apply swap of tables, and after swap of tables will be applied, old table will be purged and you will reclaim this space.

Regards,
Denis Subbota.
Managed Services, Percona.

1 Like