X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 3B50811F6ADE for ; Thu, 27 Apr 2006 16:09:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 13258-06 for ; Thu, 27 Apr 2006 16:09:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 456C311F674D for ; Thu, 27 Apr 2006 16:09:18 -0300 (ADT) 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 k3RJ9DdA014691; Thu, 27 Apr 2006 15:09:13 -0400 (EDT) To: "Andrus" cc: pgsql-performance@postgresql.org Subject: Re: CPU usage goes to 100%, query seems to ran forever In-reply-to: References: Comments: In-reply-to "Andrus" message dated "Thu, 27 Apr 2006 21:44:49 +0300" Date: Thu, 27 Apr 2006 15:09:13 -0400 Message-ID: <14690.1146164953@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/656 X-Sequence-Number: 18740 "Andrus" writes: > I have small database running in 8.1.3 in W2K server. > The following query causes Postgres process to use 100% CPU and seems to run > forever. > If I change '1EEKPANT' to less frequently used item code, it runs fast. You have ANALYZEd all these tables recently, I hope? The planner certainly doesn't think this query will take very long. To find out what's wrong, you're going to have to be patient enough to let an EXPLAIN ANALYZE run to completion. Plain EXPLAIN won't tell. regards, tom lane