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:48:06 |
Message-ID: | 47F13FF6.1070605@iol.ie |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 31/03/2008 20:38, mark wrote:
> EXPLAIN ANALYZE update users set number_recieved=number_recieved+1 where
> uid=738889333;
> QUERY PLAN
> ------------------------------------------------------------------------------------------------------------------
> Index Scan using idx_uid on users (cost=0.00..8.46 rows=1 width=1073)
> (actual time=0.094..0.161 rows=1 loops=1)
> Index Cond: (uid = 738889333)
> Total runtime: 11479.053 ms
Is there anything going on that might affect the time taken? - triggers,
loads of indices to be updated, etc? From the docs[1]:
"For INSERT, UPDATE, and DELETE commands, the total run time might be
considerably larger, because it includes the time spent processing the
result rows. In these commands, the time for the top plan node
essentially is the time spent computing the new rows and/or locating the
old ones, but it doesn't include the time spent applying the changes.
Time spent firing triggers, if any, is also outside the top plan node,
and is shown separately for each trigger."
Ray.
[1] http://www.postgresql.org/docs/8.3/static/using-explain.html
---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
---------------------------------------------------------------
From | Date | Subject | |
---|---|---|---|
Next Message | Raymond O'Donnell | 2008-03-31 19:49:08 | Re: simple update queries take a long time - postgres 8.3.1 |
Previous Message | Vivek Khera | 2008-03-31 19:45:49 | Re: PostgreSQL Replication with read-only access to standby DB |