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 7BC8255456 for ; Wed, 2 Mar 2005 00:44:25 +0000 (GMT) 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 55029-04 for ; Wed, 2 Mar 2005 00:44:17 +0000 (GMT) Received: from crestone.coronasolutions.com (crestone.coronasolutions.com [66.45.104.24]) by svr1.postgresql.org (Postfix) with ESMTP id C77D1556D1 for ; Wed, 2 Mar 2005 00:44:15 +0000 (GMT) Received: from localhost (localhost.coronasolutions.com [127.0.0.1]) by crestone.coronasolutions.com (Postfix) with ESMTP id 11A7D18B3E5 for ; Tue, 1 Mar 2005 17:42:44 -0700 (MST) Received: from crestone.coronasolutions.com ([127.0.0.1]) by localhost (debian [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 27307-06 for ; Tue, 1 Mar 2005 17:42:43 -0700 (MST) Received: from [4.228.114.71] (dialup-4.228.114.71.Dial1.Denver1.Level3.net [4.228.114.71]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by crestone.coronasolutions.com (Postfix) with ESMTP id 9A90618B3DD for ; Tue, 1 Mar 2005 17:42:42 -0700 (MST) Mime-Version: 1.0 (Apple Message framework v619.2) Content-Transfer-Encoding: 7bit Message-Id: <124c40d023eab9ed34fda472fbb3db3f@drivefaster.net> Content-Type: text/plain; charset=US-ASCII; format=flowed To: pgsql-performance@postgresql.org From: Dan Harris Subject: Confusion about locales and 'like' indexes Date: Tue, 1 Mar 2005 17:44:07 -0700 X-Mailer: Apple Mail (2.619.2) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at drivefaster.net X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200503/16 X-Sequence-Number: 10721 Greetings, I have been beating myself up today trying to optimize indices for a query that uses LIKE. In my research I have read that the locale setting may affect PostgreSQL's choice of seq scan vs index scan. I am running Fedora Core 2 and it appears when I run "locale" that it is set to 'en.US-UTF-8'. Did I fall into a "gotcha" trap here about C vs non-C locales? I'm not much of a C programmer so I have no idea what all this touches and everything has been left as default during PG compilation as well as Fedora install. I can pg_dump and initdb again with --locale=C if this will allow my LIKE queries to use indexes, but I just wanted to know if there was some other place I needed to change locales in the system? e.g. postgresql.conf or env vars? Or, would the initdb and reload alone fix it? I'm running 8.0.1 if that matters. Thanks