Skip to content
Merged
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
2 changes: 1 addition & 1 deletion contrib/auto_explain/expected/auto_explain_optimizer.out
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ LOG: duration: 0.026 ms plan:
Query Text: SELECT relname FROM pg_class WHERE relname='pg_class';
Index Only Scan using pg_class_relname_nsp_index on pg_class (cost=0.15..4.17 rows=1 width=64) (actual rows=1 loops=1)
Index Cond: (relname = 'pg_class'::name)
Heap Fetches: 1
Heap Fetches: 0
(slice0) Executor memory: 105K bytes.
Memory used: 128000kB
relname
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ SELECT count(*) FROM pg_statistic where starelid = 'autostatstbl'::regclass;
select relpages, reltuples from pg_class where oid = 'autostatstbl'::regclass;
-- expect analyze_count = 1, autoanalyze_count = 0, and n_mod_since_analyze = 1000 since ANALYZE executed
-- in same transaction for the insert statement.
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables_internal where relname = 'autostatstbl';
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables where relname = 'autostatstbl';

-- Wait until autovacuum is triggered
SELECT gp_wait_until_triggered_fault('auto_vac_worker_after_report_activity', 1, 1);
Expand All @@ -192,7 +192,7 @@ SELECT gp_inject_fault('analyze_finished_one_relation', 'reset', 1);
-- we can see the auto-ANALYZE finished
select relpages, reltuples from pg_class where oid = 'autostatstbl'::regclass;
-- expect analyze_count = 1, autoanalyze_count = 1, and n_mod_since_analyze = 0
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables_internal where relname = 'autostatstbl';
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables where relname = 'autostatstbl';

