X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3C47BD1D92D for ; Tue, 2 Dec 2003 16:33:06 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 48233-08 for ; Tue, 2 Dec 2003 12:32:38 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id F3696D1D6B9 for ; Tue, 2 Dec 2003 12:32:33 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id hB2GWV19013346; Tue, 2 Dec 2003 11:32:31 -0500 (EST) To: Erik Norvelle Cc: pgsql-performance@postgresql.org Subject: Re: Update performance ... is 200, 000 updates per hour what I should expect? In-reply-to: References: Comments: In-reply-to Erik Norvelle message dated "Tue, 02 Dec 2003 16:53:16 +0100" Date: Tue, 02 Dec 2003 11:32:31 -0500 Message-ID: <13345.1070382751@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/24 X-Sequence-Number: 4884 Erik Norvelle 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