Skip to content

Commit

Permalink
Merge pull request #54162 from yuzefovich/disable-ij
Browse files Browse the repository at this point in the history
release-20.2: sql: disable interleaved joins by default
  • Loading branch information
yuzefovich authored Sep 18, 2020
2 parents e9a5f76 + 2bf2938 commit 4ecea82
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/sql/exec_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,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

0 comments on commit 4ecea82

Please sign in to comment.