You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
here is the query produced by Porduct.search_by_title('windo') :
SELECT"products".*FROM"products"INNER JOIN (SELECT"products"."id"AS pg_search_id, (ts_rank(("products"."tsv"), (to_tsquery('simple', ''''||'windo'||''''||':*')), 0)) AS rank FROM"products"WHERE ((("products"."tsv") @@ (to_tsquery('simple', ''''||'windo'||''''||':*'))))) AS pg_search_0a3e27b8ca818264d75c8d
ON"products"."id"=pg_search_0a3e27b8ca818264d75c8d.pg_search_idORDER BYpg_search_0a3e27b8ca818264d75c8d.rankDESC, "products"."id"ASC
I'm wondering why is pg_search nesting queries (killing the perf) instead of building something like that :
SELECT"products".*, (ts_rank(("products"."tsv"), (to_tsquery('simple', ''''||'wind'||''''||':*')), 0)) AS rank
FROM"products"WHERE ((("products"."tsv") @@ (to_tsquery('simple', ''''||'wind'||''''||':*'))))
ORDER BY rank DESC, "products"."id"ASC
What am i missing ? thx for the help ...
The text was updated successfully, but these errors were encountered:
itkin
changed the title
pg_search_scope : how to prevent pg_search_0a3e27b8ca818264d75c8d ?
pg_search_scope : how to prevent auto builded nested queries ?
May 25, 2016
Hello,
I've the pg_search implemtentation :
here is the query produced by
Porduct.search_by_title('windo')
:I'm wondering why is pg_search nesting queries (killing the perf) instead of building something like that :
What am i missing ? thx for the help ...
The text was updated successfully, but these errors were encountered: