Skip to content

Add backward compatibility option that disables joins transformation #7910

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

Merged
merged 1 commit into from
Dec 8, 2023
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
6 changes: 5 additions & 1 deletion src/common/config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ enum ConfigKey
KEY_PARALLEL_WORKERS,
KEY_MAX_PARALLEL_WORKERS,
KEY_OPTIMIZE_FOR_FIRST_ROWS,
KEY_OUTER_JOIN_CONVERSION,
MAX_CONFIG_KEY // keep it last
};

Expand Down Expand Up @@ -310,7 +311,8 @@ constexpr ConfigEntry entries[MAX_CONFIG_KEY] =
{TYPE_INTEGER, "MaxStatementCacheSize", false, 2 * 1048576}, // bytes
{TYPE_INTEGER, "ParallelWorkers", true, 1},
{TYPE_INTEGER, "MaxParallelWorkers", true, 1},
{TYPE_BOOLEAN, "OptimizeForFirstRows", false, false}
{TYPE_BOOLEAN, "OptimizeForFirstRows", false, false},
{TYPE_BOOLEAN, "OuterJoinConversion", false, true}
};


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

CONFIG_GET_PER_DB_BOOL(getOptimizeForFirstRows, KEY_OPTIMIZE_FOR_FIRST_ROWS);

CONFIG_GET_PER_DB_BOOL(getOuterJoinConversion, KEY_OUTER_JOIN_CONVERSION);
};

// Implementation of interface to access master configuration file
Expand Down
4 changes: 3 additions & 1 deletion src/jrd/RecordSourceNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2888,7 +2888,9 @@ RseNode* RseNode::pass1(thread_db* tdbb, CompilerScratch* csb)
void RseNode::pass1Source(thread_db* tdbb, CompilerScratch* csb, RseNode* rse,
BoolExprNode** boolean, RecordSourceNodeStack& stack)
{
if (rse_jointype != blr_inner)
const auto dbb = tdbb->getDatabase();

if (rse_jointype != blr_inner && dbb->dbb_config->getOuterJoinConversion())
{
// Check whether any of the upper level booleans (those belonging to the WHERE clause)
// is able to filter out rows from the "inner" streams. If this is the case,
Expand Down