pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guillaume Smet <guillaume.smet@gmail.com>
To: Florian Weimer <fweimer@bfk.de>
To: Steinar H. Gunderson <sgunderson@bigfoot.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: pg_trgm performance
Date: Sat, 24 Feb 2007 00:09:41 +0100
Message-ID: <1d4e0c10702231509k7ad24e2ck3a149a2e3a2899f7@mail.gmail.com> (raw)
In-Reply-To: <20070115125834.GA28248@uio.no>
References: <82mz4k4mt7.fsf@mid.bfk.de>
	<20070115125834.GA28248@uio.no>

Florian, Steinar,

Could you try to see if the GIN implementation of pg_trgm is faster in
your cases?

Florian, instead of using WHERE similarity(...) > 0.4, you should use
set_limit (SELECT set_limit(0.4);).

I posted it on -patches and it is available here:
http://people.openwide.fr/~gsmet/postgresql/pg_trgm_gin3.diff .

The patch is against HEAD but It applies on 8.2 without any problem.

After applying this patch and installing pg_trgm.sql (you should
uninstall pg_trgm before compiling using the old uninstall script),
then you can create:
CREATE INDEX idx_table_word ON table USING gin(word gin_trgm_ops);

17 characters is quite long so I'm not sure it will help you because
it usually has to recheck a high number of rows due to the GIN
implementation but I'd like to know if it's faster or slower in this
case.

If your data are not private and you don't have the time to test it, I
can test it here without any problem.

Thanks.

--
Guillaume



view thread (10+ messages)  latest in thread

Message-ID: <1d4e0c10702231509k7ad24e2ck3a149a2e3a2899f7@mail.gmail.com>
Permalink:  ../1d4e0c10702231509k7ad24e2ck3a149a2e3a2899f7@mail.gmail.com/
Also on:    postgresql.org/message-id/1d4e0c10702231509k7ad24e2ck3a149a2e3a2899f7@mail.gmail.com

 · 

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: guillaume.smet@gmail.com, fweimer@bfk.de, sgunderson@bigfoot.com
  Subject: Re: pg_trgm performance
  In-Reply-To: <1d4e0c10702231509k7ad24e2ck3a149a2e3a2899f7@mail.gmail.com>

* 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