-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
experiment: use pipeline mode #2707
base: main
Are you sure you want to change the base?
Conversation
Some performance results, using
Regarding the results:
|
The library changes:
The |
Very cool! |
src/PostgREST/Query.hs
Outdated
usePipeline :: Bool | ||
usePipeline = True | ||
|
||
queuePipelineStatement :: params -> SQL.Statement params () -> SQL.Transaction () | ||
queuePipelineStatement params stmt = | ||
if usePipeline then SQL.inTransaction $ Session.queuePipelineStatement params stmt | ||
else SQL.statement params stmt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So awesome that is such a small change.
the implementation seems mostly correct, but error handling is at least a bit broken (we don't treat aborted pipelines quite right), and there's a decent chance that some failure scenarios actually mess up the connection state, though I haven't seen that
So since there could be some unknown unknowns(pipeline mode also new to me), I think we should make this configurable. Name could be db-pipeline-mode
. True by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, the large change is in hasql
. And I don't think it's a particularly sensible implementation there API-wise so far.
But yes gating this by a configuration option makes sense.
Just FYI, I'm leaving the pgbench pipeline test on steve-chavez@682930d. |
This pulls in an exploratory implementation of pipeline mode (#2295). The bulk of the change is in the supporting libraries:
Some notes as to the state of this: