Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7d6f5dd

Browse files
committed
Tweak placement of explicit ANALYZE commands in the regression tests.
Make the COPY test, which loads most of the large static tables used inthe tests, also explicitly ANALYZE those tables. This allows us to getrid of various ad-hoc, and rather redundant, ANALYZE commands that hadgotten stuck into various test scripts over time to ensure we gotconsistent plan choices. (We could have done a database-wide ANALYZE,but that would cause stats to get attached to the small static tablestoo, which results in plan changes compared to the historical behavior.I'm not sure that's a good idea, so not going that far for now.)Back-patch to 9.0, since 9.0 and 9.1 are currently sometimes failingregression tests for lack of an "ANALYZE tenk1" in the subselect test.There's no need for this in 8.4 since we didn't print any plans backthen.
1 parent41e9990 commit7d6f5dd

File tree

6 files changed

+48
-5
lines changed

6 files changed

+48
-5
lines changed

‎src/test/regress/expected/alter_table.out

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ ALTER INDEX tmp_onek_unique1 RENAME TO onek_unique1;
134134
CREATE VIEW tmp_view (unique1) AS SELECT unique1 FROM tenk1;
135135
ALTER TABLE tmp_view RENAME TO tmp_view_new;
136136
-- hack to ensure we get an indexscan here
137-
ANALYZE tenk1;
138137
set enable_seqscan to off;
139138
set enable_bitmapscan to off;
140139
-- 5 values, sorted

‎src/test/regress/expected/join.out

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,6 @@ on (x1 = xx1) where (xx2 is not null);
21292129
-- regression test: check for bug with propagation of implied equality
21302130
-- to outside an IN
21312131
--
2132-
analyze tenk1;-- ensure we get consistent plans here
21332132
select count(*) from tenk1 a where unique1 in
21342133
(select unique1 from tenk1 b join tenk1 c using (unique1)
21352134
where b.unique2 = 42);

‎src/test/regress/input/copy.source

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,31 @@ COPY array_op_test FROM '@abs_srcdir@/data/array.data';
6060

6161
COPY array_index_op_test FROM '@abs_srcdir@/data/array.data';
6262

63+
-- analyze all the data we just loaded, to ensure plan consistency
64+
-- in later tests
65+
66+
ANALYZE aggtest;
67+
ANALYZE onek;
68+
ANALYZE tenk1;
69+
ANALYZE slow_emp4000;
70+
ANALYZE person;
71+
ANALYZE emp;
72+
ANALYZE student;
73+
ANALYZE stud_emp;
74+
ANALYZE road;
75+
ANALYZE real_city;
76+
ANALYZE hash_i4_heap;
77+
ANALYZE hash_name_heap;
78+
ANALYZE hash_txt_heap;
79+
ANALYZE hash_f8_heap;
80+
ANALYZE test_tsvector;
81+
ANALYZE bt_i4_heap;
82+
ANALYZE bt_name_heap;
83+
ANALYZE bt_txt_heap;
84+
ANALYZE bt_f8_heap;
85+
ANALYZE array_op_test;
86+
ANALYZE array_index_op_test;
87+
6388
--- test copying in CSV mode with various styles
6489
--- of embedded line ending characters
6590

‎src/test/regress/output/copy.source

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,29 @@ COPY bt_txt_heap FROM '@abs_srcdir@/data/desc.data';
3434
COPY bt_f8_heap FROM '@abs_srcdir@/data/hash.data';
3535
COPY array_op_test FROM '@abs_srcdir@/data/array.data';
3636
COPY array_index_op_test FROM '@abs_srcdir@/data/array.data';
37+
-- analyze all the data we just loaded, to ensure plan consistency
38+
-- in later tests
39+
ANALYZE aggtest;
40+
ANALYZE onek;
41+
ANALYZE tenk1;
42+
ANALYZE slow_emp4000;
43+
ANALYZE person;
44+
ANALYZE emp;
45+
ANALYZE student;
46+
ANALYZE stud_emp;
47+
ANALYZE road;
48+
ANALYZE real_city;
49+
ANALYZE hash_i4_heap;
50+
ANALYZE hash_name_heap;
51+
ANALYZE hash_txt_heap;
52+
ANALYZE hash_f8_heap;
53+
ANALYZE test_tsvector;
54+
ANALYZE bt_i4_heap;
55+
ANALYZE bt_name_heap;
56+
ANALYZE bt_txt_heap;
57+
ANALYZE bt_f8_heap;
58+
ANALYZE array_op_test;
59+
ANALYZE array_index_op_test;
3760
--- test copying in CSV mode with various styles
3861
--- of embedded line ending characters
3962
create temp table copytest (

‎src/test/regress/sql/alter_table.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ CREATE VIEW tmp_view (unique1) AS SELECT unique1 FROM tenk1;
173173
ALTERTABLE tmp_view RENAME TO tmp_view_new;
174174

175175
-- hack to ensure we get an indexscan here
176-
ANALYZE tenk1;
177176
set enable_seqscan to off;
178177
set enable_bitmapscan to off;
179178
-- 5 values, sorted

‎src/test/regress/sql/join.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,6 @@ on (x1 = xx1) where (xx2 is not null);
330330
-- regression test: check for bug with propagation of implied equality
331331
-- to outside an IN
332332
--
333-
analyze tenk1;-- ensure we get consistent plans here
334-
335333
selectcount(*)from tenk1 awhere unique1in
336334
(select unique1from tenk1 bjoin tenk1 c using (unique1)
337335
whereb.unique2=42);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp