public inbox for [email protected]  
help / color / mirror / Atom feed
From: Alvaro Herrera <[email protected]>
To: Yugo NAGATA <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Fabien COELHO <[email protected]>
Cc: [email protected]
Subject: Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error
Date: Mon, 6 Feb 2023 11:11:32 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

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)






view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: pgbench: using prepared BEGIN statement in a pipeline could cause an error
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox