1/*-------------------------------------------------------------------------
4 * Query normalization and fingerprinting.
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/nodes/queryjumble.h
12 *-------------------------------------------------------------------------
20 * Struct for tracking locations/lengths of constants during normalization
25 int length;
/* length in bytes, or -1 to ignore */
27 /* Does this location represent a squashed list? */
30 /* Is this location a PARAM_EXTERN parameter? */
35 * Working state for computing a query jumble and producing a normalized
40 /* Jumble of current query tree */
43 /* Number of bytes used in jumble[] */
46 /* Array of locations of constants that should be removed */
49 /* Allocated length of clocations array */
52 /* Current number of valid entries in clocations array */
56 * ID of the highest PARAM_EXTERN parameter we've seen in the query; used
57 * to start normalization correctly. However, if there are any squashed
58 * lists in the query, we disregard query-supplied parameter numbers and
59 * renumber everything. This is to avoid possible gaps caused by
60 * squashing in case any params are in squashed lists.
64 /* Whether squashable lists are present */
68 * Count of the number of NULL nodes seen since last appending a value.
69 * These are flushed out to the jumble buffer before subsequent appends
70 * and before performing the final jumble hash.
74#ifdef USE_ASSERT_CHECKING
75 /* The total number of bytes added to the jumble buffer */
76 Size total_jumble_len;
80/* Values for the compute_query_id GUC */
100 * Returns whether query identifier computation has been enabled, either
101 * directly in the GUC or by a module when the setting is 'auto'.
113#endif /* QUERYJUMBLE_H */
struct JumbleState JumbleState
JumbleState * JumbleQuery(Query *query)
@ COMPUTE_QUERY_ID_REGRESS
const char * CleanQuerytext(const char *query, int *location, int *len)
static bool IsQueryIdEnabled(void)
PGDLLIMPORT bool query_id_enabled
PGDLLIMPORT int compute_query_id
struct LocationLen LocationLen
unsigned int pending_nulls
int highest_extern_param_id