Skip to content

Commit

Permalink
Fixed type missmatch error in in case of resets performed during
Browse files Browse the repository at this point in the history
report interval or possible statements hashtable overflow. Those
problems could appear only in versions 11 and 12.
  • Loading branch information
zubkov-andrei committed May 30, 2023
1 parent d68822a commit d179b14
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions report/functions/clusterstat.sql
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ $$
SELECT
interval_num,
sample_id,
bgwriter_stats_reset,
archiver_stats_reset
bgwriter_stats_reset::text,
archiver_stats_reset::text
FROM
(SELECT 1 AS interval_num, sample_id, bgwriter_stats_reset, archiver_stats_reset
FROM cluster_stats_reset(sserver_id, start1_id, end1_id)
Expand Down
2 changes: 1 addition & 1 deletion report/functions/dbstat.sql
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ $$
SELECT
interval_num,
datname,
stats_reset,
stats_reset::text as stats_reset,
sample_id
FROM
(SELECT 1 AS interval_num, datname, stats_reset, sample_id
Expand Down
12 changes: 9 additions & 3 deletions report/functions/statements_checks.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ RETURNS TABLE(
stmt_cnt integer,
max_cnt text
)
--SET search_path=@extschema@
SET search_path=@extschema@
AS $$
SELECT sample_id,sample_time,stmt_cnt,prm.setting AS max_cnt
SELECT
sample_id,
sample_time,
stmt_cnt,
prm.setting AS max_cnt
FROM samples
JOIN (
SELECT sample_id,sum(statements) stmt_cnt
SELECT
sample_id,
sum(statements)::integer AS stmt_cnt
FROM sample_statements_total
WHERE server_id = sserver_id
AND ((start_id, end_id) = (0,0) OR sample_id BETWEEN start_id + 1 AND end_id)
Expand Down

0 comments on commit d179b14

Please sign in to comment.