Search Postgresql Archives

Re: efficiency of wildcards at both ends

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



thank you all for the useful information =D

On Wed, Jun 20, 2012 at 1:39 PM, Alan Hodgson <ahodgson@xxxxxxxxx> wrote:
On Wednesday, June 20, 2012 01:10:03 PM Sam Z J 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?
>

Indexing helps not at all. If the search string starts with a wildcard you
will always get a sequential scan of the whole table.

Look at the full text search documentation for a better approach.

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Zhongshi (Sam) Jiang
sammyjiang721@xxxxxxxxx


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux