We have a table with around 7M records with type ferrari
and want to do a schema migration. We used this script
insert into new_car id, name, type, colorType
select id, name, type, 'red'
from old_car
where type = 'ferrari'
order by id asc
The script took around 50 minutes to execute and after it got complete we realised that the new_car
table have 2M less records than old_car
table.
While the script was executing the old_car
table still got inserts, updates and etc concurrently.
Does this concurrency may cause some sort of problem? What are the possible cause of the lack of ~2M rows? (the old_car
table didn't got 2M deletes while the query was running, maybe something like 100 or 200 deletes)