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

Re: t1.col like '%t2.col%'

From: "Gregory Williamson" <Gregory(dot)Williamson(at)digitalglobe(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>,"Dan Kaplan" <dkaplan(at)citizenhawk(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: t1.col like '%t2.col%'
Date: 2008-03-01 00:30:08
Message-ID: 8B319E5A30FF4A48BE7EEAAF609DB233015E341B@COMAIL01.digitalglobe.com (view raw or flat)
Thread:
Lists: pgsql-performance
Joshua Drake spake thusly:

> On Fri, 29 Feb 2008 15:52:31 -0800
> "Dan Kaplan" <dkaplan(at)citizenhawk(dot)com> wrote:
> 
> > I learned a little about pg_trgm here:
> > http://www.sai.msu.su/~megera/postgres/gist/pg_trgm/README.pg_trgm
> > 
> > But this seems like it's for finding similarities, not substrings.
> > How can I use it to speed up t1.col like '%t2.col%'?
> 
> Faster disks.
> 
> No matter what, that will seqscan. So if you want it to go faster, you
> need faster hardware.

Word!

That said ...

Once upon a time we had a requirement to allow users to search within US counties for property owner name or street names by text fragment.

We used the now deprecated Full Text Indexing (FTI) with some handwaving. But that was in PostgreSQL 7.4 and FTI is not in the contrib package for some time now. See <http://pgfoundry.org/projects/simplefti/> ... I looked at using it in 8.1 but my "C" chops weren't up to it, and it depended heavily on OIDs which we didn't want to use. Anyway, our business requirement evaporated so it doesn't matter to us now.

HTH,

Greg Williamson
Senior DBA
GlobeXplorer LLC, a DigitalGlobe company

Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information and must be protected in accordance with those provisions. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

(My corporate masters made me say this.)

In response to

Responses

pgsql-performance by date

Next:From: Shane AmblerDate: 2008-03-01 00:44:09
Subject: Re: 12 disks raid setup
Previous:From: Joshua D. DrakeDate: 2008-02-29 23:56:42
Subject: Re: t1.col like '%t2.col%'

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