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

piggyback split queries #4045

Closed
DickBaker opened this issue Sep 20, 2022 · 9 comments
Closed

piggyback split queries #4045

DickBaker opened this issue Sep 20, 2022 · 9 comments

Comments

@DickBaker
Copy link
Contributor

Docpage states "Each query currently implies an additional network roundtrip to your database." but surely this ain't necessarily so ? I supposethat current EF would batch the 1st & 2nd (i.e. split) query into a single TSQL request payload, so achieves a single round-trip [i.e. not needing MARS to multiplex the session, and EF also receives & digests both resultsets from a single tx from MSSQL/etc]

Document details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@roji
Copy link
Member

roji commented Sep 20, 2022

Duplicate of dotnet/efcore#10878

@roji roji marked this as a duplicate of dotnet/efcore#10878 Sep 20, 2022
@roji
Copy link
Member

roji commented Sep 20, 2022

Note that you still need MARS if you don't want to buffer the first resultset - that's orthogonal to batching.

@DickBaker
Copy link
Contributor Author

agreed "In some scenarios", but my beef was the docs emphatically state "implies an additional network roundtrip" which I think is outdated by your modern EF smarts. Again, leave in your capable hands to do/not & close. Thanks.

@DickBaker
Copy link
Contributor Author

Earlier I had raised another Issue about split queries, but can't find the Issue in my "Participating" filter [can't see how to show Closed, so maybe I never pushed the Submit button]. Anyway I am re-submitting Issue against that page, so please don't be cross if it dupes!

@DickBaker
Copy link
Contributor Author

please ignore the "Earlier I had .." comment as #4044 eventually surfaced (so I erased the #4046 dup)

@roji
Copy link
Member

roji commented Sep 20, 2022

No problem (and definitely not cross).

but my beef was the docs emphatically state "implies an additional network roundtrip" which I think is outdated by your modern EF smarts

What makes you think this? As far as I'm aware, split queries currently always sends the 2nd query as a separate roundtrip (assuming the 2nd query is sent at all). This is definitely something I'd like us to improve (that's dotnet/efcore#10878), but that's how it is today.

@DickBaker
Copy link
Contributor Author

oddly enough I still cannot see #4044 if I use either of these URLs
https://github.com/notifications?query=reason%3Aparticipating
https://github.com/notifications
but it shows up if I do the full
https://github.com/dotnet/EntityFramework.Docs/issues/

so I question the voracity of the filtering mechanism [unless issues are deliberately placed in a pending tray until one of you experts permits it to be moderated-in]. hmm!

@DickBaker
Copy link
Contributor Author

I thought I had read/seen one of the EF team introduce the batching of those 2 partial queries into a single trip, but I can't pinpoint it [maybe I just dreamed it?!] or it was a 3rd-party extension. Never mind, I bow to your superior knowledge and I certainly haven't profiled it to justify my claim. I simply thought the docs were outdated and were not crediting more recent EF smarts. But what do I know?!

@roji
Copy link
Member

roji commented Sep 20, 2022

@DickBaker it's pretty to test this out: you can just turn on logging and see whether there are two database commands or just one. It's a great way to play around with EF and see exactly what SQL it's generating and how it's executing it (e.g. when batching is in use).

Anyway, I'll go ahead and close this as a duplicate of dotnet/efcore#10878.

@roji roji closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants