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

Optimized translation for indexing of JSON primitive collections #30724

Closed
Tracked by #30731
roji opened this issue Apr 18, 2023 · 1 comment
Closed
Tracked by #30731

Optimized translation for indexing of JSON primitive collections #30724

roji opened this issue Apr 18, 2023 · 1 comment
Assignees
Labels
area-json area-primitive-collections area-query area-sqlite area-sqlserver blocked closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@roji
Copy link
Member

roji commented Apr 18, 2023

#30426 is adding the ability to query into JSON collections. Indexing (AKA ElementAt) is supported, but currently is translated to SQL subquery syntax; while this is the right thing for relational (will work on any provider), most databases have a specific syntax for indexing into a JSON array: SQLite has the ->> operator, while with SQL Server we should be able to use CROSS APPLY with OPENJSON.

@roji
Copy link
Member Author

roji commented Apr 25, 2023

Also, optimize JsonScalarExpression within OpenJson/json_each, so that instead of:

OpenJson(JSON_VALUE([t].[Owned], '$.Strings'))

We get:

OpenJson([t].[Owned], '$.Strings')

(see test Column_collection_inside_json_owned_entity)

roji added a commit to roji/efcore that referenced this issue Apr 25, 2023
@roji roji modified the milestones: Backlog, 8.0.0 Apr 25, 2023
roji added a commit to roji/efcore that referenced this issue Apr 25, 2023
roji added a commit to roji/efcore that referenced this issue Apr 26, 2023
roji added a commit to roji/efcore that referenced this issue Apr 26, 2023
Mostly completes dotnet#30724, except for full type inference is blocking on dotnet#30730.
@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 Apr 26, 2023
roji added a commit to roji/efcore that referenced this issue Apr 26, 2023
Mostly completes dotnet#30724, except for full type inference is blocking on dotnet#30730.
@roji roji added blocked and removed closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. labels Apr 26, 2023
roji added a commit to roji/efcore that referenced this issue Apr 26, 2023
Mostly completes dotnet#30724, except for full type inference is blocking on dotnet#30730.
roji added a commit to roji/efcore that referenced this issue Apr 26, 2023
Mostly completes dotnet#30724, except for full type inference is blocking on dotnet#30730.
roji added a commit to roji/efcore that referenced this issue Apr 26, 2023
Mostly completes dotnet#30724, except for full type inference is blocking on dotnet#30730.
roji added a commit to roji/efcore that referenced this issue Apr 27, 2023
Mostly completes dotnet#30724, except for full type inference is blocking on dotnet#30730.
ghost pushed a commit that referenced this issue Apr 27, 2023
Mostly completes #30724, except for full type inference is blocking on #30730.
@ajcvickers ajcvickers modified the milestones: 8.0.0, 8.0.0-preview7 Jul 20, 2023
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 20, 2023
@ajcvickers ajcvickers modified the milestones: 8.0.0-preview7, 8.0.0 Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-json area-primitive-collections area-query area-sqlite area-sqlserver blocked closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

No branches or pull requests

3 participants