Re: [pg_trgm] Making similarity(?, ?) < ? use an index - Mailing list pgsql-general

From Artur Zakirov
Subject Re: [pg_trgm] Making similarity(?, ?) < ? use an index
Date
Msg-id 4650cc9c-d146-14ca-6718-7b32aa06765b@postgrespro.ru
Whole thread Raw
In response to Re: [pg_trgm] Making similarity(?, ?) < ? use an index  (Greg Navis <contact@gregnavis.com>)
Responses Re: [pg_trgm] Making similarity(?, ?) < ? use an index  (Greg Navis <contact@gregnavis.com>)
List pgsql-general
On 08.06.2016 12:16, Greg Navis wrote:
> Would this be a better plan then:
>
> 1. Add support for trigram operators.
> 2. Implement `issimilar(lhs, rhs, threshold)`.
> 3. Add `issimilar` to the trigram operator classes.

I think Tom's proposal with composite type is exelent option. If I
understand correctly it introduce a new function similarity_rhs(). You
can use it as the following:

SELECT * FROM restaurants WHERE city % similarity_rhs('warsw', 0.4);
SELECT * FROM cinemas WHERE name % similarity_rhs('warsw', 0.2);

This is what you need?

If I understand correctly your plan differs from Tom's proposal. And I
am afraid that you will do a waste work.

--
Artur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company


pgsql-general by date:

Previous
From: Greg Navis
Date:
Subject: Re: [pg_trgm] Making similarity(?, ?) < ? use an index
Next
From: Николай Бабаджанян
Date:
Subject: [C-function] Can SET_VARSIZE cause a memory leak?