Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 31A869FB1FF for ; Wed, 4 Oct 2006 06:40:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 02448-08 for ; Wed, 4 Oct 2006 09:40:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by postgresql.org (Postfix) with ESMTP id 1DEAD9FA25D for ; Wed, 4 Oct 2006 06:40:48 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id p77so456687nfc for ; Wed, 04 Oct 2006 02:40:47 -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=lk1YhfQBdPsocJzG36vCpAqWmECREGlx45i4h4obd4j7dkxDIshIVN0SGo9bgKqXTI29OPw3/JN0+0DPA8pIxkW0edPvIR5HLQngPyzAjxNGXibFf9DUC/+yQZCwAzh9z1MQJ0ZHndmDEEssBQWhiWkj2H4MsGrV6zkfKefmpnE= Received: by 10.49.75.2 with SMTP id c2mr2057960nfl; Wed, 04 Oct 2006 02:40:46 -0700 (PDT) Received: by 10.49.12.13 with HTTP; Wed, 4 Oct 2006 02:40:46 -0700 (PDT) Message-ID: <168519350610040240k346bd99fj9537822d79443f8c@mail.gmail.com> Date: Wed, 4 Oct 2006 10:40:46 +0100 From: "simon godden" To: "Richard Huxton" Subject: Re: simple case using index on windows but not on linux Cc: "Heikki Linnakangas" , pgsql-performance@postgresql.org In-Reply-To: <45238085.3000407@archonet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <168519350610040048m7c4031e3t1a24b3fd4d9265a3@mail.gmail.com> <45237AD0.50604@enterprisedb.com> <168519350610040219n648a282hf159ff272e0f672a@mail.gmail.com> <45238085.3000407@archonet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/76 X-Sequence-Number: 21205 On 10/4/06, Richard Huxton wrote: > > Issue "set enable_seqscan=false" and then run your explain analyse. If > your query uses the index, what is the estimated cost? If the estimated > cost is larger than a seq-scan that would indicate your configuration > settings are badly out-of-range. I did that and it still used seq-scan. > > If the index isn't used, then we have problem #3. I think this is what > you are actually seeing. Your locale is something other than "C" and PG > doesn't know how to use like with indexes. Read up on operator classes > or change your locale. > http://www.postgresql.org/docs/8.1/static/indexes-opclass.html > Aha - that sounds like it - this is the output from locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= I guess it cannot determine the collating sequence? I'm not too familiar with unix locale issues - does this output match your problem description? Can you explain how to change my locale to 'C'? (I'm quite happy for you to tell me to RTFM, as I know this is not a linux user mailing list :) -- Simon Godden