Re: update from select

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dev(at)kbsolutions(dot)ch
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: update from select
Date: 2007-10-29 18:42:57
Message-ID: 14485.1193683377@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

<dev(at)kbsolutions(dot)ch> writes:
> Hash Join (cost=10827.45..25950.05 rows=4906 width=1191) (actual
> time=586.251..2852.691 rows=111306 loops=1)
> ...
> Total runtime: 633548.404 ms

So you're worried about the wrong thing entirely. The query is taking
less than 3 seconds, which may be reasonable considering it's producing
111000 join rows. The big problem is the other 630 seconds, which is
evidently update overhead. I'm wondering if you have any triggers or
foreign keys leading to or from this table.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Fernando Hevia 2007-10-30 20:42:18 Perfomance benefit using Min() against order by & limit 1?
Previous Message Pavel Stehule 2007-10-29 15:46:31 Re: update from select