Re: Trigram performance penalty on varchar?

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: Mario Lopez <mario(at)lar3d(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trigram performance penalty on varchar?
Date: 2008-02-24 12:09:29
Message-ID: 9E5E1046-8144-4522-BC21-2511CEFC15C4@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Feb 21, 2008, at 10:56 AM, Mario Lopez wrote:

> Hi,
>
> I am indexing a 100 million record table composed of varchar(255)
> as the field to be indexed. I have always seen that examples of
> pg_trgm are based on text type fields. Is this by any special reason?.

A varchar is internally represented as text, with a size constraint
of 255 characters in your case (I'm assuming your data requires that
constraint?).

> My computer is creating the index since 5 hours ago so I guess
> there must be something wrong...

I guess your server is running low on memory and the index being
created doesn't fit in memory. You may want to have a look at http://
www.postgresql.org/docs/8.3/interactive/populate.html#POPULATE-WORK-MEM

Another reason may be an exclusive lock on a row that you're trying
to index, but that would mean that some transaction on some client
somewhere is keeping that lock for a very long time (should not
happen). You can check the pg_locks and pg_stat_activity tables for
that.

Regards,
Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.

!DSPAM:737,47c159af233092392031086!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2008-02-24 12:35:49 Re: How to make update rapidly?
Previous Message Simon Riggs 2008-02-24 12:00:52 Re: unnesesary sorting after Merge Full Join