pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: Craig Ringer <craig@postnewspapers.com.au>
Cc: Aren Cambre <aren@arencambre.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Postgres refusing to use >1 core
Date: Tue, 10 May 2011 22:26:57 -0600
Message-ID: <BANLkTi=PxROPQFDt1a6N68e_+5_AojagmA@mail.gmail.com> (raw)
In-Reply-To: <4DC9E7C5.9080309@postnewspapers.com.au>
References: <BANLkTimohiUa6rOYdxYTwqmvSUg2CRYMHg@mail.gmail.com>
	<4DC81A3F020000250003D433@gw.wicourts.gov>
	<BANLkTimNTLqQgQeyu=FPOn-5x6F4XnVBJA@mail.gmail.com>
	<4DC81D56020000250003D438@gw.wicourts.gov>
	<BANLkTi=FH4rX-7OtS9ozjuyXQTNTiRqCmg@mail.gmail.com>
	<BANLkTinwkj7syvKkYzU_O7DD14EMzk2Zmg@mail.gmail.com>
	<BANLkTi=BvGMvsBNq8DUt=_MPJXZjcC0TWg@mail.gmail.com>
	<4DC8B893.3060908@postnewspapers.com.au>
	<BANLkTimi+2nviLvWU4zKGtG688+Z84DF6w@mail.gmail.com>
	<4DC9E7C5.9080309@postnewspapers.com.au>

On Tue, May 10, 2011 at 7:35 PM, Craig Ringer
<craig@postnewspapers.com.au> wrote:
> On 11/05/11 05:34, Aren Cambre wrote:
>
>> Using one thread, the app can do about 111 rows per second, and it's
>> only exercising 1.5 of 8 CPU cores while doing this. 12,000,000 rows /
>> 111 rows per second ~= 30 hours.
>
> I don't know how I missed that. You ARE maxing out one cpu core, so
> you're quite right that you need more threads unless you can make your
> single worker more efficient.
>
> Why not just spawn more copies of your program and have them work on
> ranges of the data, though? Might that not be simpler than juggling
> threading schemes?

I suggested that earlier.  But now I'm wondering if there's
efficiencies to be gained by moving all the heavy lifting to the db as
well as splitting thiings into multiple partitions to work on.  I.e.
don't grab 1,000 rows and work on them on the client side and then
insert data, do the data mangling in the query in the database.  My
experience has been that moving things like this into the database can
result in performance gains of several factors, taking hour long
processes and making them run in minutes.



view thread (46+ messages)  latest in thread

Message-ID: <BANLkTi=PxROPQFDt1a6N68e_+5_AojagmA@mail.gmail.com>
Permalink:  ../BANLkTi=PxROPQFDt1a6N68e_+5_AojagmA@mail.gmail.com/
Also on:    postgresql.org/message-id/BANLkTi=PxROPQFDt1a6N68e_+5_AojagmA@mail.gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: scott.marlowe@gmail.com, craig@postnewspapers.com.au, aren@arencambre.com
  Subject: Re: Postgres refusing to use >1 core
  In-Reply-To: <BANLkTi=PxROPQFDt1a6N68e_+5_AojagmA@mail.gmail.com>
  References: <BANLkTimohiUa6rOYdxYTwqmvSUg2CRYMHg@mail.gmail.com> <4DC81A3F020000250003D433@gw.wicourts.gov> <BANLkTimNTLqQgQeyu=FPOn-5x6F4XnVBJA@mail.gmail.com> <4DC81D56020000250003D438@gw.wicourts.gov> <BANLkTi=FH4rX-7OtS9ozjuyXQTNTiRqCmg@mail.gmail.com> <BANLkTinwkj7syvKkYzU_O7DD14EMzk2Zmg@mail.gmail.com> <BANLkTi=BvGMvsBNq8DUt=_MPJXZjcC0TWg@mail.gmail.com> <4DC8B893.3060908@postnewspapers.com.au> <BANLkTimi+2nviLvWU4zKGtG688+Z84DF6w@mail.gmail.com> <4DC9E7C5.9080309@postnewspapers.com.au> <BANLkTi=PxROPQFDt1a6N68e_+5_AojagmA@mail.gmail.com>

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

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