pg_stat_monitor
pg_stat_monitor copied to clipboard
PG-592: Treat queries with different parent queries as separate entries
- Previously pg_stat_monitor had a
topqueryandtopqueryidfield, but it was only a sample: it showed one of the top queries executing the specific query.
With this change, the same entry executed by two different functions will result in two entries in the statistics table.
- This also fixes a bug where the content of these field disappeared for every second query executed: previously the update function changed topqueryid to
0if it was non zero, and changed it to the proper id when it was 0. This resulted in an alternating behavior, where for every second executed query the top query disappeared.
After these changes, the top query is always shown.
- The previous implementation also leaked dsa memory used to store the parent queries. This is now also fixed.
Codecov Report
Attention: Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.
Project coverage is 84.87%. Comparing base (
d7999f1) to head (bf208ea).
| Files | Patch % | Lines |
|---|---|---|
| pg_stat_monitor.c | 84.61% | 0 Missing and 2 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #403 +/- ##
==========================================
- Coverage 84.99% 84.87% -0.12%
==========================================
Files 3 3
Lines 1293 1296 +3
Branches 197 198 +1
==========================================
+ Hits 1099 1100 +1
Misses 98 98
- Partials 96 98 +2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.