Re: pgbench: option delaying queries till connections establishment?

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org
Date: 2020-03-01T21:16:06Z
Lists: pgsql-hackers

Attachments

Hello Andres,

> FWIW, leaving windows, error handling, and other annoyances aside, this
> can be implemented fairly simply. See below.

Attached an attempt at improving things.

I've put 2 barriers: one so that all threads are up, one when all 
connections are setup and the bench is ready to go.

I've done a blind attempt at implementing the barrier stuff on windows.

I've changed the performance calculations depending on -C or not. Ramp-up 
effects are smoothed.

I've merged all time-related stuff (time_t, instr_time, int64) to use a 
unique type (pg_time_usec_t) and set of functions/macros, which simplifies 
the code somehow.

I've tried to do some variable renaming to distinguish timestamps and 
intervals.

This is work in progress.

-- 
Fabien.

Commits

  1. Fix new pthread code to respect --disable-thread-safety.

  2. Add missing pthread_barrier_t.

  3. pgbench: Improve time logic.

  4. pgbench: Refactor thread portability support.

  5. pgbench: Synchronize client threads.

  6. Fix bogus logic for skipping unnecessary partcollation dependencies.