mirror of
https://github.com/postgres/postgres.git
synced 2026-02-15 08:37:56 -05:00
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 |
||
|---|---|---|
| .. | ||
| ci | ||
| editors | ||
| ifaddrs | ||
| perlcheck | ||
| pg_bsd_indent | ||
| pginclude | ||
| pgindent | ||
| add_commit_links.pl | ||
| ccsym | ||
| check_bison_recursion.pl | ||
| codelines | ||
| copyright.pl | ||
| darwin_sysroot | ||
| find_badmacros | ||
| find_meson | ||
| find_static | ||
| find_typedef | ||
| gen_export.pl | ||
| gen_keywordlist.pl | ||
| generate_editorconfig.py | ||
| git-external-diff | ||
| git_changelog | ||
| install_files | ||
| make_ctags | ||
| make_etags | ||
| make_mkid | ||
| mark_pgdllimport.pl | ||
| msvc_gendef.pl | ||
| PerfectHash.pm | ||
| pgflex | ||
| pgtest | ||
| rcgen | ||
| RELEASE_CHANGES | ||
| testint128.c | ||
| testwrap | ||
| valgrind.supp | ||
| version_stamp.pl | ||
| win32tzlist.pl | ||