Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 44AE463327D for ; Mon, 5 Jul 2010 23:42:58 -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 86342-06 for ; Tue, 6 Jul 2010 02:42:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [202.4.227.11]) by mail.postgresql.org (Postfix) with ESMTP id 4B45F632F71 for ; Mon, 5 Jul 2010 23:42:50 -0300 (ADT) Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by www.postnewspapers.com.au (Postfix) with ESMTP id BFD73A2CC; Tue, 6 Jul 2010 10:42:28 +0800 (WST) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 77E65AE825; Tue, 6 Jul 2010 10:41:18 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (mail.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id pl0BPRMQUGBy; Tue, 6 Jul 2010 10:41:13 +0800 (WST) Received: from [10.1.1.6] (124-168-255-56.dyn.iinet.net.au [124.168.255.56]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id 0D685AE829; Tue, 6 Jul 2010 10:41:13 +0800 (WST) Message-ID: <4C32981C.2070406@postnewspapers.com.au> Date: Tue, 06 Jul 2010 10:42:36 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: Jens Hoffrichter CC: pgsql-performance@postgresql.org Subject: Re: SeqScans on boolen values / How to speed this up? References: In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.79 tagged_above=-10 required=5 tests=BAYES_50=0.8, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/56 X-Sequence-Number: 39445 On 05/07/10 19:36, Jens Hoffrichter wrote: > Hello everyone, > > We've recently finished developing a bigger webapplication, and we are > about to put it online. > > I ran some load tests yesterday, and configured 'slow query' logging > beforehand, so I could see if there might be a performance bottleneck > in the PG. While I discovered no real problems, the log file analysis > using pgFouine revealed two queries, which are executed often, and > take quite a bit some time. It might be worth looking at what queries have results that change infrequently or don't have to be up to the minute accurate, so they're candidates for caching. Memcached is an incredibly handy tool for taking load off your database. -- Craig Ringer