X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id C9C4611F653D for ; Tue, 25 Apr 2006 22:39:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 75436-09 for ; Tue, 25 Apr 2006 22:39:43 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.207]) by postgresql.org (Postfix) with ESMTP id 1E2AE11F6081 for ; Tue, 25 Apr 2006 22:39:40 -0300 (ADT) Received: by nz-out-0102.google.com with SMTP id o1so1190479nzf for ; Tue, 25 Apr 2006 18:39:41 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WWRnYj/WIQAwmCmV4cX4m/lJB1/WDG9bYrzDDkjkpLqx9njZDDr+teA4q3k1zoa+Ue0kVoJaG5u5mLemLt+PSbXTwCyEVqG8Fblp4A2cqC9PmxXM+b29tBwJsUIgtL2ERpH9rVFVq+j9YQm5JIFJXmrnfN67e8IJvgsL08U2VwI= Received: by 10.36.43.1 with SMTP id q1mr539245nzq; Tue, 25 Apr 2006 18:39:41 -0700 (PDT) Received: by 10.36.97.8 with HTTP; Tue, 25 Apr 2006 18:39:41 -0700 (PDT) Message-ID: <3c1395330604251839g1063da6k62f0c85d59fe89c0@mail.gmail.com> Date: Wed, 26 Apr 2006 11:39:41 +1000 From: "chris smith" To: "Scott Marlowe" Subject: Re: Query on postgresql 7.4.2 not using index Cc: pgsql-performance@postgresql.org In-Reply-To: <1145980463.23538.218.camel@state.g2switchworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <444E240D.3050000@andromeiberica.com> <3c1395330604250634r6f215ceame157f3dd5f5f4fa3@mail.gmail.com> <444E28ED.3090900@andromeiberica.com> <19483.1145978579@sss.pgh.pa.us> <444E44A2.6030703@andromeiberica.com> <1145980463.23538.218.camel@state.g2switchworks.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/590 X-Sequence-Number: 18674 > OK. Stop and think about what you're telling postgresql to do here. > > You're telling it to cast the field group_id to int8, then compare it to > 9. How can it cast the group_id to int8 without fetching it? That's > right, you're ensuring a seq scan. You need to put the int8 cast on the > other side of that equality comparison, like: Yeh that one was my fault :) I couldn't remember which way it went and if 7.4.x had issues with int8 indexes.. -- Postgresql & php tutorials http://www.designmagick.com/