Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 6506063F312 for ; Thu, 10 Jun 2010 15:12:59 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 59137-04 for ; Thu, 10 Jun 2010 18:12:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from shrek.krogh.cc (2605ds1-ynoe.0.fullrate.dk [90.184.12.24]) by mail.postgresql.org (Postfix) with ESMTP id 3A56B63F30B for ; Thu, 10 Jun 2010 15:12:51 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by shrek.krogh.cc (Postfix) with ESMTP id 3186EC44001 for ; Thu, 10 Jun 2010 20:12:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at shrek.krogh.cc Received: from shrek.krogh.cc ([127.0.0.1]) by localhost (shrek.krogh.cc [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mvkRh5telVAh for ; Thu, 10 Jun 2010 20:12:44 +0200 (CEST) Received: from [90.184.13.151] (2605ds1-ynoe.2.fullrate.dk [90.184.13.151]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jesper@krogh.cc) by shrek.krogh.cc (Postfix) with ESMTPSA id B1375C44002 for ; Thu, 10 Jun 2010 20:12:44 +0200 (CEST) Message-ID: <4C112B19.6080908@krogh.cc> Date: Thu, 10 Jun 2010 20:12:41 +0200 From: Jesper Krogh User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Need to increase performance of a query References: <4C1125F0.8090101@collab.net> In-Reply-To: <4C1125F0.8090101@collab.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.8 tagged_above=-10 required=5 tests=BAYES_50=0.8 X-Spam-Level: X-Archive-Number: 201006/173 X-Sequence-Number: 39029 On 2010-06-10 19:50, Anne Rosset wrote: > Any advice on how to make it run faster? What timing do you get if you run it with \t (timing on) and without explain analyze ? I would be surprised if you can get it much faster than what is is.. I may be that a significant portion is "planning cost" so if you run it a lot you might benefit from a prepared statement. -- Jesper