-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
While users can execute multiple updates in a single ADO batch, no such feature currently exists for reading - each query is executed separately. For example, if a single web request requires multiple queries to fulfill (fairly typical case IMHO), then that many database roundtrips have to occur.
Reducing roundtrips can bring a very significant performance boost, so some sort of API which allows a user to defined multiple queries and have them executed together could be useful.
Note that there is a trade-off here: batching typically implies buffering the earlier query results, so the memory overhead is (potentially much) larger than executing different queries and streaming their results; if the results are small, batching makes sense, but if they're huge, multiple queries may make more sense.
The buffering overhead could mitigated by MARS, where supported. In other words, the user-defined "read batch" could actually execute multiple MARS queries (in one roundtrip, if supported), and allow the user to stream the results. Ideally, the user-facing "batching" API shouldn't expose this.
Note: this issue isn't about using batching in internally-generated queries (that's what #10878 is about).