Re: Improving query performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: postgres(at)leangen(dot)net
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Improving query performance
Date: 2007-03-02 05:48:08
Message-ID: 1763.1172814488@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

David Leangen <postgres(at)leangen(dot)net> writes:
> And this is the actual query:

> SELECT COUNT(t0.ID) FROM public.MY_TABLE t0
> WHERE ((POSITION('adenosine cyclic 35-monophosphate' IN LOWER(t0.TITLE))
> - 1) >=0 OR
> (POSITION('adenosine cyclic 55-monophosphate' IN LOWER(t0.TEXT)) - 1) >=
> 0 OR
> (POSITION('cyclic amp, disodium salt' IN LOWER(t0.TITLE)) - 1) >= 0 OR
> (POSITION('cyclic amp, disodium salt' IN LOWER(t0.TEXT)) - 1) >= 0 OR
> (POSITION('cyclic amp, sodium salt' IN LOWER(t0.TEXT)) - 1) >= 0 OR
> ...etc...

I think you need to look into full-text indexing (see tsearch2).

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Oleg Bartunov 2007-03-02 06:45:03 Re: Array indexes, GIN?
Previous Message Josh Berkus 2007-03-02 05:47:38 Re: Array indexes, GIN?