Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Yugo NAGATA <nagata@sraoss.co.jp>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Fabien COELHO <coelho@cri.ensmp.fr>, pgsql-hackers@postgresql.org
Date: 2023-02-06T10:11:32Z
Lists: pgsql-hackers
I'm writing my own patch for this problem. While playing around with
it, I noticed this:
struct Command {
PQExpBufferData lines; /* 0 24 */
char * first_line; /* 24 8 */
int type; /* 32 4 */
MetaCommand meta; /* 36 4 */
int argc; /* 40 4 */
/* XXX 4 bytes hole, try to pack */
char * argv[256]; /* 48 2048 */
/* --- cacheline 32 boundary (2048 bytes) was 48 bytes ago --- */
char * varprefix; /* 2096 8 */
PgBenchExpr * expr; /* 2104 8 */
/* --- cacheline 33 boundary (2112 bytes) --- */
SimpleStats stats; /* 2112 40 */
int64 retries; /* 2152 8 */
int64 failures; /* 2160 8 */
/* size: 2168, cachelines: 34, members: 11 */
/* sum members: 2164, holes: 1, sum holes: 4 */
/* last cacheline: 56 bytes */
};
Not great. I suppose this makes pgbench slower than it needs to be.
Can we do better?
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Nunca se desea ardientemente lo que solo se desea por razón" (F. Alexandre)
Commits
-
Fix pgbench in prepared mode with an empty pipeline
- 8f5e42d33469 16.0 landed
- 34f51196573c 15.4 landed
-
pgbench: Prepare commands in pipelines in advance
- 663e50e83211 14.8 landed
- 108a22bd14d4 15.3 landed
- 038f586d5f1d 16.0 landed
-
Add -M (query mode) option per ITAGAKI Takahiro
- 49639a7b2c52 8.4.0 cited