Skip site navigation (1) Skip section navigation (2)

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

From: Raymond O'Donnell <rod(at)iol(dot)ie>
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-03-31 19:23:25
Message-ID: 47F13A2D.2000607@iol.ie (view raw or flat)
Thread:
Lists: pgsql-general
On 31/03/2008 20: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;
> 
> table has about 1.7 million rows.. i have an index on column uid and 
> also on number_received. .. this is also slowing down the inserts that 
> happen.

Are you VACUUMing the table regularly?

Also, can you show us the EXPLAIN ANALYZE output from the query?

Ray.


---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
---------------------------------------------------------------

In response to

Responses

pgsql-general by date

Next:From: Carlos H. ReimerDate: 2008-03-31 19:35:44
Subject: FATAL: bogus freespace amount
Previous:From: markDate: 2008-03-31 19:16:14
Subject: simple update queries take a long time - postgres 8.3.1

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group