-- Case 2 --
-- with auto_stats 'on_change' mode, the auto-ANALYZE still trigger
Expand All @@ -211,7 +211,7 @@ SELECT gp_inject_fault('auto_vac_worker_after_report_activity', 'suspend', '', '
select relpages, reltuples from pg_class where oid = 'autostatstbl'::regclass;
-- expect analyze_count = 2, autoanalyze_count = 1, and n_mod_since_analyze = 1000 since ANALYZE executed
-- in same transaction for the insert statement.
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables_internal where relname = 'autostatstbl';
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables where relname = 'autostatstbl';

-- Wait until autovacuum is triggered
SELECT gp_wait_until_triggered_fault('auto_vac_worker_after_report_activity', 1, 1);
Expand All @@ -225,7 +225,7 @@ SELECT gp_inject_fault('analyze_finished_one_relation', 'reset', 1);
-- we can see the auto-ANALYZE finished, check statistic and analyze count
select relpages, reltuples from pg_class where oid = 'autostatstbl'::regclass;
-- expect analyze_count = 2, autoanalyze_count = 2, and n_mod_since_analyze = 0
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables_internal where relname = 'autostatstbl';
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables where relname = 'autostatstbl';


-- Case 3 --
Expand All @@ -244,7 +244,7 @@ SELECT gp_inject_fault('auto_vac_worker_after_report_activity', 'suspend', '', '
select relpages, reltuples from pg_class where oid = 'autostatstbl'::regclass;
-- expect analyze_count = 2, autoanalyze_count = 2, and n_mod_since_analyze = 1000 since ANALYZE executed
-- in same transaction for the insert statement.
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables_internal where relname = 'autostatstbl';
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables where relname = 'autostatstbl';

-- Wait until autovacuum is triggered
SELECT gp_wait_until_triggered_fault('auto_vac_worker_after_report_activity', 1, 1);
Expand All @@ -258,7 +258,7 @@ SELECT gp_inject_fault('analyze_finished_one_relation', 'reset', 1);
-- we can see the auto-ANALYZE finished, check statistic and analyze count
select relpages, reltuples from pg_class where oid = 'autostatstbl'::regclass;
-- expect analyze_count = 2, autoanalyze_count = 3, and n_mod_since_analyze = 0 since ANALYZE executed
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables_internal where relname = 'autostatstbl';
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables where relname = 'autostatstbl';

-- Reset GUCs.
ALTER SYSTEM RESET autovacuum_naptime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ select relpages, reltuples from pg_class where oid = 'autostatstbl'::regclass;
(1 row)
-- expect analyze_count = 1, autoanalyze_count = 0, and n_mod_since_analyze = 1000 since ANALYZE executed
-- in same transaction for the insert statement.
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables_internal where relname = 'autostatstbl';
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables where relname = 'autostatstbl';
analyze_count | autoanalyze_count | n_mod_since_analyze
---------------+-------------------+---------------------
1 | 0 | 1000
Expand Down Expand Up @@ -465,7 +465,7 @@ select relpages, reltuples from pg_class where oid = 'autostatstbl'::regclass;
1 | 1000
(1 row)
-- expect analyze_count = 1, autoanalyze_count = 1, and n_mod_since_analyze = 0
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables_internal where relname = 'autostatstbl';
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables where relname = 'autostatstbl';
analyze_count | autoanalyze_count | n_mod_since_analyze
---------------+-------------------+---------------------
1 | 1 | 0
Expand Down Expand Up @@ -502,7 +502,7 @@ select relpages, reltuples from pg_class where oid = 'autostatstbl'::regclass;
(1 row)
-- expect analyze_count = 2, autoanalyze_count = 1, and n_mod_since_analyze = 1000 since ANALYZE executed
-- in same transaction for the insert statement.
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables_internal where relname = 'autostatstbl';
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables where relname = 'autostatstbl';
analyze_count | autoanalyze_count | n_mod_since_analyze
---------------+-------------------+---------------------
2 | 1 | 1000
Expand Down Expand Up @@ -545,7 +545,7 @@ select relpages, reltuples from pg_class where oid = 'autostatstbl'::regclass;
1 | 2000
(1 row)
-- expect analyze_count = 2, autoanalyze_count = 2, and n_mod_since_analyze = 0
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables_internal where relname = 'autostatstbl';
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables where relname = 'autostatstbl';
analyze_count | autoanalyze_count | n_mod_since_analyze
---------------+-------------------+---------------------
2 | 2 | 0
Expand Down Expand Up @@ -581,7 +581,7 @@ select relpages, reltuples from pg_class where oid = 'autostatstbl'::regclass;
(1 row)
-- expect analyze_count = 2, autoanalyze_count = 2, and n_mod_since_analyze = 1000 since ANALYZE executed
-- in same transaction for the insert statement.
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables_internal where relname = 'autostatstbl';
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables where relname = 'autostatstbl';
analyze_count | autoanalyze_count | n_mod_since_analyze
---------------+-------------------+---------------------
2 | 2 | 1000
Expand Down Expand Up @@ -624,7 +624,7 @@ select relpages, reltuples from pg_class where oid = 'autostatstbl'::regclass;
1 | 3000
(1 row)
-- expect analyze_count = 2, autoanalyze_count = 3, and n_mod_since_analyze = 0 since ANALYZE executed
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables_internal where relname = 'autostatstbl';
select analyze_count, autoanalyze_count, n_mod_since_analyze from pg_stat_all_tables where relname = 'autostatstbl';
analyze_count | autoanalyze_count | n_mod_since_analyze
---------------+-------------------+---------------------
2 | 3 | 0
Expand Down
16 changes: 8 additions & 8 deletions contrib/pax_storage/src/test/regress/expected/pg_stat.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ create table pg_stat_test(a int);
select
schemaname, relname, seq_scan, seq_tup_read, idx_scan, idx_tup_fetch, n_tup_ins, n_tup_upd,
n_tup_del, n_tup_hot_upd, n_live_tup, n_dead_tup
from pg_stat_all_tables where relname = 'pg_stat_test';
from gp_stat_all_tables_summary where relname = 'pg_stat_test';
schemaname | relname | seq_scan | seq_tup_read | idx_scan | idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del | n_tup_hot_upd | n_live_tup | n_dead_tup
------------+--------------+----------+--------------+----------+---------------+-----------+-----------+-----------+---------------+------------+------------
public | pg_stat_test | 0 | 0 | | | 0 | 0 | 0 | 0 | 0 | 0
Expand All @@ -14,22 +14,22 @@ from pg_stat_all_tables where relname = 'pg_stat_test';
select
schemaname, relname, seq_scan, seq_tup_read, idx_scan, idx_tup_fetch, n_tup_ins, n_tup_upd,
n_tup_del, n_tup_hot_upd, n_live_tup, n_dead_tup
from pg_stat_user_tables where relname = 'pg_stat_test';
from gp_stat_user_tables_summary where relname = 'pg_stat_test';
schemaname | relname | seq_scan | seq_tup_read | idx_scan | idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del | n_tup_hot_upd | n_live_tup | n_dead_tup
------------+--------------+----------+--------------+----------+---------------+-----------+-----------+-----------+---------------+------------+------------
public | pg_stat_test | 0 | 0 | | | 0 | 0 | 0 | 0 | 0 | 0
(1 row)

select
schemaname, relname, indexrelname, idx_scan, idx_tup_read, idx_tup_fetch
from pg_stat_all_indexes where relname = 'pg_stat_test';
from gp_stat_all_indexes_summary where relname = 'pg_stat_test';
schemaname | relname | indexrelname | idx_scan | idx_tup_read | idx_tup_fetch
------------+---------+--------------+----------+--------------+---------------
(0 rows)

select
schemaname, relname, indexrelname, idx_scan, idx_tup_read, idx_tup_fetch
from pg_stat_user_indexes where relname = 'pg_stat_test';
from gp_stat_user_indexes_summary where relname = 'pg_stat_test';
schemaname | relname | indexrelname | idx_scan | idx_tup_read | idx_tup_fetch
------------+---------+--------------+----------+--------------+---------------
(0 rows)
Expand Down Expand Up @@ -63,7 +63,7 @@ reset enable_seqscan;
select
schemaname, relname, seq_scan, seq_tup_read, idx_scan, idx_tup_fetch, n_tup_ins, n_tup_upd,
n_tup_del, n_tup_hot_upd, n_live_tup, n_dead_tup, n_mod_since_analyze
from pg_stat_all_tables where relname = 'pg_stat_test';
from gp_stat_all_tables_summary where relname = 'pg_stat_test';
schemaname | relname | seq_scan | seq_tup_read | idx_scan | idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del | n_tup_hot_upd | n_live_tup | n_dead_tup | n_mod_since_analyze
------------+--------------+----------+--------------+----------+---------------+-----------+-----------+-----------+---------------+------------+------------+---------------------
public | pg_stat_test | 15 | 391 | 1 | 0 | 110 | 0 | 19 | 0 | 91 | 19 | 129
Expand All @@ -72,23 +72,23 @@ from pg_stat_all_tables where relname = 'pg_stat_test';
select
schemaname, relname, seq_scan, seq_tup_read, idx_scan, idx_tup_fetch, n_tup_ins, n_tup_upd,
n_tup_del, n_tup_hot_upd, n_live_tup, n_dead_tup, n_mod_since_analyze
from pg_stat_user_tables where relname = 'pg_stat_test';
from gp_stat_user_tables_summary where relname = 'pg_stat_test';
schemaname | relname | seq_scan | seq_tup_read | idx_scan | idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del | n_tup_hot_upd | n_live_tup | n_dead_tup | n_mod_since_analyze
------------+--------------+----------+--------------+----------+---------------+-----------+-----------+-----------+---------------+------------+------------+---------------------
public | pg_stat_test | 15 | 391 | 1 | 0 | 110 | 0 | 19 | 0 | 91 | 19 | 129
(1 row)

select
schemaname, relname, indexrelname, idx_scan, idx_tup_read, idx_tup_fetch
from pg_stat_all_indexes where relname = 'pg_stat_test';
from gp_stat_all_indexes_summary where relname = 'pg_stat_test';
schemaname | relname | indexrelname | idx_scan | idx_tup_read | idx_tup_fetch
------------+--------------+--------------------------+----------+--------------+---------------
public | pg_stat_test | pg_stat_user_table_index | 1 | 1 | 0
(1 row)

select
schemaname, relname, indexrelname, idx_scan, idx_tup_read, idx_tup_fetch
from pg_stat_user_indexes where relname = 'pg_stat_test';
from gp_stat_user_indexes_summary where relname = 'pg_stat_test';
schemaname | relname | indexrelname | idx_scan | idx_tup_read | idx_tup_fetch
------------+--------------+--------------------------+----------+--------------+---------------
public | pg_stat_test | pg_stat_user_table_index | 1 | 1 | 0
Expand Down
14 changes: 7 additions & 7 deletions contrib/pax_storage/src/test/regress/expected/stats.out
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SELECT t.seq_scan, t.seq_tup_read, t.idx_scan, t.idx_tup_fetch,
(b.heap_blks_read + b.heap_blks_hit) AS heap_blks,
(b.idx_blks_read + b.idx_blks_hit) AS idx_blks,
pg_stat_get_snapshot_timestamp() as snap_ts
FROM pg_catalog.pg_stat_user_tables AS t,
FROM pg_catalog.gp_stat_user_tables_summary AS t,
pg_catalog.pg_statio_user_tables AS b
WHERE t.relname='tenk2' AND b.relname='tenk2';
-- function to wait for counters to advance
Expand All @@ -45,17 +45,17 @@ begin

-- check to see if seqscan has been sensed
SELECT (st.seq_scan >= pr.seq_scan + 1) INTO updated1
FROM pg_stat_user_tables AS st, pg_class AS cl, prevstats AS pr
FROM gp_stat_user_tables_summary AS st, pg_class AS cl, prevstats AS pr
WHERE st.relname='tenk2' AND cl.relname='tenk2';

-- check to see if indexscan has been sensed
SELECT (st.idx_scan >= pr.idx_scan + 1) INTO updated2
FROM pg_stat_user_tables AS st, pg_class AS cl, prevstats AS pr
FROM gp_stat_user_tables_summary AS st, pg_class AS cl, prevstats AS pr
WHERE st.relname='tenk2' AND cl.relname='tenk2';

-- check to see if all updates have been sensed
SELECT (n_tup_ins > 0) INTO updated3
FROM pg_stat_user_tables WHERE relname='trunc_stats_test4';
FROM gp_stat_user_tables_summary WHERE relname='trunc_stats_test4';

-- We must also check explicitly that pg_stat_get_snapshot_timestamp has
-- advanced, because that comes from the global stats file which might
Expand All @@ -65,7 +65,7 @@ begin

-- check to see if idx_tup_fetch has been sensed
SELECT (st.idx_tup_fetch >= pr.idx_tup_fetch + 1) INTO updated5
FROM pg_stat_user_tables AS st, pg_class AS cl, prevstats AS pr
FROM gp_stat_user_tables_summary AS st, pg_class AS cl, prevstats AS pr
WHERE st.relname='tenk2' AND cl.relname='tenk2';

exit when updated1 and updated2 and updated3 and updated4 and updated5;
Expand Down Expand Up @@ -177,7 +177,7 @@ SELECT wait_for_stats();

-- check effects
SELECT relname, n_tup_ins, n_tup_upd, n_tup_del, n_live_tup, n_dead_tup
FROM pg_stat_user_tables
FROM gp_stat_user_tables_summary
WHERE relname like 'trunc_stats_test%' order by relname;
relname | n_tup_ins | n_tup_upd | n_tup_del | n_live_tup | n_dead_tup
-------------------+-----------+-----------+-----------+------------+------------
Expand All @@ -192,7 +192,7 @@ SELECT st.seq_scan >= pr.seq_scan + 1,
st.seq_tup_read >= pr.seq_tup_read + cl.reltuples,
st.idx_scan >= pr.idx_scan + 1,
st.idx_tup_fetch >= pr.idx_tup_fetch + 1
FROM pg_stat_user_tables AS st, pg_class AS cl, prevstats AS pr
FROM gp_stat_user_tables_summary AS st, pg_class AS cl, prevstats AS pr
WHERE st.relname='tenk2' AND cl.relname='tenk2';
?column? | ?column? | ?column? | ?column?
----------+----------+----------+----------
Expand Down
Loading
Loading