Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 93B809F9F1C for ; Mon, 17 Sep 2007 04:25:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 21940-09 for ; Mon, 17 Sep 2007 04:25:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from depesz.com (depesz.com [88.198.37.40]) by postgresql.org (Postfix) with ESMTP id CC5E89F9CBD for ; Mon, 17 Sep 2007 04:25:43 -0300 (ADT) Received: from depesz by depesz.com with local (Exim 4.63) (envelope-from ) id 1IXAzF-0003fO-Qw; Mon, 17 Sep 2007 09:25:41 +0200 Date: Mon, 17 Sep 2007 09:25:41 +0200 From: hubert depesz lubaczewski To: Stanislas de Larocque Cc: pgsql-sql@postgresql.org Subject: Re: Optimize querry sql Message-ID: <20070917072541.GA13991@depesz.com> Reply-To: depesz@depesz.com References: <20070914133641.GA31759@depesz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/124 X-Sequence-Number: 29337 On Mon, Sep 17, 2007 at 09:17:58AM +0200, Stanislas de Larocque wrote: > Have you advices to optimize the query please ? for some many rows the 400ms looks quite reasonable. the best thing you can make to speed things up is to calculate the counts with triggers. depesz -- quicksil1er: "postgres is excellent, but like any DB it requires a highly paid DBA. here's my CV!" :) http://www.depesz.com/ - blog dla ciebie (i moje CV)