pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bob Smith <bsmith@h-e.com>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Performance question
Date: Wed, 5 Mar 2003 10:11:17 -0800
Message-ID: <DBDDE26F-4F35-11D7-896A-0003933DD370@h-e.com> (raw)


When I execute a query on a new connection, the performance is many 
times slower than if the query is repeated.  In other words, if I start 
psql, execute the query, then repeat it immediately, the second time it 
takes only about 20% as long to execute.  Now here's the confusing 
part, if I exit psql then start it up again, the same thing will occur 
on the new connection as well, the first execution takes 5x as long 
again.  I don't understand this, it would make sense to me that the 
second execution being faster is due to disk caching on the server, but 
then why is it slower again on every new connection?  Disk caching 
should benefit all current and new connections until the cache is 
flushed, which on this server shouldn't happen for a long time, the 
load is light and it has lots of RAM.  Is Postgres doing some kind of 
caching itself that lasts only for the life of one backend process?  If 
so, is there any way to make this caching persistent across backends?

Server particulars:

Postgres 7.2.1, Mac OS X Server 10.1.5, dual 1GHz CPUs, 1.5GB memory

Thanks!

Bob Smith
Hammett & Edison, Inc.
bsmith@h-e.com




view thread (21+ messages)  latest in thread

Message-ID: <DBDDE26F-4F35-11D7-896A-0003933DD370@h-e.com>
Permalink:  ../DBDDE26F-4F35-11D7-896A-0003933DD370@h-e.com/
Also on:    postgresql.org/message-id/DBDDE26F-4F35-11D7-896A-0003933DD370@h-e.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-admin@postgresql.org
  Cc: bsmith@h-e.com
  Subject: Re: Performance question
  In-Reply-To: <DBDDE26F-4F35-11D7-896A-0003933DD370@h-e.com>
  References: <DBDDE26F-4F35-11D7-896A-0003933DD370@h-e.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