pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Snow <als@fl.net.au>
To: Vassili A Akimov <vassili@erols.com>
Cc: Pgsql-General@Postgresql. Org <pgsql-general@postgresql.org>
Subject: RE: Need to improve performance
Date: Sat, 24 Jun 2000 02:17:05 +1000
Message-ID: <NHEALMDKDACEIPBNOOOCMEDHCGAA.als@fl.net.au> (raw)
In-Reply-To: <395373C5.B1C2A566@erols.com>



> So we were advised to use "fulltextindex".- chunk
> this fields on single words and make new table with words and oids in
> it. After we made this table its size was 2940360 records. And I tried
> to measure the time:
>
>  ....
>
> select f1.id from app_fti f1, app_fti f2 where f1.string~*'visual' and
> f2.string~*'basic' and f1.id=f2.id;

What is causing it to be so slow is the use of regular expression pattern
matching.  For reasons I don't know, regular expression evaluation in a
query is fairly slow in PostgreSQL.  But since you have (correctly, I think)
made a full text index, why do you still need to use regexp's ?

Replace the ~* operator in the query above with 'LIKE', and you should find
it several times faster.

Please let us know the results of your testing.



- Andrew






view thread (5+ messages)  latest in thread

Message-ID: <NHEALMDKDACEIPBNOOOCMEDHCGAA.als@fl.net.au>
Permalink:  ../NHEALMDKDACEIPBNOOOCMEDHCGAA.als@fl.net.au/
Also on:    postgresql.org/message-id/NHEALMDKDACEIPBNOOOCMEDHCGAA.als@fl.net.au

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: als@fl.net.au, vassili@erols.com, pgsql-general@postgresql.org
  Subject: Re: Need to improve performance
  In-Reply-To: <NHEALMDKDACEIPBNOOOCMEDHCGAA.als@fl.net.au>
  References: <395373C5.B1C2A566@erols.com> <NHEALMDKDACEIPBNOOOCMEDHCGAA.als@fl.net.au>

* 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