From 12c2d2d08a09026f76fa623a597d8b616d612ac1 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@enterprisedb.com>
Date: Thu, 30 Nov 2017 23:34:09 +1300
Subject: [PATCH] Temporarily remove unstable hash join regression tests.

Commit fa330f9adf4e83c0707b0b1164e7bf09c9204b3d added a suite of regression
tests for hash joins that rely on information extracted from EXPLAIN ANALYZE
output.  In some scenarios on a heavily loaded machine EXPLAIN may fail to
report hash join batching information from a parallel query.  Until EXPLAIN
is fixed, comment out the problem tests.

Author: Thomas Munro
Discussion: https://www.postgresql.org/message-id/CAEepm%3D3DUQC2-z252N55eOcZBer6DPdM%3DFzrxH9dZc5vYLsjaA%40mail.gmail.com
---
 src/test/regress/expected/join.out | 58 +++++++++++++-------------------------
 src/test/regress/sql/join.sql      | 38 ++++++++++++-------------
 2 files changed, 38 insertions(+), 58 deletions(-)

diff --git a/src/test/regress/expected/join.out b/src/test/regress/expected/join.out
index b7d17900978..df2c033531f 100644
--- a/src/test/regress/expected/join.out
+++ b/src/test/regress/expected/join.out
@@ -5945,16 +5945,11 @@ select count(*) from simple r join simple s using (id);
  20000
 (1 row)
 
-select original > 1 as initially_multibatch, final > original as increased_batches
-  from hash_join_batches(
-$$
-  select count(*) from simple r join simple s using (id);
-$$);
- initially_multibatch | increased_batches 
-----------------------+-------------------
- f                    | f
-(1 row)
-
+--select original > 1 as initially_multibatch, final > original as increased_batches
+--  from hash_join_batches(
+--$$
+--  select count(*) from simple r join simple s using (id);
+--$$);
 rollback to settings;
 -- The "good" case: batches required, but we plan the right number; we
 -- plan for some number of batches, and we stick to that number, and
@@ -6017,16 +6012,11 @@ select count(*) from simple r join simple s using (id);
  20000
 (1 row)
 
-select original > 1 as initially_multibatch, final > original as increased_batches
-  from hash_join_batches(
-$$
-  select count(*) from simple r join simple s using (id);
-$$);
- initially_multibatch | increased_batches 
-----------------------+-------------------
- t                    | f
-(1 row)
-
+--select original > 1 as initially_multibatch, final > original as increased_batches
+--  from hash_join_batches(
+--$$
+--  select count(*) from simple r join simple s using (id);
+--$$);
 rollback to settings;
 -- The "bad" case: during execution we need to increase number of
 -- batches; in this case we plan for 1 batch, and increase at least a
@@ -6090,16 +6080,11 @@ select count(*) from simple r join bigger_than_it_looks s using (id);
  20000
 (1 row)
 
-select original > 1 as initially_multibatch, final > original as increased_batches
-  from hash_join_batches(
-$$
-  select count(*) from simple r join bigger_than_it_looks s using (id);
-$$);
- initially_multibatch | increased_batches 
-----------------------+-------------------
- f                    | t
-(1 row)
-
+--select original > 1 as initially_multibatch, final > original as increased_batches
+--  from hash_join_batches(
+--$$
+--  select count(*) from simple r join bigger_than_it_looks s using (id);
+--$$);
 rollback to settings;
 -- The "ugly" case: increasing the number of batches during execution
 -- doesn't help, so stop trying to fit in work_mem and hope for the
@@ -6162,15 +6147,10 @@ select count(*) from simple r join extremely_skewed s using (id);
  20000
 (1 row)
 
-select * from hash_join_batches(
-$$
-  select count(*) from simple r join extremely_skewed s using (id);
-$$);
- original | final 
-----------+-------
-        1 |     2
-(1 row)
-
+--select * from hash_join_batches(
+--$$
+--  select count(*) from simple r join extremely_skewed s using (id);
+--$$);
 rollback to settings;
 -- A couple of other hash join tests unrelated to work_mem management.
 -- A full outer join where every record is matched.
diff --git a/src/test/regress/sql/join.sql b/src/test/regress/sql/join.sql
index c6d4a513e86..ae091030c86 100644
--- a/src/test/regress/sql/join.sql
+++ b/src/test/regress/sql/join.sql
@@ -2053,11 +2053,11 @@ set local work_mem = '4MB';
 explain (costs off)
   select count(*) from simple r join simple s using (id);
 select count(*) from simple r join simple s using (id);
-select original > 1 as initially_multibatch, final > original as increased_batches
-  from hash_join_batches(
-$$
-  select count(*) from simple r join simple s using (id);
-$$);
+--select original > 1 as initially_multibatch, final > original as increased_batches
+--  from hash_join_batches(
+--$$
+--  select count(*) from simple r join simple s using (id);
+--$$);
 rollback to settings;
 
 -- The "good" case: batches required, but we plan the right number; we
@@ -2085,11 +2085,11 @@ set local work_mem = '128kB';
 explain (costs off)
   select count(*) from simple r join simple s using (id);
 select count(*) from simple r join simple s using (id);
-select original > 1 as initially_multibatch, final > original as increased_batches
-  from hash_join_batches(
-$$
-  select count(*) from simple r join simple s using (id);
-$$);
+--select original > 1 as initially_multibatch, final > original as increased_batches
+--  from hash_join_batches(
+--$$
+--  select count(*) from simple r join simple s using (id);
+--$$);
 rollback to settings;
 
 -- The "bad" case: during execution we need to increase number of
@@ -2118,11 +2118,11 @@ set local work_mem = '128kB';
 explain (costs off)
   select count(*) from simple r join bigger_than_it_looks s using (id);
 select count(*) from simple r join bigger_than_it_looks s using (id);
-select original > 1 as initially_multibatch, final > original as increased_batches
-  from hash_join_batches(
-$$
-  select count(*) from simple r join bigger_than_it_looks s using (id);
-$$);
+--select original > 1 as initially_multibatch, final > original as increased_batches
+--  from hash_join_batches(
+--$$
+--  select count(*) from simple r join bigger_than_it_looks s using (id);
+--$$);
 rollback to settings;
 
 -- The "ugly" case: increasing the number of batches during execution
@@ -2151,10 +2151,10 @@ set local work_mem = '128kB';
 explain (costs off)
   select count(*) from simple r join extremely_skewed s using (id);
 select count(*) from simple r join extremely_skewed s using (id);
-select * from hash_join_batches(
-$$
-  select count(*) from simple r join extremely_skewed s using (id);
-$$);
+--select * from hash_join_batches(
+--$$
+--  select count(*) from simple r join extremely_skewed s using (id);
+--$$);
 rollback to settings;
 
 -- A couple of other hash join tests unrelated to work_mem management.
-- 
2.15.0

