mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 05:56:21 +00:00
PG-545: pg_stat_monitor: Same query text should generate same queryid
Regardless of the database or the user, the same query will yield the same query ID. As part of this, a new column, 'pgsm_query_id', is added. * pgsm_query_id: pgsm_query_id has the same data type of int8 as the queryid column. If the incoming SQL command includes any constants, it internally normalizes the query to remove those constant values with placeholders. Otherwise, it uses the query directly to generate the query hash. Since we no longer depend on the server's parse tree mechanism, we can generate the same hash for the same query text for all server versions. Also, it is important to note that the hash being calculated is a database, schema and user independent. So same query text in different databases will generate the same hash. This column is not part of the key; rather, for observability purposes only. * Regression SQL test case pgsm_query_id.sql is added to the SQL regression.
This commit is contained in:
2
Makefile
2
Makefile
@@ -12,7 +12,7 @@ LDFLAGS_SL += $(filter -lm, $(LIBS))
|
||||
|
||||
TAP_TESTS = 1
|
||||
REGRESS_OPTS = --temp-config $(top_srcdir)/contrib/pg_stat_monitor/pg_stat_monitor.conf --inputdir=regression
|
||||
REGRESS = basic version guc functions counters relations database error_insert application_name application_name_unique top_query cmd_type error rows tags
|
||||
REGRESS = basic version guc pgsm_query_id functions counters relations database error_insert application_name application_name_unique top_query cmd_type error rows tags
|
||||
|
||||
# Disabled because these tests require "shared_preload_libraries=pg_stat_statements",
|
||||
# which typical installcheck users do not have (e.g. buildfarm clients).
|
||||
|
||||
Reference in New Issue
Block a user