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

Batching of statements for SELECT query #5952

Closed
darius-iko opened this issue Jul 1, 2016 · 3 comments
Closed

Batching of statements for SELECT query #5952

darius-iko opened this issue Jul 1, 2016 · 3 comments
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed.

Comments

@darius-iko
Copy link

darius-iko commented Jul 1, 2016

Hi,
The EF Core release has batch statements for insert update delete query for single roundtrip to DB in order to speed up app performance. Does it also apply for multiple SELECT or entities queries or combined query (e.g. INSERT, UPDATE and SELECT)?

Thank you.

@rowanmiller
Copy link
Contributor

This isn't something we would do, because it requires reading all the data from one result set before reading the next. With separate commands we can stream data from both results sets.

@rowanmiller rowanmiller added the closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. label Jul 6, 2016
@roji
Copy link
Member

roji commented Jul 6, 2016

@rowanmiller, note that reading one result set after the other makes a lot of sense in many scenarios - sometimes you just want the results of 2 unrelated queries in one roundtrip. At the very least this is supported at the ADO.NET level. Also, in non-MARS providers (such as Npgsql) there's no other alternative (i.e. you can't read both result sets at the same time).

I'm not saying EFCore should support this - I don't think it makes much sense for an O/RM and I haven't the slightest idea as to what the API would look like - just that the capability itself does make sense to me.

@divega
Copy link
Contributor

divega commented Jul 7, 2016

As @roji mentions we already serialize and buffer query execution when a single source query translates into multiple SELECT statements (e.g. with collection includes) and when MARS isn't available.

@anpete and I have talked about the possibility of generalizing that to other cases, including:

  • buffering when MARS would otherwise be needed for executing multiple queries
  • in a similar fashion to the NHibernate Futures feature (which supposedly has performance benefits I would like us to understand better).

I am not sure what the priority should be or if there is any fundamental reason for it not to work but on the surface it seems executing multiple SELECT statements in a batch could be possible (and potentially be useful) for some of the cases above.

@ajcvickers ajcvickers reopened this Aug 15, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Aug 15, 2022
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed.
Projects
None yet
Development

No branches or pull requests

5 participants