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

Better execution plans #43

Open
yv989c opened this issue Jan 4, 2024 · 3 comments
Open

Better execution plans #43

yv989c opened this issue Jan 4, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@yv989c
Copy link
Owner

yv989c commented Jan 4, 2024

It has caught my attention that the use of the OPENJSON function is causing performance regressions in EF8, as reported in dotnet/efcore#32394. This seems to be caused by the opaque nature of the function to the query engine, which could result in suboptimal execution plans.

QueryableValues currently depends on both OPENJSON and XML methods for functionality, and thus, it is impacted to some degree by these issues.

Here are some potential solutions to address this problem:

  • For large collections, project the deserialized values to a temp table and use the temp table instead. This should enable statistics, which in turn should generate optimal execution plans. However, it may cause execution plan re-compilations and result in higher latency.
  • For small collections, avoid the use of deserialization functions and instead switch to a multi-parameter approach. This approach should generate optimal execution plans and maintain low latency.

These two approaches aim to provide the query engine with sufficient information to generate optimal execution plans, which is a priority. Consequently, this behavior should be enabled by default, with an option for users to opt out if desired.

@yv989c yv989c added the enhancement New feature or request label Jan 4, 2024
@yv989c yv989c added this to the v1.4.0 milestone Jan 4, 2024
@yv989c yv989c self-assigned this Feb 5, 2024
@nilzzzzzz
Copy link

Hi @yv989c ,

thanks for building this awesome library. The described improvement would help us a lot, any plans to work on this issue in the next time?

Best

Nils

@yv989c
Copy link
Owner Author

yv989c commented Aug 18, 2024

Hi @yv989c ,

thanks for building this awesome library. The described improvement would help us a lot, any plans to work on this issue in the next time?

Best

Nils

Hi @nilzzzzzz,

First, thanks for the kind words.

Just an update on this: Yes, I've invested a lot of time working on this with good results, but I decided to pause to see how the EF team would address it. It seems clear now that they won't be providing the level of integration I've developed to make this work well with SQL Server. That said, if I release this, it will likely be under a different license model. Unfortunately, it’s not sustainable for me to continue putting this level of effort out there completely for free.

@nilzzzzzz
Copy link

Hi @yv989c ,

this sounds reasonable to me and thank you for your feedback. If the licence model fees work with our business model, we are happy to support you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants