Some FTS tricks

Oct 05, 2016 00:33

These three queries produces the same result and took 183 ms, 247 ms and 329 ms !

Remember:
1. Always specify fts configuration, see queries 1 and 2. The difference in plans is

Sort Key: ((fts <=> '''tupl'''::tsquery)) - 183 ms
Sort Key: ((fts <=> to_tsquery('tuple'::text))) - 247 ms
to_tsquery(regconfig, text) is immutable and is ( Read more... )

fts, pg, pgen

Leave a comment

Comments 2

order operator ext_3851811 October 12 2016, 09:34:47 UTC
What's this <=> operator in your ORDERs? Same as ts_rank_cd()? I don't seem to have it running pg 9.6.

Reply


obartunov October 17 2016, 18:10:27 UTC
<=> is a distance operator, it's based on combination of ts_rank() and ts_rank_cd(). You can read more details in my talk in Dallas http://www.sai.msu.su/~megera/postgres/talks/pgopen-2016-rum.pdf

Reply


Leave a comment

Up