Skip to content
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

Cosmos: Detect partition key filters in more queries #20350

Closed
AndriySvyryd opened this issue Mar 19, 2020 · 7 comments · Fixed by #34187
Closed

Cosmos: Detect partition key filters in more queries #20350

AndriySvyryd opened this issue Mar 19, 2020 · 7 comments · Fixed by #34187
Assignees
Labels
area-cosmos area-perf area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. punted-for-6.0 punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. type-enhancement
Milestone

Comments

@AndriySvyryd
Copy link
Member

Currently one needs to write the query like this to use a partition key:

var blogs = context.Blogs.WithPartitionKey("1337").ToList();

Instead we could automatically detect the partition key filter if used:

var blogs = context.Blogs.Where(b => b.PartitionKey == "1337").ToList();
@alexeymarkov
Copy link

Is it already included into EF Core 5.0 release?
I am going to use querying by partition key in HasQueryFilter and would like to know whether it will be properly translated into a single partition query by specifying the detected partition key value in QueryRequestOptions.

@braidenstiller
Copy link

Is it already included into EF Core 5.0 release?
I am going to use querying by partition key in HasQueryFilter and would like to know whether it will be properly translated into a single partition query by specifying the detected partition key value in QueryRequestOptions.

I am also interested in this outcome.

@AndriySvyryd
Copy link
Member Author

Is it already included into EF Core 5.0 release?

This issue is still open therefore it hasn't been implemented.
Use WithPartitionKey to get the expected query.

@1iveowl
Copy link
Contributor

1iveowl commented Nov 25, 2020

Is it already included into EF Core 5.0 release?

This issue is still open therefore it hasn't been implemented.
Use WithPartitionKey to get the expected query.

Are you certain? The PR was merged, as I recall.

@AndriySvyryd
Copy link
Member Author

AndriySvyryd commented Nov 25, 2020

Nevermind, it is in fact in 5.0, but in very limited fashion.

@AndriySvyryd
Copy link
Member Author

You can enable Debug logging to make sure your query is getting picked up correctly

@AndriySvyryd AndriySvyryd modified the milestones: Backlog, 5.0.0-preview4 Nov 25, 2020
@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Nov 25, 2020
@smitpatel smitpatel reopened this Nov 25, 2020
@smitpatel smitpatel removed this from the 5.0.0-preview4 milestone Nov 25, 2020
@smitpatel smitpatel removed the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Nov 25, 2020
@smitpatel smitpatel added this to the Backlog milestone Nov 25, 2020
@smitpatel
Copy link
Contributor

This is not fixed. The only place where PR identified this is for case of Find or query similar to dbset.Where(keypredicate).FirstOrDefault()

@AndriySvyryd AndriySvyryd changed the title Cosmos: Detect partition key filters in queries Cosmos: Detect partition key filters in more queries Nov 25, 2020
@ajcvickers ajcvickers modified the milestones: Backlog, 6.0.0 May 6, 2021
@ajcvickers ajcvickers added punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. and removed propose-punt labels Jul 7, 2022
@ajcvickers ajcvickers modified the milestones: 7.0.0, Backlog Jul 7, 2022
@smitpatel smitpatel removed their assignment Sep 14, 2022
@ajcvickers ajcvickers modified the milestones: Backlog, 9.0.0 May 8, 2024
@roji roji added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 6, 2024
roji added a commit to roji/efcore that referenced this issue Jul 8, 2024
roji added a commit to roji/efcore that referenced this issue Jul 8, 2024
roji added a commit to roji/efcore that referenced this issue Jul 8, 2024
roji added a commit to roji/efcore that referenced this issue Jul 8, 2024
roji added a commit to roji/efcore that referenced this issue Jul 8, 2024
roji added a commit to roji/efcore that referenced this issue Jul 8, 2024
@roji roji closed this as completed in 041f4f2 Jul 9, 2024
@ajcvickers ajcvickers modified the milestones: 9.0.0, 9.0.0-preview6, 9.0.0-preview7 Aug 21, 2024
@roji roji modified the milestones: 9.0.0-preview7, 9.0.0 Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-cosmos area-perf area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. punted-for-6.0 punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants