Hello @virin_t. That’s impossible. Rows are not magically created when you change character sets, or collations. Did you perhaps mean row size? or table size on disk?
Please show some evidence using COUNT(*) of the table before changing character set and after changing.
I understand, I was kind of surprised as well. I understand that there might difference of table size (as we are changing charset) and other possible reasons, but I am telling about number of rows only
below is one of the examples
before
orders_quotes_data | utf8mb3_general_ci | 211.61 | 40751651 |
after
±-------------------±-----------±-----------+
| Table | Size in GB | Total Rows |
±-------------------±-----------±-----------+
| orders_quotes_data | 292.54 | 62290700 |
±-------------------±-----------±-----------+
I remember doing pt-online schema change for the above table to alter charset
Could you please use COUNT(*)? There is no way that changing the character set added 22 million rows.
Hmm. Ok. There’s a possibility here that some rows could have been duplicated due to the triggers that pt-osc uses to keep the shadow table and original table in sync. Can you provide the full command used? Can you provide the CREATE TABLE for this table?
The correct way to check the amount of rows is to do a “select count(*)” (do note that this will trigger a full table scan and cause very high disk read activity. Execute outside business hours).
The above outputs you showed look like from “information_schema” (IS). IS will only show estimate information and might have outdated information. Rebuilding the table might have refreshed the metadata and thus showing a different result/size.
If both count(*) and pt-table-checksum shows the correct amount of rows in both primary and replica then the most likely explanation is that the metadata from the table was outdated. Else let us know