Re: Re: Optimizing pg_trgm makesign() (was Re: WIP: Fast GiST index build) - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Re: Optimizing pg_trgm makesign() (was Re: WIP: Fast GiST index build)
Date
Msg-id CAPpHfdsc0k5wH6NjnfcN1ZRu5TXYxEhu4PSXOQmdrRjO2eds2A@mail.gmail.com
Whole thread Raw
In response to Re: Re: Optimizing pg_trgm makesign() (was Re: WIP: Fast GiST index build)  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Re: Optimizing pg_trgm makesign() (was Re: WIP: Fast GiST index build)
List pgsql-hackers
On Fri, Sep 30, 2011 at 1:08 AM, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote:
At every call, gtrgm_penalty() has to calculate the signature for newitem, using makesign(). That's an enormous waste of effort, but there's currently no way gtrgm_penalty() to avoid that. If we could call makesign() only on the first call in the loop, and remember it for the subsequent calls, that would eliminate the need for any micro-optimization in makesign() and make inserting into a trigram index much faster (including building the index from scratch)
Isn't it possible to cache signature of newitem in gtrgm_penalty like gtrgm_consistent do this for query?

------
With best regards,
Alexander Korotkov.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_upgrade - add config directory setting
Next
From: Bruce Momjian
Date:
Subject: Re: fix for pg_upgrade