Re: knngist - 0.8

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: teodor(at)sigaev(dot)ru, pgsql-hackers(at)postgresql(dot)org
Subject: Re: knngist - 0.8
Date: 2010-08-08 20:28:34
Message-ID: AANLkTi=h8thE74d0K_A-g=0TSLbZuNSHicH7hGZWGnD0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 <robertmhaas(at)gmail(dot)com> wrote:

> 2010/7/29 Alexander Korotkov <aekorotkov(at)gmail(dot)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
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2010-08-08 20:41:27 Re: pg_stat_user_functions' notion of user
Previous Message Tom Lane 2010-08-08 19:18:17 Re: Review: Re: [PATCH] Re: [HACKERS] Adding xpath_exists function