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

Re: LIKE search and performance

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: mark(at)mark(dot)mielke(dot)cc
Cc: Richard Huxton <dev(at)archonet(dot)com>, Mark Lewis <mark(dot)lewis(at)mir3(dot)com>, James Mansion <james(at)mansionfamily(dot)plus(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Alexander Staubo <alex(at)purefiction(dot)net>, Andy <frum(at)ar-sd(dot)net>, pgsql-performance(at)postgresql(dot)org
Subject: Re: LIKE search and performance
Date: 2007-05-25 17:06:46
Message-ID: 465717A6.4040503@commandprompt.com (view raw or flat)
Thread:
Lists: pgsql-performance
mark(at)mark(dot)mielke(dot)cc wrote:

> I am speaking of contains, as contains is the one that was said to
> require a seqscan. I am questioning why it requires a seqscan. The
> claim was made that with MVCC, the index is insufficient to check
> for visibility and that the table would need to be accessed anyways,
> therefore a seqscan is required. I question whether a like '%bar%'
> should be considered a high selectivity query in the general case.
> I question whether a worst case should be assumed.

If you are doing %bar% you should be using pg_tgrm or tsearch2.

J


> 
> Perhaps I question too much? :-)
> 
> Cheers,
> mark
> 


In response to

pgsql-performance by date

Next:From: Richard HuxtonDate: 2007-05-25 17:08:53
Subject: Re: LIKE search and performance
Previous:From: markDate: 2007-05-25 16:56:33
Subject: Re: LIKE search and performance

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