-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Comments
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, 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. |
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:
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. |
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.
The text was updated successfully, but these errors were encountered: