On Fri, Dec 18, 2015 at 11:43 AM, Artur Zakirov <a.zaki...@postgrespro.ru> wrote: > Hello. > > PostgreSQL has a contrib module named pg_trgm. It is used to the fuzzy text > search. It provides some functions and operators for determining the > similarity of the given texts using trigram matching. > > At the moment, in pg_trgm both the similarity function and the % operator > match two strings expecting that they are similar entirely. But they give > bad results if we want to find documents by a query which is substring of a > document.
This is very interesting. I suspect the index will not be very useful in cases where the full string is much larger than the substring, because the limit will not be met often enough to rule out many rows just based on the index data. I have a pretty good test case to see. Can you update the patch to incorporate the recent changes committed under the thread "Patch: pg_trgm: gin index scan performance for similarity search"? They conflict with your changes. Thanks, Jeff -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers