Since data.gz exceeds the largest size github allows, I have to use git lfs to store it. so you have to install git-lfs before clone it.
- Load the schema and data.
tar -xf data.gz
psql -a {your_db_name} -f data.sql
psql -a {your_db_name} -c "analyze;"
- Get the execution plan and run-time statistics with the original pg version. You might want to run twice to avoid the io impacts.
psql -a {db_name} -f explain.analyze.sql > explain.analyze.normal.log
- Snapshot the current result with the original pg version
psql -a {dbname} -f capture.result.sql
- apply the patch you want to test.
- run explain.analyze.sql again and compare the result
- run diff.sql to compare the result with the previous snapshot. The expect is every query return 0 rows (no difference)
Note:
- The size of data.gz is about 307MB, so it may take some time to clone this repo.
- If you want to build more analysis script, you can check generate_derived_sql.py first.
I didn't spend much time on this, if you find any issue/improvements, just open an issue. Thanks