Skip to content

Add flag in SQL to disable left base filter optimization for joins#10947

Merged
maytasm merged 7 commits intoapache:masterfrom
abhishekagarwal87:left_filter_feature_flag
Mar 9, 2021
Merged

Add flag in SQL to disable left base filter optimization for joins#10947
maytasm merged 7 commits intoapache:masterfrom
abhishekagarwal87:left_filter_feature_flag

Conversation

@abhishekagarwal87
Copy link
Copy Markdown
Contributor

@abhishekagarwal87 abhishekagarwal87 commented Mar 5, 2021

Follow up on #10697 where we added an optimization to push joins to historicals when left child is a scan with a filter. However, the change could actually underperform depending on the kind of query. This PR introduces a flag to switch between two behaviors. Default value of this flag is false.

Also fixed a bug pointed out by @gianm - https://github.com/apache/druid/pull/10697/files#r587924983

// This flag control whether a sql join query with left scan should be attempted to be run as direct table access
// instead of being wrapped inside a query. With direct table access enabled, druid can push down the join operation to
// data servers.
public static final String SQL_JOIN_LEFT_SCAN_DIRECT = "enableSQLLeftTableScanDirect";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should maybe be enableJoinLeftTableScanDirect to be more consistent with other join related query context parameters. I also think it should probably be documented, but none of the other join query context parameters are documented (not sure why), so not sure its a blocker for this PR.

@abhishekagarwal87
Copy link
Copy Markdown
Contributor Author

k8s integration test failed which is unrelated to changes in this PR.

@maytasm maytasm merged commit c66951a into apache:master Mar 9, 2021
@clintropolis clintropolis added this to the 0.22.0 milestone Aug 12, 2021
kgyrtkirk added a commit to kgyrtkirk/druid that referenced this pull request Dec 11, 2023
Relates to apache#10947

Some note about disabling it was added [here](https://github.com/apache/druid/pull/10947/files#diff-39158f6b501cd2bcc925a57cbe8d07affbeaa683e33b3ec3f533cde8d8249094R62)
> Please note that the flag could be applicable to queries even if there is no explicit join. since queries can internally translated into a join by the SQL planner.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants