summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Deolasee2017-04-12 11:53:21 +0000
committerPavan Deolasee2017-05-05 04:59:34 +0000
commit9dd80eef91ff0009fafcd3620e0505d59791ffd2 (patch)
tree849c05b48b84f4e6b62b54a51258441c32f681c9
parentb50af73bfab428535656e1351c0928060d6c9078 (diff)
Add a 5s sleep in create_index test case to give cluster monitor a chance to
advance OldestXmin and vacuum can correctly detect all-visible pages.
-rw-r--r--src/test/regress/expected/create_index.out33
-rw-r--r--src/test/regress/sql/create_index.sql1
2 files changed, 18 insertions, 16 deletions
diff --git a/src/test/regress/expected/create_index.out b/src/test/regress/expected/create_index.out
index 8d0d6ef647..5de986faeb 100644
--- a/src/test/regress/expected/create_index.out
+++ b/src/test/regress/expected/create_index.out
@@ -2970,21 +2970,23 @@ SELECT count(*) FROM dupindexcols
--
-- Check ordering of =ANY indexqual results (bug in 9.2.0)
--
+select pg_sleep(5); -- sleep for 5s to allow cluster monitor to advance OldestXmin
+ pg_sleep
+----------
+
+(1 row)
+
vacuum tenk1; -- ensure we get consistent plans here
explain (costs off)
SELECT unique1 FROM tenk1
WHERE unique1 IN (1,42,7)
ORDER BY unique1;
- QUERY PLAN
--------------------------------------------------------------------------
+ QUERY PLAN
+-------------------------------------------------------------
Remote Subquery Scan on all (datanode_1,datanode_2)
- -> Sort
- Sort Key: unique1
- -> Bitmap Heap Scan on tenk1
- Recheck Cond: (unique1 = ANY ('{1,42,7}'::integer[]))
- -> Bitmap Index Scan on tenk1_unique1
- Index Cond: (unique1 = ANY ('{1,42,7}'::integer[]))
-(7 rows)
+ -> Index Only Scan using tenk1_unique1 on tenk1
+ Index Cond: (unique1 = ANY ('{1,42,7}'::integer[]))
+(3 rows)
SELECT unique1 FROM tenk1
WHERE unique1 IN (1,42,7)
@@ -3000,14 +3002,13 @@ explain (costs off)
SELECT thousand, tenthous FROM tenk1
WHERE thousand < 2 AND tenthous IN (1001,3000)
ORDER BY thousand;
- QUERY PLAN
---------------------------------------------------------------------------------------------
+ QUERY PLAN
+-------------------------------------------------------------
Remote Subquery Scan on all (datanode_1,datanode_2)
- -> Sort
- Sort Key: thousand
- -> Index Only Scan using tenk1_thous_tenthous on tenk1
- Index Cond: ((thousand < 2) AND (tenthous = ANY ('{1001,3000}'::integer[])))
-(5 rows)
+ -> Index Only Scan using tenk1_thous_tenthous on tenk1
+ Index Cond: (thousand < 2)
+ Filter: (tenthous = ANY ('{1001,3000}'::integer[]))
+(4 rows)
SELECT thousand, tenthous FROM tenk1
WHERE thousand < 2 AND tenthous IN (1001,3000)
diff --git a/src/test/regress/sql/create_index.sql b/src/test/regress/sql/create_index.sql
index 21d66f8d41..c3cb9244b0 100644
--- a/src/test/regress/sql/create_index.sql
+++ b/src/test/regress/sql/create_index.sql
@@ -961,6 +961,7 @@ SELECT count(*) FROM dupindexcols
-- Check ordering of =ANY indexqual results (bug in 9.2.0)
--
+select pg_sleep(5); -- sleep for 5s to allow cluster monitor to advance OldestXmin
vacuum tenk1; -- ensure we get consistent plans here
explain (costs off)