From: Tom Lane <tgl@sss.pgh.pa.us>
To: Erik Norvelle <erik@norvelle.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: Update performance ... is 200, 000 updates per hour what I should expect?
Date: Tue, 02 Dec 2003 11:32:31 -0500
Message-ID: <13345.1070382751@sss.pgh.pa.us> (raw)
In-Reply-To: <A461D6B8-24DF-11D8-BDFB-000A9583BF06@norvelle.net>
References: <A461D6B8-24DF-11D8-BDFB-000A9583BF06@norvelle.net>
Erik Norvelle <erik@norvelle.net> writes:
> update indethom
> set query_counter =3D nextval('s2.query_counter_seq'), -- Just=
> =20=20
> for keeping track of how fast the query is running
> sectref =3D (select clavis from s2.sectiones where
> s2.sectiones.nomeoper =3D indethom.nomeoper
> and s2.sectiones.refere1a =3D indethom.refere1a and=20=20
> s2.sectiones.refere1b =3D indethom.refere1b
> and s2.sectiones.refere2a =3D indethom.refere2a and=20=20
> s2.sectiones.refere2b =3D indethom.refere2b
> and s2.sectiones.refere3a =3D indethom.refere3a and=20=20
> s2.sectiones.refere3b =3D indethom.refere3b
> and s2.sectiones.refere4a =3D indethom.refere4a and=20=20
> s2.sectiones.refere4b =3D indethom.refere4b);
This is effectively forcing a nestloop-with-inner-indexscan join. You
might be better off with
update indethom
set query_counter = nextval('s2.query_counter_seq'),
sectref = sectiones.clavis
from s2.sectiones
where
s2.sectiones.nomeoper = indethom.nomeoper
and s2.sectiones.refere1a = indethom.refere1a and
s2.sectiones.refere1b = indethom.refere1b
and s2.sectiones.refere2a = indethom.refere2a and
s2.sectiones.refere2b = indethom.refere2b
and s2.sectiones.refere3a = indethom.refere3a and
s2.sectiones.refere3b = indethom.refere3b
and s2.sectiones.refere4a = indethom.refere4a and
s2.sectiones.refere4b = indethom.refere4b;
regards, tom lane
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, erik@norvelle.net
Subject: Re: Update performance ... is 200, 000 updates per hour what I should expect?
In-Reply-To: <13345.1070382751@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