Re: efficiency of wildcards at both ends - Mailing list pgsql-general

From Lonni J Friedman
Subject Re: efficiency of wildcards at both ends
Date
Msg-id CAP=oouGs2wCLYxNT_hhG44u-2e40k6_iCmRtTn-x8sSXqvSxBA@mail.gmail.com
Whole thread Raw
In response to efficiency of wildcards at both ends  (Sam Z J <sammyjiang721@gmail.com>)
List pgsql-general
On Wed, Jun 20, 2012 at 10:10 AM, Sam Z J <sammyjiang721@gmail.com> wrote:
> 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 and roughly how much more
> space is needed for the index?
>
> if the answers are too long, please point me to the relavant text =D

My limited understanding is that any time you need to resort to using
wildcards, indices are never used, and you're falling back to using
the inefficient table scan.

pgsql-general by date:

Previous
From: utsav
Date:
Subject: Re: RETURNING MORE THAN ONE CUSTOM TYPE FROM FUNCTION
Next
From: Andy Colson
Date:
Subject: Re: efficiency of wildcards at both ends