pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: postgres@leangen.net
Cc: pgsql-performance@postgresql.org
Subject: Re: Improving query performance
Date: Fri, 02 Mar 2007 00:48:08 -0500
Message-ID: <1763.1172814488@sss.pgh.pa.us> (raw)
In-Reply-To: <1172808030.27446.12.camel@sonoda.bioscene.co.jp>
References: <1172808030.27446.12.camel@sonoda.bioscene.co.jp>

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



view thread (3+ messages)  latest in thread

Message-ID: <1763.1172814488@sss.pgh.pa.us>
Permalink:  ../1763.1172814488@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1763.1172814488@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, postgres@leangen.net
  Subject: Re: Improving query performance
  In-Reply-To: <1763.1172814488@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox