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 518395E46CD for ; Sun, 29 Aug 2004 18:10:48 -0300 (ADT) 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 50782-03 for ; Sun, 29 Aug 2004 21:10:46 +0000 (GMT) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by svr1.postgresql.org (Postfix) with ESMTP id BF96B5E3631 for ; Sun, 29 Aug 2004 18:10:45 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1C1Wwf-0007qa-00; Sun, 29 Aug 2004 17:10:37 -0400 To: Mr Pink Cc: Jack Kerkhof , pgsql-performance@postgresql.org Subject: Re: Why does a simple query not use an obvious index? References: <20040829180448.41247.qmail@web41108.mail.yahoo.com> In-Reply-To: <20040829180448.41247.qmail@web41108.mail.yahoo.com> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 29 Aug 2004 17:10:37 -0400 Message-ID: <87llfxk5v6.fsf@stark.xeocode.com> Lines: 15 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/428 X-Sequence-Number: 8064 Mr Pink writes: > AFAIK postgres doesn't peek at values used in a query when optimizing Of course it does. However sometimes things don't work perfectly. To get good answers rather than just guesses we'll need two things: . What version of postgres are you using. . The output of EXPLAIN ANALYZE select ... -- greg