Skip to content

Query statistics for migration testing

Andreas Brandl requested to merge ab/migration-query-stats into master

What does this MR do?

This change adds another migration observer to report query statistics. This is based on the pg_stat_statements extension ("pgss"). We basically reset pgss before running a migration and then export the data from pgss to JSON.

Notice that pgss isn't enabled by default in GitLab, but it is available and installed on GitLab.com. We may want to standardize this more at some point in time. For that reason, the observer is rather robust against a missing pgss extension and doesn't do anything in case it is absent.

This change goes together with gitlab-org/database-team/gitlab-com-database-testing!7 (merged), which uses the statistics information.

Screenshots (strongly suggested)

Example: !53880 (comment 510206217)

Screenshot_from_2021-02-16_16-08-54

Edited by Andreas Brandl

Merge request reports