Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 0BC29C8E5BD for ; Wed, 23 Nov 2011 21:30:20 -0400 (AST) Received: from [2404:130:0:10::40:2] (helo=mail.catalyst.net.nz) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RTO8o-00078m-Qq for pgsql-performance@postgresql.org; Thu, 24 Nov 2011 01:30:20 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id B9DE8327F8; Thu, 24 Nov 2011 14:30:03 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YZ854HCk2QK4; Thu, 24 Nov 2011 14:30:03 +1300 (NZDT) Received: from [IPv6:2404:130:0:1000:222:15ff:fe5c:2471] (unknown [IPv6:2404:130:0:1000:222:15ff:fe5c:2471]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id 0DF05327F0; Thu, 24 Nov 2011 14:30:03 +1300 (NZDT) Message-ID: <4ECD9E19.8080303@catalyst.net.nz> Date: Thu, 24 Nov 2011 14:30:01 +1300 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Gary Warner CC: pgsql-performance@postgresql.org Subject: Re: Seq Scan used instead of Index Scan References: <1930791595.3607.1322087076188.JavaMail.root@zimbra.cis.uab.edu> In-Reply-To: <1930791595.3607.1322087076188.JavaMail.root@zimbra.cis.uab.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2404:130:0:10::40:2 (failed) X-Archive-Number: 201111/261 X-Sequence-Number: 45772 Can you post your non-default postgresql.conf settings? (I'd hazard a guess that you have effective_cache_size set to the default 128MB). Best wishes Mark On 24/11/11 11:24, Gary Warner wrote: > Very Fast Version: > > Recently my database stopped respecting one of my indexes, which took a query that should run in "subsecond response time" and turning it into something that with small data sets runs in the 7-10 minute range and with large data sets runs in the 30 minute - eternity range. > > Explain Analyze tells me that what used to be an Index Scan has become a Seq Scan, doing a full table scan through 140 million records. > > Any thoughts on why that happens? >