[GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread Greg Navis
`` My question is: is it possible to make `similarity` use the index? If not, is there a way to speed up the query above? Best regards -- Greg Navis I help tech companies to scale Heroku-hosted Rails apps. Free, biweekly scalability newsletter for SaaS CEOs <http://www.gregnavis.com/newsletter/>

[GENERAL] [pg_trgm] Per-query set_limit()

2016-06-03 Thread Greg Navis
rants). My question is: is there a better way? Best regards -- Greg Navis I help tech companies to scale Heroku-hosted Rails apps. Free, biweekly scalability newsletter for SaaS CEOs <http://www.gregnavis.com/newsletter/>

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread Greg Navis
te: > Hello. > > As I know 'lhs % rhs' is equivalent to 'similarity(lhs, rhs) >= > show_limit()'. > > And so your query should looks like this: > > SELECT * FROM restaurants WHERE city % 'warsw'; > > And it should use index. > &

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-03 Thread Greg Navis
a per-query basis. I might be able to block some time to contribute. Best regards -- Greg Navis I help tech companies to scale Heroku-hosted Rails apps. Free, biweekly scalability newsletter for SaaS CEOs <http://www.gregnavis.com/newsletter/>

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-04 Thread Greg Navis
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. Free, biweekly scalability newsletter for SaaS CEOs <

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-08 Thread Greg Navis
Thanks for the replies. On Sat, Jun 4, 2016 at 8:48 PM, Jeff Janes wrote: > On Sat, Jun 4, 2016 at 2:50 AM, Greg Navis wrote: > > Thanks for your replies. > > > > Sorry for confusion. Instead of `similarity(lhs, rhs) >= show_limit()`, > > which of course is compl

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-09 Thread Greg Navis
FUNCTION6 gtrgm_picksplit (internal, internal), FUNCTION7 gtrgm_same (gtrgm, gtrgm, internal), STORAGE gtrgm; Should my operator class mimic the one above? -- Greg Navis I help tech companies to scale Heroku-hosted Rails apps. Fre

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-11 Thread Greg Navis
ons: 1a. Is it possible to make `gtrgm_consistent` accept `text` or `pg_trgm_match` as the second argument? 1b. What's the equivalent of `match.match` and `match.threshold` (where `match` is a `pg_trgm_match`) in C? 2. What to do with `gtrgm_distance`? Thanks for help. -- Greg Navis I help t

Re: [GENERAL] [pg_trgm] Making similarity(?, ?) < ? use an index

2016-06-20 Thread Greg Navis
Artur, thanks for help. I managed to add the new strategy to the index. Hurray! I also discovered a bug in the process that I reported via the form. I still have a few questions: 1. Naming - pg_trgm_match, match, threshold, trgm_check_match, ThresholdStrategyNumber - are these good names? 2. I ma

Re: [GENERAL] Generating sample data

2016-12-27 Thread Greg Navis
In the Ruby land there's a gem called faker that allows you to generate fake data. However, I'm not sure it can generate data based on a schema so a little bit of scripting my be necessary. Would this approach work for you? Yours Greg