pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Manfred Koizar <mkoi-pg@aon.at>
To: Christopher Browne <cbbrowne@acm.org>
Cc: pgsql-performance@postgresql.org, Joseph Bove <jbove@vetstar.com>
Subject: Re: Inconsistent performance
Date: Tue, 16 Sep 2003 09:09:05 +0200
Message-ID: <nbcdmv09dtu6go0k1nnncngmkfp40fc6bv@email.aon.at> (raw)
In-Reply-To: <m38yoptqmy.fsf@wolfe.cbbrowne.com>
References: <5.1.0.14.2.20030915182422.00a8a2d8@mail.vetstar.com>
	<m38yoptqmy.fsf@wolfe.cbbrowne.com>

On Mon, 15 Sep 2003 22:26:45 -0400, Christopher Browne
<cbbrowne@acm.org> wrote:
>> select count (*) from table;
>The only possible plan for THAT query will involve a seq scan of the
>whole table.  If the postmaster already has the data in cache, it
>makes sense for it to run in 1 second.  If it has to read it from
>disk, 12 seconds makes a lot of sense.

Yes.  And note that the main difference is between having the data in
memory and having to fetch it from disk.  I don't believe that this
difference can be explained by 9000 read calls hitting the operating
system's cache.

>You might want to increase the "shared_buffers" parameter in
>postgresql.conf; that should lead to increased stability of times as
>it should be more likely that the data in "table" will remain in
>cache.

Let's not jump to this conclusion before we know what's going on.

Joseph Bove <jbove@vetstar.com> wrote in another message above:
| I did have shared_buffers and sort_mem both set higher originally (15000, 
| 32168)

As I read this I think he meant "... and had the same performance
problem."

Joseph, what do you get, if you run that
	 EXPLAIN ANALYSE SELECT count(*) ...
several times?  What do vmstat and top show while the query is
running?  Are there other processes active during or between the runs?
What kind of processes?  Postgres backends?  Web server? ...

Servus
 Manfred



view thread (16+ messages)  latest in thread

Message-ID: <nbcdmv09dtu6go0k1nnncngmkfp40fc6bv@email.aon.at>
Permalink:  ../nbcdmv09dtu6go0k1nnncngmkfp40fc6bv@email.aon.at/
Also on:    postgresql.org/message-id/nbcdmv09dtu6go0k1nnncngmkfp40fc6bv@email.aon.at

 · 

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: mkoi-pg@aon.at, cbbrowne@acm.org, jbove@vetstar.com
  Subject: Re: Inconsistent performance
  In-Reply-To: <nbcdmv09dtu6go0k1nnncngmkfp40fc6bv@email.aon.at>
  References: <5.1.0.14.2.20030915182422.00a8a2d8@mail.vetstar.com> <m38yoptqmy.fsf@wolfe.cbbrowne.com> <nbcdmv09dtu6go0k1nnncngmkfp40fc6bv@email.aon.at>

* 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