ページの先頭行へ戻る
Enterprise Postgres 17 リリース情報

2.2.67 pg_stat_statementsのクエリ文字列の正規化

非互換

pg_stat_statementsにおいて、DECLARE、EXPLAIN、CREATE MATERIALIZED VIEW、CREATE TABLE ASのコマンドのクエリ文字列の定数部分を正規化し、$1などのように表示するようにします。

Fujitsu Enterprise Postgres 15以前の場合
postgres=# EXPLAIN (costs off) SELECT a FROM generate_series(1,10) AS tab(a) WHERE a = 7;
              QUERY PLAN
--------------------------------------
 Function Scan on generate_series tab
   Filter: (a = 7)
(2 rows)

postgres=# SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C";
 calls | rows |                                     query
-------+------+-------------------------------------------------------------------------------
     1 |    0 | EXPLAIN (costs off) SELECT a FROM generate_series(1,10) AS tab(a) WHERE a = 7
     1 |    1 | SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"

(2 rows)
Fujitsu Enterprise Postgres 16の場合
postgres=# EXPLAIN (costs off) SELECT a FROM generate_series(1,10) AS tab(a) WHERE a = 7;
              QUERY PLAN
--------------------------------------
 Function Scan on generate_series tab
   Filter: (a = 7)
(2 rows)

postgres=# SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C";
 calls | rows |                                      query
-------+------+---------------------------------------------------------------------------------
     1 |    0 | EXPLAIN (costs off) SELECT a FROM generate_series($1,$2) AS tab(a) WHERE a = $3
     1 |    0 | SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"
(2 rows)

対処方法

ありません。