Skip to content

Conversation

roji
Copy link
Member

@roji roji commented May 26, 2023

This builds on top of #30956 (ignore first commit) to translate to IN+subquery where possible (see #30955).

Closes #30955

@roji roji requested a review from maumar May 26, 2023 10:25
// Null out the value for the inferred type mapping as an indication of the conflict. If it turns out that we need the
// inferred mapping later, during the application phase, we'll throw an exception at that point (not all the inferred type
// mappings here will actually be needed, so we don't want to needlessly throw here).
_inferredColumns[(underlyingTable, columnExpression.Name)] = null;
Copy link
Member Author

Choose a reason for hiding this comment

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

I moved the "conflicting inferred type mappings" exception to later in the process, so that we don't throw if we don't actually need the inferred mapping (i.e. it doesn't apply to an untyped inline/parameter collection). This should be safer.

@roji roji force-pushed the ContainsSubquery branch from d730b34 to 3ab02c1 Compare May 26, 2023 11:07
@roji
Copy link
Member Author

roji commented May 28, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@roji
Copy link
Member Author

roji commented May 29, 2023

Given the pretty massive perf impact this has (see #30955 (comment)), converting to a draft to consider using IN in more scenarios instead of rewriting to EXISTS (but this can still be reviewed already).

@roji roji marked this pull request as draft May 29, 2023 23:06
@roji roji marked this pull request as ready for review May 30, 2023 15:15
@roji roji force-pushed the ContainsSubquery branch from 16154d5 to 3be3805 Compare June 1, 2023 15:09
@roji roji requested a review from maumar June 1, 2023 15:44
@roji roji requested a review from maumar June 2, 2023 22:21
@roji roji force-pushed the ContainsSubquery branch from aeb0721 to c19c4d0 Compare June 2, 2023 22:43
@roji roji merged commit 4334ae0 into dotnet:main Jun 4, 2023
@roji roji deleted the ContainsSubquery branch June 4, 2023 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Translate Contains to IN with subquery instead of EXISTS where relevant
2 participants