2023-03-03 08:46:11 +09:00
|
|
|
--
|
|
|
|
-- SELECT statements
|
|
|
|
--
|
|
|
|
CREATE EXTENSION pg_stat_statements;
|
|
|
|
SET pg_stat_statements.track_utility = FALSE;
|
|
|
|
SET pg_stat_statements.track_planning = TRUE;
|
2023-11-27 02:50:59 +02:00
|
|
|
SELECT pg_stat_statements_reset() IS NOT NULL AS t;
|
|
|
|
t
|
|
|
|
---
|
|
|
|
t
|
2023-03-03 08:46:11 +09:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
--
|
|
|
|
-- simple and compound statements
|
|
|
|
--
|
|
|
|
SELECT 1 AS "int";
|
|
|
|
int
|
|
|
|
-----
|
|
|
|
1
|
|
|
|
(1 row)
|
|
|
|
|
Improve parser's reporting of statement start locations.
Up to now, the parser's reporting of a statement's stmt_location
included any preceding whitespace or comments. This isn't really
desirable but was done to avoid accounting honestly for nonterminals
that reduce to empty. It causes problems for pg_stat_statements,
which partially compensates by manually stripping whitespace, but
is not bright enough to strip /*-style comments. There will be
more problems with an upcoming patch to improve reporting of errors
in extension scripts, so it's time to do something about this.
The thing we have to do to make it work right is to adjust
YYLLOC_DEFAULT to scan the inputs of each production to find the
first one that has a valid location (i.e., did not reduce to
empty). In theory this adds a little bit of per-reduction overhead,
but in practice it's negligible. I checked by measuring the time
to run raw_parser() on the contents of information_schema.sql, and
there was basically no change.
Having done that, we can rely on any nonterminal that didn't reduce
to completely empty to have a correct starting location, and we don't
need the kluges the stmtmulti production formerly used.
This should have a side benefit of allowing parse error reports to
include an error position in some cases where they formerly failed to
do so, due to trying to report the position of an empty nonterminal.
I did not go looking for an example though. The one previously known
case where that could happen (OptSchemaEltList) no longer needs the
kluge it had; but I rather doubt that that was the only case.
Discussion: https://postgr.es/m/ZvV1ClhnbJLCz7Sm@msg.df7cb.de
2024-10-22 11:26:05 -04:00
|
|
|
/* this comment should not appear in the output */
|
2023-03-03 08:46:11 +09:00
|
|
|
SELECT 'hello'
|
Improve parser's reporting of statement start locations.
Up to now, the parser's reporting of a statement's stmt_location
included any preceding whitespace or comments. This isn't really
desirable but was done to avoid accounting honestly for nonterminals
that reduce to empty. It causes problems for pg_stat_statements,
which partially compensates by manually stripping whitespace, but
is not bright enough to strip /*-style comments. There will be
more problems with an upcoming patch to improve reporting of errors
in extension scripts, so it's time to do something about this.
The thing we have to do to make it work right is to adjust
YYLLOC_DEFAULT to scan the inputs of each production to find the
first one that has a valid location (i.e., did not reduce to
empty). In theory this adds a little bit of per-reduction overhead,
but in practice it's negligible. I checked by measuring the time
to run raw_parser() on the contents of information_schema.sql, and
there was basically no change.
Having done that, we can rely on any nonterminal that didn't reduce
to completely empty to have a correct starting location, and we don't
need the kluges the stmtmulti production formerly used.
This should have a side benefit of allowing parse error reports to
include an error position in some cases where they formerly failed to
do so, due to trying to report the position of an empty nonterminal.
I did not go looking for an example though. The one previously known
case where that could happen (OptSchemaEltList) no longer needs the
kluge it had; but I rather doubt that that was the only case.
Discussion: https://postgr.es/m/ZvV1ClhnbJLCz7Sm@msg.df7cb.de
2024-10-22 11:26:05 -04:00
|
|
|
-- but this one will appear
|
2023-03-03 08:46:11 +09:00
|
|
|
AS "text";
|
|
|
|
text
|
|
|
|
-------
|
|
|
|
hello
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT 'world' AS "text";
|
|
|
|
text
|
|
|
|
-------
|
|
|
|
world
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
-- transaction
|
|
|
|
BEGIN;
|
|
|
|
SELECT 1 AS "int";
|
|
|
|
int
|
|
|
|
-----
|
|
|
|
1
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT 'hello' AS "text";
|
|
|
|
text
|
|
|
|
-------
|
|
|
|
hello
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
-- compound transaction
|
|
|
|
BEGIN \;
|
|
|
|
SELECT 2.0 AS "float" \;
|
|
|
|
SELECT 'world' AS "text" \;
|
|
|
|
COMMIT;
|
|
|
|
float
|
|
|
|
-------
|
|
|
|
2.0
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
text
|
|
|
|
-------
|
|
|
|
world
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
-- compound with empty statements and spurious leading spacing
|
|
|
|
\;\; SELECT 3 + 3 \;\;\; SELECT ' ' || ' !' \;\; SELECT 1 + 4 \;;
|
|
|
|
?column?
|
|
|
|
----------
|
|
|
|
6
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
?column?
|
|
|
|
----------
|
|
|
|
!
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
?column?
|
|
|
|
----------
|
|
|
|
5
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
-- non ;-terminated statements
|
|
|
|
SELECT 1 + 1 + 1 AS "add" \gset
|
|
|
|
SELECT :add + 1 + 1 AS "add" \;
|
|
|
|
SELECT :add + 1 + 1 AS "add" \gset
|
|
|
|
add
|
|
|
|
-----
|
|
|
|
5
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
-- set operator
|
|
|
|
SELECT 1 AS i UNION SELECT 2 ORDER BY i;
|
|
|
|
i
|
|
|
|
---
|
|
|
|
1
|
|
|
|
2
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
-- ? operator
|
|
|
|
select '{"a":1, "b":2}'::jsonb ? 'b';
|
|
|
|
?column?
|
|
|
|
----------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
-- cte
|
|
|
|
WITH t(f) AS (
|
|
|
|
VALUES (1.0), (2.0)
|
|
|
|
)
|
|
|
|
SELECT f FROM t ORDER BY f;
|
|
|
|
f
|
|
|
|
-----
|
|
|
|
1.0
|
|
|
|
2.0
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
-- prepared statement with parameter
|
|
|
|
PREPARE pgss_test (int) AS SELECT $1, 'test' LIMIT 1;
|
|
|
|
EXECUTE pgss_test(1);
|
|
|
|
?column? | ?column?
|
|
|
|
----------+----------
|
|
|
|
1 | test
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
DEALLOCATE pgss_test;
|
|
|
|
SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C";
|
|
|
|
calls | rows | query
|
|
|
|
-------+------+------------------------------------------------------------------------------
|
|
|
|
4 | 4 | SELECT $1 +
|
Improve parser's reporting of statement start locations.
Up to now, the parser's reporting of a statement's stmt_location
included any preceding whitespace or comments. This isn't really
desirable but was done to avoid accounting honestly for nonterminals
that reduce to empty. It causes problems for pg_stat_statements,
which partially compensates by manually stripping whitespace, but
is not bright enough to strip /*-style comments. There will be
more problems with an upcoming patch to improve reporting of errors
in extension scripts, so it's time to do something about this.
The thing we have to do to make it work right is to adjust
YYLLOC_DEFAULT to scan the inputs of each production to find the
first one that has a valid location (i.e., did not reduce to
empty). In theory this adds a little bit of per-reduction overhead,
but in practice it's negligible. I checked by measuring the time
to run raw_parser() on the contents of information_schema.sql, and
there was basically no change.
Having done that, we can rely on any nonterminal that didn't reduce
to completely empty to have a correct starting location, and we don't
need the kluges the stmtmulti production formerly used.
This should have a side benefit of allowing parse error reports to
include an error position in some cases where they formerly failed to
do so, due to trying to report the position of an empty nonterminal.
I did not go looking for an example though. The one previously known
case where that could happen (OptSchemaEltList) no longer needs the
kluge it had; but I rather doubt that that was the only case.
Discussion: https://postgr.es/m/ZvV1ClhnbJLCz7Sm@msg.df7cb.de
2024-10-22 11:26:05 -04:00
|
|
|
| | -- but this one will appear +
|
2023-03-03 08:46:11 +09:00
|
|
|
| | AS "text"
|
|
|
|
2 | 2 | SELECT $1 + $2
|
|
|
|
3 | 3 | SELECT $1 + $2 + $3 AS "add"
|
|
|
|
1 | 1 | SELECT $1 AS "float"
|
|
|
|
2 | 2 | SELECT $1 AS "int"
|
|
|
|
1 | 2 | SELECT $1 AS i UNION SELECT $2 ORDER BY i
|
|
|
|
1 | 1 | SELECT $1 || $2
|
Track more precisely query locations for nested statements
Previously, a Query generated through the transform phase would have
unset stmt_location, tracking the starting point of a query string.
Extensions relying on the statement location to extract its relevant
parts in the source text string would fallback to use the whole
statement instead, leading to confusing results like in
pg_stat_statements for queries relying on nested queries, like:
- EXPLAIN, with top-level and nested query using the same query string,
and a query ID coming from the nested query when the non-top-level
entry.
- Multi-statements, with only partial portions of queries being
normalized.
- COPY TO with a query, SELECT or DMLs.
This patch improves things by keeping track of the statement locations
and propagate it to Query during transform, allowing PGSS to only show
the relevant part of the query for nested query. This leads to less
bloat in entries for non-top-level entries, as queries can now be
grouped within the same (toplevel, queryid) duos in pg_stat_statements.
The result gives a stricter one-one mapping between query IDs and its
query strings.
The regression tests introduced in 45e0ba30fc40 produce differences
reflecting the new logic.
Author: Anthonin Bonnefoy
Reviewed-by: Michael Paquier, Jian He
Discussion: https://postgr.es/m/CAO6_XqqM6S9bQ2qd=75W+yKATwoazxSNhv5sjW06fjGAtHbTUA@mail.gmail.com
2024-10-24 09:28:51 +09:00
|
|
|
1 | 1 | SELECT $1, $2 LIMIT $3
|
2023-03-03 08:46:11 +09:00
|
|
|
0 | 0 | SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"
|
2023-11-27 02:50:59 +02:00
|
|
|
1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t
|
2023-03-03 08:46:11 +09:00
|
|
|
1 | 2 | WITH t(f) AS ( +
|
|
|
|
| | VALUES ($1), ($2) +
|
|
|
|
| | ) +
|
|
|
|
| | SELECT f FROM t ORDER BY f
|
|
|
|
1 | 1 | select $1::jsonb ? $2
|
|
|
|
(12 rows)
|
|
|
|
|
2023-11-27 02:50:59 +02:00
|
|
|
SELECT pg_stat_statements_reset() IS NOT NULL AS t;
|
|
|
|
t
|
|
|
|
---
|
|
|
|
t
|
2023-03-03 08:46:11 +09:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
--
|
|
|
|
-- queries with locking clauses
|
|
|
|
--
|
|
|
|
CREATE TABLE pgss_a (id integer PRIMARY KEY);
|
|
|
|
CREATE TABLE pgss_b (id integer PRIMARY KEY, a_id integer REFERENCES pgss_a);
|
2023-11-27 02:50:59 +02:00
|
|
|
SELECT pg_stat_statements_reset() IS NOT NULL AS t;
|
|
|
|
t
|
|
|
|
---
|
|
|
|
t
|
2023-03-03 08:46:11 +09:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
-- control query
|
|
|
|
SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id;
|
|
|
|
id | id | a_id
|
|
|
|
----+----+------
|
|
|
|
(0 rows)
|
|
|
|
|
|
|
|
-- test range tables
|
|
|
|
SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE;
|
|
|
|
id | id | a_id
|
|
|
|
----+----+------
|
|
|
|
(0 rows)
|
|
|
|
|
|
|
|
SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE OF pgss_a;
|
|
|
|
id | id | a_id
|
|
|
|
----+----+------
|
|
|
|
(0 rows)
|
|
|
|
|
|
|
|
SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE OF pgss_b;
|
|
|
|
id | id | a_id
|
|
|
|
----+----+------
|
|
|
|
(0 rows)
|
|
|
|
|
|
|
|
SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE OF pgss_a, pgss_b; -- matches plain "FOR UPDATE"
|
|
|
|
id | id | a_id
|
|
|
|
----+----+------
|
|
|
|
(0 rows)
|
|
|
|
|
|
|
|
SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE OF pgss_b, pgss_a;
|
|
|
|
id | id | a_id
|
|
|
|
----+----+------
|
|
|
|
(0 rows)
|
|
|
|
|
|
|
|
-- test strengths
|
|
|
|
SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR NO KEY UPDATE;
|
|
|
|
id | id | a_id
|
|
|
|
----+----+------
|
|
|
|
(0 rows)
|
|
|
|
|
|
|
|
SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR SHARE;
|
|
|
|
id | id | a_id
|
|
|
|
----+----+------
|
|
|
|
(0 rows)
|
|
|
|
|
|
|
|
SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR KEY SHARE;
|
|
|
|
id | id | a_id
|
|
|
|
----+----+------
|
|
|
|
(0 rows)
|
|
|
|
|
|
|
|
-- test wait policies
|
|
|
|
SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE NOWAIT;
|
|
|
|
id | id | a_id
|
|
|
|
----+----+------
|
|
|
|
(0 rows)
|
|
|
|
|
|
|
|
SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE SKIP LOCKED;
|
|
|
|
id | id | a_id
|
|
|
|
----+----+------
|
|
|
|
(0 rows)
|
|
|
|
|
|
|
|
SELECT calls, query FROM pg_stat_statements ORDER BY query COLLATE "C";
|
|
|
|
calls | query
|
|
|
|
-------+------------------------------------------------------------------------------------------
|
|
|
|
1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id
|
|
|
|
1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR KEY SHARE
|
|
|
|
1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR NO KEY UPDATE
|
|
|
|
1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR SHARE
|
|
|
|
2 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE
|
|
|
|
1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE NOWAIT
|
|
|
|
1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE OF pgss_a
|
|
|
|
1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE OF pgss_b
|
|
|
|
1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE OF pgss_b, pgss_a
|
|
|
|
1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE SKIP LOCKED
|
|
|
|
0 | SELECT calls, query FROM pg_stat_statements ORDER BY query COLLATE "C"
|
2023-11-27 02:50:59 +02:00
|
|
|
1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t
|
2023-03-03 08:46:11 +09:00
|
|
|
(12 rows)
|
|
|
|
|
|
|
|
DROP TABLE pgss_a, pgss_b CASCADE;
|
|
|
|
--
|
|
|
|
-- access to pg_stat_statements_info view
|
|
|
|
--
|
2023-11-27 02:50:59 +02:00
|
|
|
SELECT pg_stat_statements_reset() IS NOT NULL AS t;
|
|
|
|
t
|
|
|
|
---
|
|
|
|
t
|
2023-03-03 08:46:11 +09:00
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT dealloc FROM pg_stat_statements_info;
|
|
|
|
dealloc
|
|
|
|
---------
|
|
|
|
0
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
-- FROM [ONLY]
|
|
|
|
CREATE TABLE tbl_inh(id integer);
|
|
|
|
CREATE TABLE tbl_inh_1() INHERITS (tbl_inh);
|
|
|
|
INSERT INTO tbl_inh_1 SELECT 1;
|
|
|
|
SELECT * FROM tbl_inh;
|
|
|
|
id
|
|
|
|
----
|
|
|
|
1
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT * FROM ONLY tbl_inh;
|
|
|
|
id
|
|
|
|
----
|
|
|
|
(0 rows)
|
|
|
|
|
|
|
|
SELECT COUNT(*) FROM pg_stat_statements WHERE query LIKE '%FROM%tbl_inh%';
|
|
|
|
count
|
|
|
|
-------
|
|
|
|
2
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
-- WITH TIES
|
|
|
|
CREATE TABLE limitoption AS SELECT 0 AS val FROM generate_series(1, 10);
|
|
|
|
SELECT *
|
|
|
|
FROM limitoption
|
|
|
|
WHERE val < 2
|
|
|
|
ORDER BY val
|
|
|
|
FETCH FIRST 2 ROWS WITH TIES;
|
|
|
|
val
|
|
|
|
-----
|
|
|
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
(10 rows)
|
|
|
|
|
|
|
|
SELECT *
|
|
|
|
FROM limitoption
|
|
|
|
WHERE val < 2
|
|
|
|
ORDER BY val
|
|
|
|
FETCH FIRST 2 ROW ONLY;
|
|
|
|
val
|
|
|
|
-----
|
|
|
|
0
|
|
|
|
0
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
SELECT COUNT(*) FROM pg_stat_statements WHERE query LIKE '%FETCH FIRST%';
|
|
|
|
count
|
|
|
|
-------
|
|
|
|
2
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
-- GROUP BY [DISTINCT]
|
|
|
|
SELECT a, b, c
|
|
|
|
FROM (VALUES (1, 2, 3), (4, NULL, 6), (7, 8, 9)) AS t (a, b, c)
|
|
|
|
GROUP BY ROLLUP(a, b), rollup(a, c)
|
|
|
|
ORDER BY a, b, c;
|
|
|
|
a | b | c
|
|
|
|
---+---+---
|
|
|
|
1 | 2 | 3
|
|
|
|
1 | 2 |
|
|
|
|
1 | 2 |
|
|
|
|
1 | | 3
|
|
|
|
1 | | 3
|
|
|
|
1 | |
|
|
|
|
1 | |
|
|
|
|
1 | |
|
|
|
|
4 | | 6
|
|
|
|
4 | | 6
|
|
|
|
4 | | 6
|
|
|
|
4 | |
|
|
|
|
4 | |
|
|
|
|
4 | |
|
|
|
|
4 | |
|
|
|
|
4 | |
|
|
|
|
7 | 8 | 9
|
|
|
|
7 | 8 |
|
|
|
|
7 | 8 |
|
|
|
|
7 | | 9
|
|
|
|
7 | | 9
|
|
|
|
7 | |
|
|
|
|
7 | |
|
|
|
|
7 | |
|
|
|
|
| |
|
|
|
|
(25 rows)
|
|
|
|
|
|
|
|
SELECT a, b, c
|
|
|
|
FROM (VALUES (1, 2, 3), (4, NULL, 6), (7, 8, 9)) AS t (a, b, c)
|
|
|
|
GROUP BY DISTINCT ROLLUP(a, b), rollup(a, c)
|
|
|
|
ORDER BY a, b, c;
|
|
|
|
a | b | c
|
|
|
|
---+---+---
|
|
|
|
1 | 2 | 3
|
|
|
|
1 | 2 |
|
|
|
|
1 | | 3
|
|
|
|
1 | |
|
|
|
|
4 | | 6
|
|
|
|
4 | | 6
|
|
|
|
4 | |
|
|
|
|
4 | |
|
|
|
|
7 | 8 | 9
|
|
|
|
7 | 8 |
|
|
|
|
7 | | 9
|
|
|
|
7 | |
|
|
|
|
| |
|
|
|
|
(13 rows)
|
|
|
|
|
|
|
|
SELECT COUNT(*) FROM pg_stat_statements WHERE query LIKE '%GROUP BY%ROLLUP%';
|
|
|
|
count
|
|
|
|
-------
|
|
|
|
2
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
-- GROUPING SET agglevelsup
|
|
|
|
SELECT (
|
|
|
|
SELECT (
|
|
|
|
SELECT GROUPING(a,b) FROM (VALUES (1)) v2(c)
|
|
|
|
) FROM (VALUES (1,2)) v1(a,b) GROUP BY (a,b)
|
|
|
|
) FROM (VALUES(6,7)) v3(e,f) GROUP BY ROLLUP(e,f);
|
|
|
|
grouping
|
|
|
|
----------
|
|
|
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
SELECT (
|
|
|
|
SELECT (
|
|
|
|
SELECT GROUPING(e,f) FROM (VALUES (1)) v2(c)
|
|
|
|
) FROM (VALUES (1,2)) v1(a,b) GROUP BY (a,b)
|
|
|
|
) FROM (VALUES(6,7)) v3(e,f) GROUP BY ROLLUP(e,f);
|
|
|
|
grouping
|
|
|
|
----------
|
|
|
|
3
|
|
|
|
0
|
|
|
|
1
|
|
|
|
(3 rows)
|
|
|
|
|
|
|
|
SELECT COUNT(*) FROM pg_stat_statements WHERE query LIKE '%SELECT GROUPING%';
|
|
|
|
count
|
|
|
|
-------
|
|
|
|
2
|
|
|
|
(1 row)
|
|
|
|
|
2023-11-27 02:50:59 +02:00
|
|
|
SELECT pg_stat_statements_reset() IS NOT NULL AS t;
|
|
|
|
t
|
|
|
|
---
|
|
|
|
t
|
2023-03-03 08:46:11 +09:00
|
|
|
(1 row)
|
|
|
|
|