Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C5C0E2E0108 for ; Mon, 11 Feb 2008 12:59:29 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 63795-01 for ; Mon, 11 Feb 2008 12:59:26 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id A1AF72E00A8 for ; Mon, 11 Feb 2008 12:59:25 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m1BGxM6l002983; Mon, 11 Feb 2008 11:59:22 -0500 (EST) To: "Linux Guru" cc: pgsql-performance@postgresql.org Subject: Re: Update with Subquery Performance In-reply-to: <3caa866c0802110306rcb5e72dyd264ff330c61f8ae@mail.gmail.com> References: <3caa866c0802110306rcb5e72dyd264ff330c61f8ae@mail.gmail.com> Comments: In-reply-to "Linux Guru" message dated "Mon, 11 Feb 2008 16:06:44 +0500" Date: Mon, 11 Feb 2008 11:59:22 -0500 Message-ID: <2982.1202749162@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/99 X-Sequence-Number: 28641 "Linux Guru" writes: > We have a large datawarehouse stored in postgres and temp tables are created > based on user query. The process of temp table creation involves selecting > data from main fact table, this includes several select and update > statements and one of the following update statement is having performance > issues. Try ANALYZEing the temp table before the step that's too slow. If that doesn't help, let's see EXPLAIN ANALYZE (not just EXPLAIN) output. regards, tom lane