pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
To: Steve Atkins <steve@blighty.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: For full text indexing, which is better, tsearch2 or
Date: Thu, 27 Nov 2003 12:41:59 +0800
Message-ID: <3FC58097.8090803@familyhealth.com.au> (raw)
In-Reply-To: <20031127032831.GA4836@gp.word-to-the-wise.com>
References: <4c0ccf4c27ff.4c27ff4c0ccf@jhmimail.jhmi.edu>
	<3FC54A82.2040605@familyhealth.com.au>
	<20031127032831.GA4836@gp.word-to-the-wise.com>

> Does anyone have any metrics on how fast tsearch2 actually is?
> 
> I tried it on a synthetic dataset of a million documents of a hundred
> words each and while insertions were impressively fast I gave up on
> the search after 10 minutes.
> 
> Broken? Unusable slow? This was on the last 7.4 release candidate.

I just created a 1.1million row dataset by copying one of our 30000 row 
production tables and just taking out the txtidx column.  Then I 
inserted it into itself until it had 1.1 million rows.

Then I created the GiST index - THAT took forever - seriously like 20 
mins or half an hour or something.

Now, to find a word:

select * from tsearchtest where ftiidx ## 'curry';
Time: 9760.75 ms

The AND of two words:
Time: 103.61 ms

The AND of three words:
select * from tsearchtest where ftiidx ## 'curry&green&thai';
Time: 61.86 ms

And now a one word query now that buffers are cached:
select * from tsearchtest where ftiidx ## 'curry';
Time: 444.89 ms

So, I have no idea why you think it's slow?  Perhaps you forgot the 
'create index using gist' step?

Also, if you use the NOT (!) operand, you can get yourself into a really 
slow situation.

Chris






view thread (11+ messages)  latest in thread

Message-ID: <3FC58097.8090803@familyhealth.com.au>
Permalink:  ../3FC58097.8090803@familyhealth.com.au/
Also on:    postgresql.org/message-id/3FC58097.8090803@familyhealth.com.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-performance@postgresql.org
  Cc: chriskl@familyhealth.com.au, steve@blighty.com
  Subject: Re: For full text indexing, which is better, tsearch2 or
  In-Reply-To: <3FC58097.8090803@familyhealth.com.au>
  References: <4c0ccf4c27ff.4c27ff4c0ccf@jhmimail.jhmi.edu> <3FC54A82.2040605@familyhealth.com.au> <20031127032831.GA4836@gp.word-to-the-wise.com> <3FC58097.8090803@familyhealth.com.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