Re: simple update queries take a long time - postgres 8.3.1

From: Tomasz Ostrowski <tometzky(at)batory(dot)org(dot)pl>
To: mark <markkicks(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: simple update queries take a long time - postgres 8.3.1
Date: 2008-04-01 06:18:36
Message-ID: 47F1D3BC.5090405@batory.org.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2008-03-31 21:16, mark wrote:

> is the query I am running , and it takes over 10 seconds to complete
> this query...
> update users set number_recieved=number_recieved+1 where
> uid=738889333;

Every time or only sometimes?

If it is sometimes then I think this query is waiting for a checkpoint.
If I'm right then you'll have to tune Postgres to do them more often, so
that there is less work to do each time. You use 4GB of shared buffers
so write-busy database can write gigabytes of data on each checkpoint,
which can take seconds.

Upgrade to 8.3 will help as checkpoint writing algorithms were optimized
there for lots of RAM.

Read this for more info and tuning tips:
http://www.westnet.com/~gsmith/content/postgresql/chkp-bgw-83.htm

Regards
Tometzky
--
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
Winnie the Pooh

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavan Deolasee 2008-04-01 07:37:20 Re: [HACKERS] ANALYZE getting dead tuple count hopelessly wrong
Previous Message Tom Lane 2008-04-01 05:13:11 Re: [HACKERS] Connection to PostgreSQL Using Certificate: Wrong Permissions on Private Key File