X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 2C6099DC953 for ; Tue, 17 Jan 2006 10:44:29 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 39051-08 for ; Tue, 17 Jan 2006 10:44:32 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mx-2.sollentuna.net (mx-2.sollentuna.net [195.84.163.199]) by postgresql.org (Postfix) with ESMTP id 88A1E9DC94A for ; Tue, 17 Jan 2006 10:44:26 -0400 (AST) Received: from ALGOL.sollentuna.se (janus.sollentuna.se [62.65.68.67]) by mx-2.sollentuna.net (Postfix) with ESMTP id C6DFC8F288; Tue, 17 Jan 2006 15:44:30 +0100 (CET) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: Re: Docs off on ILIKE indexing? Date: Tue, 17 Jan 2006 15:44:30 +0100 Message-ID: <6BCB9D8A16AC4241919521715F4D8BCE6C7EB6@algol.sollentuna.se> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [HACKERS] Docs off on ILIKE indexing? Thread-Index: AcYaxyZc2OPs0ZGJQ763iGxQ9+0vEAArRyLg From: "Magnus Hagander" To: "Tom Lane" Cc: "pgsql-hackers" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.084 required=5 tests=[AWL=0.084] X-Spam-Score: 0.084 X-Spam-Level: X-Archive-Number: 200601/516 X-Sequence-Number: 78620 > > http://www.postgresql.org/docs/8.1/static/indexes-types.html > > says: > > The optimizer can also use a B-tree index for queries involving the=20 > > pattern matching operators LIKE, ILIKE, ~, and ~*, if the=20 > pattern is a=20 > > constant and is anchored to the beginning of the string -=20 > for example,=20 > > col LIKE 'foo%' or col ~ '^foo', but not col LIKE '%bar'. >=20 > > But really, does it use indexes for ILIKE? >=20 > That's pretty poorly phrased. For ILIKE it'll only work if=20 > there's a prefix of the pattern that's not letters (and hence=20 > is unaffected by the case-folding issue). Ahh. That explains it. Perfectly logical. And yes, that's pretty poorly phrased - at least I didn't understand it :-) //Magnus