Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions src/test/isolation2/expected/vacuum_progress_column.out
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,31 @@ ABORT
1: ABORT;
ABORT

-- Look up the collected stats before the DELETE below. The stats collector
-- is asynchronous: wait until it has received the dead tuples of both
-- aborted inserts, and read the view before the DELETE, whose own counts
-- may reach the collector at any moment after it.
1U: SELECT wait_until_dead_tup_change_to('vacuum_progress_ao_column'::regclass::oid, 200000);
wait_until_dead_tup_change_to
-------------------------------
OK
(1 row)
SELECT n_live_tup, n_dead_tup, last_vacuum, vacuum_count FROM pg_stat_all_tables WHERE relname = 'vacuum_progress_ao_column';
n_live_tup | n_dead_tup | last_vacuum | vacuum_count
------------+------------+-------------+--------------
100000 | 200000 | | 0
(1 row)

-- Also delete half of the tuples evenly before the EOF of segno 2.
DELETE FROM vacuum_progress_ao_column where j % 2 = 0;
DELETE 50000

-- Lookup pg_class and collected stats view before VACUUM
-- Lookup pg_class before VACUUM
SELECT relpages, reltuples, relallvisible FROM pg_class where relname = 'vacuum_progress_ao_column';
relpages | reltuples | relallvisible
----------+-----------+---------------
0 | -1 | 0
(1 row)
SELECT n_live_tup, n_dead_tup, last_vacuum, vacuum_count FROM pg_stat_all_tables WHERE relname = 'vacuum_progress_ao_column';
n_live_tup | n_dead_tup | last_vacuum | vacuum_count
------------+------------+-------------+--------------
100000 | 200000 | | 0
(1 row)

-- Perform VACUUM and observe the progress

Expand Down
22 changes: 16 additions & 6 deletions src/test/isolation2/expected/vacuum_progress_row.out
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,31 @@ ABORT
1: ABORT;
ABORT

-- Look up the collected stats before the DELETE below. The stats collector
-- is asynchronous: wait until it has received the dead tuples of both
-- aborted inserts, and read the view before the DELETE, whose own counts
-- may reach the collector at any moment after it.
1U: SELECT wait_until_dead_tup_change_to('vacuum_progress_ao_row'::regclass::oid, 200000);
wait_until_dead_tup_change_to
-------------------------------
OK
(1 row)
SELECT n_live_tup, n_dead_tup, last_vacuum, vacuum_count FROM pg_stat_all_tables WHERE relname = 'vacuum_progress_ao_row';
n_live_tup | n_dead_tup | last_vacuum | vacuum_count
------------+------------+-------------+--------------
100000 | 200000 | | 0
(1 row)

-- Also delete half of the tuples evenly before the EOF of segno 2.
DELETE FROM vacuum_progress_ao_row where j % 2 = 0;
DELETE 50000

-- Lookup pg_class and collected stats view before VACUUM
-- Lookup pg_class before VACUUM
SELECT relpages, reltuples, relallvisible FROM pg_class where relname = 'vacuum_progress_ao_row';
relpages | reltuples | relallvisible
----------+-----------+---------------
0 | -1 | 0
(1 row)
SELECT n_live_tup, n_dead_tup, last_vacuum, vacuum_count FROM pg_stat_all_tables WHERE relname = 'vacuum_progress_ao_row';
n_live_tup | n_dead_tup | last_vacuum | vacuum_count
------------+------------+-------------+--------------
100000 | 200000 | | 0
(1 row)

-- Perform VACUUM and observe the progress

Expand Down
10 changes: 8 additions & 2 deletions src/test/isolation2/sql/vacuum_progress_column.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,18 @@ CREATE INDEX on vacuum_progress_ao_column(j);
-- Abort so that segno 1 has logical EOF = 0.
1: ABORT;

-- Look up the collected stats before the DELETE below. The stats collector
-- is asynchronous: wait until it has received the dead tuples of both
-- aborted inserts, and read the view before the DELETE, whose own counts
-- may reach the collector at any moment after it.
1U: SELECT wait_until_dead_tup_change_to('vacuum_progress_ao_column'::regclass::oid, 200000);
SELECT n_live_tup, n_dead_tup, last_vacuum, vacuum_count FROM pg_stat_all_tables WHERE relname = 'vacuum_progress_ao_column';

-- Also delete half of the tuples evenly before the EOF of segno 2.
DELETE FROM vacuum_progress_ao_column where j % 2 = 0;

-- Lookup pg_class and collected stats view before VACUUM
-- Lookup pg_class before VACUUM
SELECT relpages, reltuples, relallvisible FROM pg_class where relname = 'vacuum_progress_ao_column';
SELECT n_live_tup, n_dead_tup, last_vacuum, vacuum_count FROM pg_stat_all_tables WHERE relname = 'vacuum_progress_ao_column';

-- Perform VACUUM and observe the progress

Expand Down
10 changes: 8 additions & 2 deletions src/test/isolation2/sql/vacuum_progress_row.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,18 @@ CREATE INDEX on vacuum_progress_ao_row(j);
-- Abort so that segno 1 has logical EOF = 0.
1: ABORT;

-- Look up the collected stats before the DELETE below. The stats collector
-- is asynchronous: wait until it has received the dead tuples of both
-- aborted inserts, and read the view before the DELETE, whose own counts
-- may reach the collector at any moment after it.
1U: SELECT wait_until_dead_tup_change_to('vacuum_progress_ao_row'::regclass::oid, 200000);
SELECT n_live_tup, n_dead_tup, last_vacuum, vacuum_count FROM pg_stat_all_tables WHERE relname = 'vacuum_progress_ao_row';

-- Also delete half of the tuples evenly before the EOF of segno 2.
DELETE FROM vacuum_progress_ao_row where j % 2 = 0;

-- Lookup pg_class and collected stats view before VACUUM
-- Lookup pg_class before VACUUM
SELECT relpages, reltuples, relallvisible FROM pg_class where relname = 'vacuum_progress_ao_row';
SELECT n_live_tup, n_dead_tup, last_vacuum, vacuum_count FROM pg_stat_all_tables WHERE relname = 'vacuum_progress_ao_row';

-- Perform VACUUM and observe the progress

Expand Down
Loading