Skip to content

Commit

Permalink
doc: Fix incorrect reference to query ID generation
Browse files Browse the repository at this point in the history
The query ID is automatically computed by PostgreSQL if the GUC
compute_query_id is set to "on" or "auto".  pg_hint_plan informs the
backend to compute the query ID when pg_hint_plan.enable_hint_table is
enabled by calling EnableQueryId() for the "auto" case.  The
documentation incorrectly mentioned that query IDs are computed by
pg_stat_statements, so let's fix the description to match with the real
behavior.

Query IDs are computed by PostgreSQL itself without pg_stat_statement's
help since v14, so backpatch down to this version.

Backpatch-through: 14
  • Loading branch information
michaelpq committed May 20, 2024
1 parent ab3aab6 commit 62c1bfd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/functional_limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ ECPG removes comments in queries written as embedded SQLs so hints cannot
be passed to it. The only exception `EXECUTE`, that passes the query string
to the server as-is. The hint table can be used in the case.

## `pg_stat_statements`
## Query Identifiers

`pg_stat_statements` generates a query ID, ignoring comments. Hence,
queries with different hints, still written the same way, may compute the
same query ID.
When `compute_query_id` is enabled, PostgreSQL generates a query ID,
ignoring comments. Hence, queries with different hints, still written
the same way, may compute the same query ID.

0 comments on commit 62c1bfd

Please sign in to comment.