File tree 2 files changed +8
-9
lines changed
2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -1137,6 +1137,9 @@ SELECT pg_stat_get_subscription_stats(NULL);
1137
1137
-- extends.
1138
1138
SELECT sum(extends) AS io_sum_shared_before_extends
1139
1139
FROM pg_stat_io WHERE io_context = 'normal' AND io_object = 'relation' \gset
1140
+ SELECT sum(writes) AS writes, sum(fsyncs) AS fsyncs
1141
+ FROM pg_stat_io
1142
+ WHERE io_object = 'relation' \gset io_sum_shared_before_
1140
1143
CREATE TABLE test_io_shared(a int);
1141
1144
INSERT INTO test_io_shared SELECT i FROM generate_series(1,100)i;
1142
1145
SELECT pg_stat_force_next_flush();
@@ -1155,15 +1158,12 @@ SELECT :io_sum_shared_after_extends > :io_sum_shared_before_extends;
1155
1158
1156
1159
-- After a checkpoint, there should be some additional IOCONTEXT_NORMAL writes
1157
1160
-- and fsyncs.
1158
- SELECT sum(writes) AS writes, sum(fsyncs) AS fsyncs
1159
- FROM pg_stat_io
1160
- WHERE io_context = 'normal' AND io_object = 'relation' \gset io_sum_shared_before_
1161
1161
-- See comment above for rationale for two explicit CHECKPOINTs.
1162
1162
CHECKPOINT;
1163
1163
CHECKPOINT;
1164
1164
SELECT sum(writes) AS writes, sum(fsyncs) AS fsyncs
1165
1165
FROM pg_stat_io
1166
- WHERE io_context = 'normal' AND io_object = 'relation' \gset io_sum_shared_after_
1166
+ WHERE io_object = 'relation' \gset io_sum_shared_after_
1167
1167
SELECT :io_sum_shared_after_writes > :io_sum_shared_before_writes;
1168
1168
?column?
1169
1169
----------
Original file line number Diff line number Diff line change @@ -549,6 +549,9 @@ SELECT pg_stat_get_subscription_stats(NULL);
549
549
-- extends.
550
550
SELECT sum (extends) AS io_sum_shared_before_extends
551
551
FROM pg_stat_io WHERE io_context = ' normal' AND io_object = ' relation' \gset
552
+ SELECT sum (writes) AS writes, sum (fsyncs) AS fsyncs
553
+ FROM pg_stat_io
554
+ WHERE io_object = ' relation' \gset io_sum_shared_before_
552
555
CREATE TABLE test_io_shared (a int );
553
556
INSERT INTO test_io_shared SELECT i FROM generate_series(1 ,100 )i;
554
557
SELECT pg_stat_force_next_flush();
@@ -558,16 +561,12 @@ SELECT :io_sum_shared_after_extends > :io_sum_shared_before_extends;
558
561
559
562
-- After a checkpoint, there should be some additional IOCONTEXT_NORMAL writes
560
563
-- and fsyncs.
561
- SELECT sum (writes) AS writes, sum (fsyncs) AS fsyncs
562
- FROM pg_stat_io
563
- WHERE io_context = ' normal' AND io_object = ' relation' \gset io_sum_shared_before_
564
564
-- See comment above for rationale for two explicit CHECKPOINTs.
565
565
CHECKPOINT;
566
566
CHECKPOINT;
567
567
SELECT sum (writes) AS writes, sum (fsyncs) AS fsyncs
568
568
FROM pg_stat_io
569
- WHERE io_context = ' normal' AND io_object = ' relation' \gset io_sum_shared_after_
570
-
569
+ WHERE io_object = ' relation' \gset io_sum_shared_after_
571
570
SELECT :io_sum_shared_after_writes > :io_sum_shared_before_writes;
572
571
SELECT current_setting(' fsync' ) = ' off'
573
572
OR :io_sum_shared_after_fsyncs > :io_sum_shared_before_fsyncs;
You can’t perform that action at this time.
0 commit comments