pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ivar Zarans <iff@alcaron.ee>
To: pgsql-performance@postgresql.org
Subject: Re: Slow UPADTE, compared to INSERT
Date: Thu, 4 Dec 2003 22:43:26 +0200
Message-ID: <20031204204326.GA17083@alcaron.ee> (raw)
In-Reply-To: <200312042023.37050.dev@archonet.com>
References: <20031204185751.GA15893@alcaron.ee>
	<20031204142320.3c021100.threshar@torgo.978.org>
	<20031204195121.GA16497@alcaron.ee>
	<200312042023.37050.dev@archonet.com>

On Thu, Dec 04, 2003 at 08:23:36PM +0000, Richard Huxton wrote:

> Ah - it's probably not the update but the IN. You can rewrite it using PG's 
> non-standard FROM:
> 
> UPDATE t1 SET status='done' FROM t_tmp WHERE t1.rec_id = t_tmp.rec_id;

Thanks for the hint. I'll try this.

> Now that doesn't explain why the update is taking so long. One fifth of a 
> second is extremely slow. Are you certain that the index is being used?

Explain shows following output:

explain update table1 set status = 'PROC' where recid = '199901';

Index Scan using table1_pkey on table1  (cost=0.00..6.01 rows=1 width=198)
   Index Cond: (recid = 199901::bigint)
   (2 rows)



-- 
Ivar Zarans




view thread (24+ messages)  latest in thread

Message-ID: <20031204204326.GA17083@alcaron.ee>
Permalink:  ../20031204204326.GA17083@alcaron.ee/
Also on:    postgresql.org/message-id/20031204204326.GA17083@alcaron.ee

 · 

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: iff@alcaron.ee
  Subject: Re: Slow UPADTE, compared to INSERT
  In-Reply-To: <20031204204326.GA17083@alcaron.ee>

* 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