Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-20.2: sql: disable interleaved joins by default #54162

Merged
merged 1 commit into from
Sep 18, 2020
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 pkg/sql/exec_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ var insertFastPathClusterMode = settings.RegisterBoolSetting(
var planInterleavedJoins = settings.RegisterBoolSetting(
"sql.distsql.interleaved_joins.enabled",
"if set we plan interleaved table joins instead of merge joins when possible",
true,
false,
)
var experimentalAlterColumnTypeGeneralMode = settings.RegisterBoolSetting(
"sql.defaults.experimental_alter_column_type.enabled",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
statement ok
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false

statement ok
SET enable_interleaved_joins = true

#################
# Create tables #
#################
Expand Down
3 changes: 3 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/interleaved_join
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
# - no interleaved relationship (parent1 - parent2, parent2 - child1)
# - TODO(richardwu): sibling-sibling (child1 - child2)

statement ok
SET enable_interleaved_joins = true

#################
# Create tables #
#################
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/logictest/testdata/logic_test/pg_catalog
Original file line number Diff line number Diff line change
Expand Up @@ -1830,7 +1830,7 @@ distsql off NULL NUL
enable_experimental_alter_column_type_general off NULL NULL NULL string
enable_implicit_select_for_update on NULL NULL NULL string
enable_insert_fast_path on NULL NULL NULL string
enable_interleaved_joins on NULL NULL NULL string
enable_interleaved_joins off NULL NULL NULL string
enable_seqscan on NULL NULL NULL string
enable_zigzag_join on NULL NULL NULL string
experimental_distsql_planning off NULL NULL NULL string
Expand Down Expand Up @@ -1901,7 +1901,7 @@ distsql off NULL user
enable_experimental_alter_column_type_general off NULL user NULL off off
enable_implicit_select_for_update on NULL user NULL on on
enable_insert_fast_path on NULL user NULL on on
enable_interleaved_joins on NULL user NULL on on
enable_interleaved_joins off NULL user NULL off off
enable_seqscan on NULL user NULL on on
enable_zigzag_join on NULL user NULL on on
experimental_distsql_planning off NULL user NULL off off
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
# when possible. This is true even with interleaved scans, which complicate the
# logic of mapping a WriteIntentError back to the corresponding table.

# Note that we're changing the cluster setting instead of a session variable
# to enable the interleaved joins because we're switching the users below with
# each switch starting a new session.
statement ok
SET CLUSTER SETTING sql.distsql.interleaved_joins.enabled = true

statement ok
CREATE TABLE p2 (i INT PRIMARY KEY, s STRING)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/show_source
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ distsql off
enable_experimental_alter_column_type_general off
enable_implicit_select_for_update on
enable_insert_fast_path on
enable_interleaved_joins on
enable_interleaved_joins off
enable_seqscan on
enable_zigzag_join on
experimental_distsql_planning off
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
# - no interleaved relationship (parent1 - parent2, parent2 - child1)
# - TODO(richardwu): sibling-sibling (child1 - child2)

statement ok
SET enable_interleaved_joins = true

#################
# Create tables #
#################
Expand Down
3 changes: 3 additions & 0 deletions pkg/sql/opt/exec/execbuilder/testdata/interleaved
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# LogicTest: local

statement ok
SET enable_interleaved_joins = true

# ------------------------------------------------------------------------------
# Test index selection for deeply interleaved tables.
# These tests are in their own file because table IDs appear in EXPLAIN output.
Expand Down