Skip to content

Commit c481b4c

Browse files
authored
Add backward compatibility option that disables joins transformation (#7910)
1 parent c17c8ce commit c481b4c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/common/config/config.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ enum ConfigKey
192192
KEY_PARALLEL_WORKERS,
193193
KEY_MAX_PARALLEL_WORKERS,
194194
KEY_OPTIMIZE_FOR_FIRST_ROWS,
195+
KEY_OUTER_JOIN_CONVERSION,
195196
MAX_CONFIG_KEY // keep it last
196197
};
197198

@@ -310,7 +311,8 @@ constexpr ConfigEntry entries[MAX_CONFIG_KEY] =
310311
{TYPE_INTEGER, "MaxStatementCacheSize", false, 2 * 1048576}, // bytes
311312
{TYPE_INTEGER, "ParallelWorkers", true, 1},
312313
{TYPE_INTEGER, "MaxParallelWorkers", true, 1},
313-
{TYPE_BOOLEAN, "OptimizeForFirstRows", false, false}
314+
{TYPE_BOOLEAN, "OptimizeForFirstRows", false, false},
315+
{TYPE_BOOLEAN, "OuterJoinConversion", false, true}
314316
};
315317

316318

@@ -638,6 +640,8 @@ class Config : public RefCounted, public GlobalStorage
638640
CONFIG_GET_GLOBAL_INT(getMaxParallelWorkers, KEY_MAX_PARALLEL_WORKERS);
639641

640642
CONFIG_GET_PER_DB_BOOL(getOptimizeForFirstRows, KEY_OPTIMIZE_FOR_FIRST_ROWS);
643+
644+
CONFIG_GET_PER_DB_BOOL(getOuterJoinConversion, KEY_OUTER_JOIN_CONVERSION);
641645
};
642646

643647
// Implementation of interface to access master configuration file

src/jrd/RecordSourceNodes.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2888,7 +2888,9 @@ RseNode* RseNode::pass1(thread_db* tdbb, CompilerScratch* csb)
28882888
void RseNode::pass1Source(thread_db* tdbb, CompilerScratch* csb, RseNode* rse,
28892889
BoolExprNode** boolean, RecordSourceNodeStack& stack)
28902890
{
2891-
if (rse_jointype != blr_inner)
2891+
const auto dbb = tdbb->getDatabase();
2892+
2893+
if (rse_jointype != blr_inner && dbb->dbb_config->getOuterJoinConversion())
28922894
{
28932895
// Check whether any of the upper level booleans (those belonging to the WHERE clause)
28942896
// is able to filter out rows from the "inner" streams. If this is the case,

0 commit comments

Comments
 (0)