postgres/contrib/pg_stat_statements/expected
Michael Paquier bee23ea4dd Show sizes of FETCH queries as constants in pg_stat_statements
Prior to this patch, every FETCH call would generate a unique queryId
with a different size specified.  Depending on the workloads, this could
lead to a significant bloat in pg_stat_statements, as repeatedly calling
a specific cursor would result in a new queryId each time.  For example,
FETCH 1 c1; and FETCH 2 c1; would produce different queryIds.

This patch improves the situation by normalizing the fetch size, so as
semantically similar statements generate the same queryId.  As a result,
statements like the below, which differ syntactically but have the same
effect, will now share a single queryId:
FETCH FROM c1
FETCH NEXT c1
FETCH 1 c1

In order to do a normalization based on the keyword used in FETCH,
FetchStmt is tweaked with a new FetchDirectionKeywords.  This matters
for "howMany", which could be set to a negative value depending on the
direction, and we want to normalize the queries with enough information
about the direction keywords provided, including RELATIVE, ABSOLUTE or
all the ALL variants.

Author: Sami Imseih <samimseih@gmail.com>
Discussion: https://postgr.es/m/CAA5RZ0tA6LbHCg2qSS+KuM850BZC_+ZgHV7Ug6BXw22TNyF+MA@mail.gmail.com
2025-07-02 08:39:25 +09:00
..
cleanup.out Refactor tests of pg_stat_statements for planning, utility and level tracking 2023-02-20 09:28:29 +09:00
cursors.out Show sizes of FETCH queries as constants in pg_stat_statements 2025-07-02 08:39:25 +09:00
dml.out Remove the query_id_squash_values GUC 2025-03-27 13:33:37 +01:00
entry_timestamp.out Track statement entry timestamp in contrib/pg_stat_statements 2023-11-27 02:52:17 +02:00
extended.out Make query jumbling also squash PARAM_EXTERN params 2025-06-24 19:36:32 +02:00
level_tracking.out Show sizes of FETCH queries as constants in pg_stat_statements 2025-07-02 08:39:25 +09:00
oldextversions.out pg_stat_statements: Add wal_buffers_full 2025-02-17 13:55:17 +09:00
parallel.out pg_stat_statements: Add columns to track parallel worker activity 2024-10-09 08:30:45 +09:00
planning.out Revert support for improved tracking of nested queries 2025-06-12 10:08:55 +09:00
privileges.out pg_stat_statements: Add regression test for privilege handling. 2024-07-24 20:54:51 +09:00
select.out Fix squashing algorithm for query texts 2025-06-12 14:21:21 +02:00
squashing.out Make query jumbling also squash PARAM_EXTERN params 2025-06-24 19:36:32 +02:00
user_activity.out Add NOT NULL checking of pg_stat_statements_reset() in tests 2023-11-27 02:52:17 +02:00
utility.out Show sizes of FETCH queries as constants in pg_stat_statements 2025-07-02 08:39:25 +09:00
wal.out Show values of SET statements as constants in pg_stat_statements 2024-09-30 14:02:00 +09:00