X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B856E534B5 for ; Thu, 24 Mar 2005 19:55:39 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 47339-07 for ; Thu, 24 Mar 2005 19:55:37 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.197]) by svr1.postgresql.org (Postfix) with ESMTP id 4ED885348D for ; Thu, 24 Mar 2005 19:55:36 +0000 (GMT) Received: by rproxy.gmail.com with SMTP id f1so909101rne for ; Thu, 24 Mar 2005 11:55:37 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:reply-to:from:to:cc:subject:date:mime-version:content-type:content-transfer-encoding:x-mailer:in-reply-to:thread-index:x-mimeole:message-id; b=g29l7QOV12n+SaDrRKobaHXFlusDw0jtORmXQfjT+zRniqQQiPKubPV9/OiJc4Rq5iJj7SIAp+WsaCpD4RXy4gatP+1vMTWj4b638kzJa10vfaJ1o7dmlo8+dtD95/gmaRfhscYMYoIYWotMSRFwoN1rkId6+POW7tmGtIm3r94= Received: by 10.38.160.51 with SMTP id i51mr1885631rne; Thu, 24 Mar 2005 11:55:37 -0800 (PST) Received: from MATTSPC ([12.216.69.41]) by mx.gmail.com with ESMTP id 63sm654890rna.2005.03.24.11.55.37; Thu, 24 Mar 2005 11:55:37 -0800 (PST) Reply-To: From: "Matthew Nuzum" To: "'Tom Lane'" Cc: Subject: Re: Preventing query from hogging server Date: Thu, 24 Mar 2005 13:55:32 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-Reply-To: <5050.1111693395@sss.pgh.pa.us> Thread-Index: AcUwqbx/GU33eBYDRwmNhg/1AK79RAAAYHbg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Message-ID: <42431b39.16b65c96.1b4b.ffffd9b6@mx.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.336 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200503/518 X-Sequence-Number: 11223 > How many rows in usage_access? Oh, I just got my explain analyze: QUERY PLAN ---------------------------------------------------------------------------- -------------------------------------------------------------------------- Subquery Scan "*SELECT*" (cost=9499707.90..9856491.74 rows=3567838 width=28) (actual time=11443537.58..12470835.17 rows=1198141 loops=1) -> Aggregate (cost=9499707.90..9856491.74 rows=3567838 width=28) (actual time=11443537.56..12466550.25 rows=1198141 loops=1) -> Group (cost=9499707.90..9767295.78 rows=35678384 width=28) (actual time=11443537.10..12408372.26 rows=35678383 loops=1) -> Sort (cost=9499707.90..9588903.86 rows=35678384 width=28) (actual time=11443537.07..12035366.31 rows=35678383 loops=1) Sort Key: accountid, sessionid -> Seq Scan on usage_access (cost=0.00..1018901.84 rows=35678384 width=28) (actual time=8.13..416580.35 rows=35678383 loops=1) Total runtime: 12625498.84 msec (7 rows) -- Matthew Nuzum www.followers.net - Makers of "Elite Content Management System" View samples of Elite CMS in action by visiting http://www.followers.net/portfolio/