pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Huxton <dev@archonet.com>
Cc: firerox@centrum.cz
Cc: tv@fuzzy.cz
Cc: pgsql-performance@postgresql.org
Subject: Re: slow full table update
Date: Wed, 12 Nov 2008 15:54:08 -0500
Message-ID: <20663.1226523248@sss.pgh.pa.us> (raw)
In-Reply-To: <491B1653.3040600@archonet.com>
References: <200811101729.14977@centrum.cz>
	<200811101730.11057@centrum.cz>
	<200811101730.15902@centrum.cz>
	<61593.89.102.139.23.1226335300.squirrel@sq.gransy.com>
	<200811121725.30238@centrum.cz>
	<63509.89.102.139.23.1226508479.squirrel@sq.gransy.com>
	<200811121825.26487@centrum.cz>
	<491B1653.3040600@archonet.com>

Richard Huxton <dev@archonet.com> writes:
> firerox@centrum.cz wrote:
>> I try explain query with this result
>> for 10.000 rows > update songs set views = 0 where sid > 20000 and sid < 30000
>> 
>> Bitmap Heap Scan on songs  (cost=151.59..6814.29 rows=8931 width=526) (actual time=4.848..167.855 rows=8945 loops=1)

> This query says t is taking 167 milli-seconds, not 10 minutes as your
> first message said. Is this query actually slow?

The explain plan tree only shows the time to fetch/compute the new rows,
not to actually perform the update, update indexes, or fire triggers.
If there is a big discrepancy then the extra time must be going into
one of those steps.

8.1 does show trigger execution time separately, so the most obvious
problem (unindexed foreign key reference) seems to be excluded, unless
the OP just snipped that part of the output ...

			regards, tom lane



view thread (14+ messages)  latest in thread

Message-ID: <20663.1226523248@sss.pgh.pa.us>
Permalink:  ../20663.1226523248@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20663.1226523248@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dev@archonet.com, firerox@centrum.cz, tv@fuzzy.cz
  Subject: Re: slow full table update
  In-Reply-To: <20663.1226523248@sss.pgh.pa.us>

* 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