Re: Postgres refusing to use >1 core

From: "Pierre C" <lists(at)peufeu(dot)com>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Postgres refusing to use >1 core
Date: 2011-05-11 11:06:53
Message-ID: op.vvbc5r1ieorkce@apollo13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


> I suspect your app is doing lots of tiny single-row queries instead of
> efficiently batching things. It'll be wasting huge amounts of time
> waiting for results. Even if every query is individually incredibly
> fast, with the number of them you seem to be doing you'll lose a LOT of
> time if you loop over lots of little SELECTs.

Using unix sockets, you can expect about 10-20.000 queries/s on small
simple selects per core, which is quite a feat. TCP adds overhead, so it's
slower. Over a network, add ping time.

In plpgsql code, you avoid roundtrips, data serializing, and context
switches, it can be 2-4x faster.

But a big SQL query can process millions of rows/s, it is much more
efficient.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Prodan, Andrei 2011-05-11 11:08:44 'Interesting' prepared statement slowdown on large table join
Previous Message Scott Marlowe 2011-05-11 07:09:27 Re: help speeding up a query in postgres 8.4.5