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

From Greg Navis
Subject Re: [pg_trgm] Making similarity(?, ?) < ? use an index
Date
Msg-id CAA6WWt-KsLcxnm+PS6WmB4muJeWHL245GsusXgow0j1hJMQRRQ@mail.gmail.com
Whole thread Raw
In response to Re: [pg_trgm] Making similarity(?, ?) < ? use an index  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: [pg_trgm] Making similarity(?, ?) < ? use an index
List pgsql-general
Thanks for your replies.

Sorry for confusion. Instead of `similarity(lhs, rhs) >= show_limit()`, which of course is completely equivalent to `lhs % rhs`, I wanted to write `similarity(lhs, rhs) >= my_custom_threshold`. It seems that the approach with ternary operators is quite a bit of work. I might have a simpler idea:

pg_trgm also provides `<->` but it seems this operator doesn't use indexes either. It seems the shortest path to per-query thresholds, without compromising the design, is making this operator use the index. Please help me understand whether my reasoning is correct. If it is, I'd appreciate a high-level overview of what needs to be done. I can block a few hours to work on this in the upcoming weeks.

Best regards
-- 
Greg Navis
I help tech companies to scale Heroku-hosted Rails apps.

pgsql-general by date:

Previous
From: rverghese
Date:
Subject: Re: Partitioned postgres tables don't need update trigger??
Next
From: Andrew Beverley
Date:
Subject: Actual rows significantly more than estimated during many joins