From: | Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru> |
---|---|
To: | Greg Navis <contact(at)gregnavis(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: [pg_trgm] Making similarity(?, ?) < ? use an index |
Date: | 2016-06-08 10:10:37 |
Message-ID: | 4650cc9c-d146-14ca-6718-7b32aa06765b@postgrespro.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Николай Бабаджанян | 2016-06-08 11:47:29 | [C-function] Can SET_VARSIZE cause a memory leak? |
Previous Message | Greg Navis | 2016-06-08 09:16:17 | Re: [pg_trgm] Making similarity(?, ?) < ? use an index |