Re: PATCH: pgbench - merging transaction logs - Mailing list pgsql-hackers

From Robert Haas
Subject Re: PATCH: pgbench - merging transaction logs
Date
Msg-id CA+TgmoZAuB+ZfMhS-LSjqsyv=gA7kBjADWf_A34cUeVTrNUmVA@mail.gmail.com
Whole thread Raw
In response to Re: PATCH: pgbench - merging transaction logs  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: PATCH: pgbench - merging transaction logs  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers
On Sun, Mar 15, 2015 at 3:35 PM, Fabien COELHO <coelho@cri.ensmp.fr> wrote:
>> Firstly, the fact that pgbench produces one file per thread is awkward.
>
> I agree, but I think it is due to the multi process thread emulation: if you
> have real threads, you can do a simple fprintf, possibly with some mutex,
> and you're done. There is really nothing to do to implement this
> feature.

I think that's probably not a good idea, because fprintf() might then
become a bottleneck.  I fixed a similar problem with random() in
commit 4af43ee3f165c8e4b332a7e680a44f4b7ba2d3c1.  Even though the
locking was happening inside libc, it was still locking, and it still
caused a contention problem.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: assessing parallel-safety
Next
From: Kouhei Kaigai
Date:
Subject: Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)