Skip site navigation (1) Skip section navigation (2)

Re: Partial match in GIN

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: Teodor Sigaev <teodor(at)sigaev(dot)ru>, Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Partial match in GIN
Date: 2008-04-08 19:49:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Heikki Linnakangas wrote:
> Alvaro Herrera wrote:
>> Heikki Linnakangas wrote:

>>> You could satisfy '%foo%' using a regular and a reverse B-tree index, 
>>>  and a bitmap AND. Which is interestingly similar to the way you 
>>> proposed  to use a TIDBitmap within GIN.
>> Huh, can you?  I can see doing "col LIKE 'foo%' OR reverse(col) LIKE
>> reverse('%foo')" with two btree indexes, but not a true %foo% ...
> That should be AND, not OR..
> Hmm. It is the same as far as I can see. Am I missing something?

Well, LIKE %foo% is supposed to match foo unanchored, but with a btree
(or two btrees) you can only get 'foo' anchored to either end of the
string (or both).

Alvaro Herrera                      
The PostgreSQL Company - Command Prompt, Inc.

In response to


pgsql-patches by date

Next:From: Merlin MoncureDate: 2008-04-08 19:58:19
Subject: Re: [PATCHES] libpq type system 0.9a
Previous:From: Magnus HaganderDate: 2008-04-08 19:34:19
Subject: MSVC build broken with perl 5.10

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group