Re: efficiency of wildcards at both ends

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: efficiency of wildcards at both ends
Date: 2012-06-23 08:51:33
Message-ID: js402l$pde$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2012-06-20, Sam Z J <sammyjiang721(at)gmail(dot)com> wrote:
> --0016e6d999db24c4c704c2ea7a97
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi all
>
> I'm curious how is wildcards at both ends implemented, e.g. LIKE '%str%'
> How efficient is it if that's the only search criteria against a large
> table? how much does indexing the column help

fulltextsearch can be abused with a custom lexer that fragments the string in every possible
way and that can be matched against, but not using LIKE.

Works OK on tables with tens of thaousands of rows haven't tried it on
larger rows.

--
⚂⚃ 100% natural

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2012-06-23 09:35:41 Re: error handling
Previous Message Robert Poor 2012-06-23 06:33:02 configuring queries for concurrent updates