From 0b9db396ddbbe9dab6b4ef7b59b8cf46d3721954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Nordstr=C3=B6m?= Date: Fri, 18 Oct 2024 17:50:26 +0200 Subject: [PATCH] Fix flaky Hypercore join test The join test could sometimes pick a seqscan+sort instead of an indexscan when doing a MergeAppend+MergeJoin. Disabling seqscan should make it deterministic. --- tsl/test/expected/hypercore_join.out | 2 ++ tsl/test/sql/hypercore_join.sql | 2 ++ tsl/test/sql/include/hypercore_join_test.sql | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tsl/test/expected/hypercore_join.out b/tsl/test/expected/hypercore_join.out index 27b3456b2f6..9cf901eac22 100644 --- a/tsl/test/expected/hypercore_join.out +++ b/tsl/test/expected/hypercore_join.out @@ -108,6 +108,8 @@ select format('%I.%I', chunk_schema, chunk_name)::regclass as chunk2 -- We disable columnar scan for these tests since we have a dedicated -- test for this. set timescaledb.enable_columnarscan to false; +-- Discourage seqscan to make sure we predictibly use indexscan +set enable_seqscan to false; set enable_memoize to false; -- Create a hypercore with a few rows and use the big table to join -- with it. This should put the hypercore as the inner relation and diff --git a/tsl/test/sql/hypercore_join.sql b/tsl/test/sql/hypercore_join.sql index 27dafe8ad2a..0877e54207f 100644 --- a/tsl/test/sql/hypercore_join.sql +++ b/tsl/test/sql/hypercore_join.sql @@ -7,6 +7,8 @@ -- We disable columnar scan for these tests since we have a dedicated -- test for this. set timescaledb.enable_columnarscan to false; +-- Discourage seqscan to make sure we predictibly use indexscan +set enable_seqscan to false; set enable_memoize to false; diff --git a/tsl/test/sql/include/hypercore_join_test.sql b/tsl/test/sql/include/hypercore_join_test.sql index e74440e4d40..b469165f3ef 100644 --- a/tsl/test/sql/include/hypercore_join_test.sql +++ b/tsl/test/sql/include/hypercore_join_test.sql @@ -37,4 +37,3 @@ where r.device_id is distinct from e.device_id; drop table :inner; drop table :outer; -