Re: Improving query performance - Mailing list pgsql-performance

From Tom Lane
Subject Re: Improving query performance
Date
Msg-id 1763.1172814488@sss.pgh.pa.us
Whole thread Raw
In response to Improving query performance  (David Leangen <postgres@leangen.net>)
Responses Re: Improving query performance
List pgsql-performance
David Leangen <postgres@leangen.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

pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Array indexes, GIN?
Next
From: Oleg Bartunov
Date:
Subject: Re: Array indexes, GIN?