In gist consitent method support only filtering strategies. For such strategies consistent method returns true if subtree can contain matching node and false otherwise. Knngist introduce also order by strategies. For filtering strategies knngist consistent method returns 0 if subtree can contain matching node and -1 otherwise. For order by strategies knngist consistent method returns minimal possible distance in subtree. I think we can use consistent method with order by strategies not only for ordering but also for filtering. If query contain assertion that distance is less than some value, than we can call consistent method with order by strategy and compare result with query value in order to determine whether scan subtree. Such approach can give benefit when we need to filter by similarity. For example, in pg_trgm "%" is used for similarity filtering, but similarity threshold is global for session. That's why we can't create complex queries which contain similarity filtering with different threshold.
---- With best regards, Alexander Korotkov. On Mon, Aug 2, 2010 at 8:14 PM, Robert Haas <robertmh...@gmail.com> wrote: > 2010/7/29 Alexander Korotkov <aekorot...@gmail.com>: > > But, in pg_trgm it makes it possible to combine different similarity > levels > > in one query. For example: > > select * from test_trgm order by t <-> 'asdf' < 0.5 or t <-> 'qwer' < > 0.4; > > Is there any chance to handle this syntax also? > > Maybe I'm missing something, but I don't think that ORDER BY clause > makes much sense. OR is going to reduce a true or false value - and > it's usually not that interesting to order by a column that can only > take one of two values. > > Am I confused? > > -- > Robert Haas > EnterpriseDB: http://www.enterprisedb.com > The Enterprise Postgres Company >