Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfa604e0

Browse files
committed
pgbench: When using pipelining only do PQconsumeInput() when necessary.
Up to now we did a PQconsumeInput() for each pipelined query, asking the OSfor more input - which it often won't have, as all results might already havebeen sent. That turns out to have a noticeable performance impact.Alvaro Herrera reviewed the idea to add the PQisBusy() check, but not thisconcrete patch.Author: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/20210720180039.23rivhdft3l4mayn@alap3.anarazel.deBackpatch: 14, where libpq/pgbench pipelining was introduced.
1 parente8086bd commitfa604e0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/bin/pgbench/pgbench.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3460,7 +3460,14 @@ advanceConnectionState(TState *thread, CState *st, StatsData *agg)
34603460
*/
34613461
caseCSTATE_WAIT_RESULT:
34623462
pg_log_debug("client %d receiving",st->id);
3463-
if (!PQconsumeInput(st->con))
3463+
3464+
/*
3465+
* Only check for new network data if we processed all data
3466+
* fetched prior. Otherwise we end up doing a syscall for each
3467+
* individual pipelined query, which has a measurable
3468+
* performance impact.
3469+
*/
3470+
if (PQisBusy(st->con)&& !PQconsumeInput(st->con))
34643471
{
34653472
/* there's something wrong */
34663473
commandFailed(st,"SQL","perhaps the backend died while processing");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp