Statistics for database migrations
We may want to report back statistics about database migrations as they executed on the (thin cloned) production database.
An idea here is to use pg_stat_statements and reset it for each migration:
- Reset pg_stat_statements
- Execute migration
- Snapshot pg_stat_statements
The benefit is that query details are already normalized (with parameters stripped out). From the stats, we can see which queries were executed, their frequency and various stats on their runtime.