You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Narrow the COPY text match to statement starts #27
#21 recognises a COPY from simple-protocol query text with \bcopy\b, so nothing is pipelined behind it. The word also matches in comments (-- copy), string literals ('Copy of report'), quoted identifiers ("copy") and dollar-quoted bodies. A false positive only stops pipelining behind that query, but a burst made entirely of such queries measured p50/p95/p99 of 724/1373/1429 ms against about 72/80/103 ms at max: 1 (190/350/380 against 31/76/80 at max: 4, 20 ms round trip).
Possible improvements:
Match copy only at a statement start: the beginning of the text, after ;, or after leading comments and whitespace. Still safe, since COPY to or from the client is always a top-level statement.
Also treat START_REPLICATION (CopyBoth) as a barrier, and make accepting() false while a COPY stream is open.
Since 4.4.0 sends savepoint statements through the simple protocol (#30), a savepoint name containing the word copy (for example sql.savepoint("my-copy", …)) also matches and sets the COPY barrier: statements behind it wait one round trip. Results stay correct. Narrowing the match to statement starts would cover it too.
Activity
okomarov commentedon Oct 11, 2026
Since 4.4.0 sends savepoint statements through the simple protocol (#30), a savepoint name containing the word copy (for example
sql.savepoint("my-copy", …)) also matches and sets the COPY barrier: statements behind it wait one round trip. Results stay correct. Narrowing the match to statement starts would cover it too.