Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5FB1B9FB483 for ; Fri, 2 Mar 2007 22:12:14 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 29683-05 for ; Fri, 2 Mar 2007 22:12:06 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id C19F69FB447 for ; Fri, 2 Mar 2007 22:12:06 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l232C3bt023599; Fri, 2 Mar 2007 21:12:03 -0500 (EST) To: josh@agliodbs.com cc: pgsql-performance@postgresql.org, Abu Mushayeed Subject: Re: Performance Query In-reply-to: <200703021652.22785.josh@agliodbs.com> References: <906038.13110.qm@web57107.mail.re3.yahoo.com> <200703021652.22785.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Fri, 02 Mar 2007 16:52:22 -0800" Date: Fri, 02 Mar 2007 21:12:03 -0500 Message-ID: <23598.1172887923@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.06 tagged_above=0 required=5 tests=AWL, BAYES_50, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200703/77 X-Sequence-Number: 23482 Josh Berkus writes: >> Please help in understanding how I can find out what the system is >> waiting for or why is it taking the query so long. > First guess would be I/O bound. The planner, at least, thinks you're > inserting 2 million records. What kind of disk support do you have? I don't see any need to guess. iostat or vmstat or local equivalent will show you quick enough if you are maxing out the disk or the CPU. It seems at least somewhat possible that the thing is blocked on a lock, in which case the pg_locks view would tell you about it. regards, tom lane