Reputation: 365
I've recently been doing some database maintenance & stumbled upon something rather odd. During a standard procedure cleaning up i found that the row count before running pt-online-schema-change was much lower than after running pt-online-schema-change. Initially i thought this was a display bug & tried reconnecting. However, the row count stayed the same.
Before running my database maintenance i removed 10.000.000 rows off of a table with 26.000.000 rows. After this i was down to 16.000.000 rows. Then i ran pt-online-schema-change to add a column. Suddenly after it was done 2 hours later it showed 18.000.000 rows. All this is during hours where there is almost no activity in this table. & further digging showed that there was only added about ~11.000 rows while pt-online-schema-change ran.
So. How can one explain this? Could it simply be that the row count from MySQL got inaccurate after a mass deletion? Because that is the only reasonable explanation i my-self can think of as pt-online-schema-change creates a new table & migrate data. Which would mean the row count on that table is fresh.
I use Sequel Pro which seems to use SHOW TABLE STATUS LIKE '...';
to read row count from.
Does anyone have any experience with row counts jumping after running pt-online-schema-change?
Upvotes: 1
Views: 18