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 6FC8E564BD for ; Tue, 22 Mar 2005 10:49:45 +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 67402-07 for ; Tue, 22 Mar 2005 10:49:36 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 36B14563F1 for ; Tue, 22 Mar 2005 10:49:35 +0000 (GMT) Received: (qmail 19256 invoked from network); 22 Mar 2005 11:49:46 +0100 Received: from unknown (HELO localhost) (boutiquenumerique-lists@192.168.0.4) by boutiquenumerique.com with SMTP; 22 Mar 2005 11:49:46 +0100 To: "Layet Benjamin" , pgsql-performance@postgresql.org Subject: Re: best practices with index on varchar column References: <007301c52ec0$a8f64ec0$9285a8c0@moonfactory.co.jp> Message-ID: Date: Tue, 22 Mar 2005 11:49:36 +0100 From: PFC Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <007301c52ec0$a8f64ec0$9285a8c0@moonfactory.co.jp> User-Agent: Opera M2(BETA2)/8.0 (Linux, build 987) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/432 X-Sequence-Number: 11137 > Can I use an index on a varchar column to optimize the SELECT queries > that > use " column LIKE 'header%' "? Yes > If yes what is the best tree algotithm to use ? Btree Note that if you want case insensitive matching you need to make an index on lower(column) and SELECT WHERE lower(column) LIKE 'header%' Locales may bite you.