Re: query with pg_trgm sometimes very slow

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Volker Böhm <volker(at)vboehm(dot)de>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: query with pg_trgm sometimes very slow
Date: 2015-09-03 23:19:40
Message-ID: CAGTBQpbfEhDz4vGabiZosn1j=iuEfAVOgwQfqf3iyeoE7hQ4zw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Sep 2, 2015 at 4:29 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> On Wed, Sep 2, 2015 at 7:00 AM, Volker Böhm <volker(at)vboehm(dot)de> wrote:
>>
>>
>>
>> CREATE INDEX trgm_adresse ON adressen.adresse USING gist
>> (normalize_string((btrim((((((((normalize_string((((COALESCE((vorname)::text,
>> ''::text) || ' '::text) || (name1)::text))::character varying,
>> (-1)))::text || ' '::text) || (normalize_string((COALESCE((strasse)::text,
>> ''::text))::character varying, (-2)))::text) || ' '::text) || (plz)::text)
>> || ' '::text) || (normalize_string((COALESCE((ort)::text,
>> ''::text))::character varying, (-3)))::text)))::character varying)
>> gist_trgm_ops);
>
>
>
> You might have better luck with gin_trgm_ops than gist_trgm_ops. Have you
> tried that?

I just had the exact same problem, and indeed gin fares much better.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Wei Shan 2015-09-04 06:13:04 Re: Server slowing down over time
Previous Message Sridhar N Bamandlapally 2015-09-03 13:40:11 Re: PostgreSQL Tuning for Messaging/Messenger/Chatting Application