pg_stat_statements: Add tests for nested queries with level tracking
Michael Paquier <michael@paquier.xyz>
pg_stat_statements: Add tests for nested queries with level tracking There have never been any regression tests in PGSS for various query patterns for nested queries combined with level tracking, like: - Multi-statements. - CREATE TABLE AS - CREATE/REFRESH MATERIALIZED VIEW - DECLARE CURSOR - EXPLAIN, with a subset of the above supported. - COPY. All the tests added here track historical, sometimes confusing, existing behaviors. For example, EXPLAIN stores two PGSS entries with the same top-level query string but two different query IDs as one is calculated for the top-level EXPLAIN (this part is right) and a second one for the inner query in the EXPLAIN (this part is not right). A couple of patches are under discussion to improve the situation, and all the tests added here will prove useful to evaluate the changes discussed. Author: Anthonin Bonnefoy Reviewed-by: Michael Paquier, Jian He Discussion: https://postgr.es/m/CAO6_XqqM6S9bQ2qd=75W+yKATwoazxSNhv5sjW06fjGAtHbTUA@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_stat_statements/expected/level_tracking.out | modified | +1151 −0 |
| contrib/pg_stat_statements/sql/level_tracking.sql | modified | +246 −0 |
Discussion
- Set query_id for query contained in utility statement 37 messages · 2024-08-02 → 2024-11-18