Re: [PATCH] kNN for btree - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: [PATCH] kNN for btree
Date
Msg-id CAPpHfdtcVkX6CAL-dZj9WVUY6-RQhjdyYxiuV+eObrFGRm0v1w@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] kNN for btree  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: [PATCH] kNN for btree
List pgsql-hackers
On Tue, Sep 3, 2019 at 2:19 AM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>
> On 2019-Sep-03, Alexander Korotkov wrote:
>
> > I think patches 0001-0008 are very clear and extends our index-AM
> > infrastructure in query straightforward way.  I'm going to propose
> > them for commit after some further polishing.
>
> Hmm.  Why is 0001 needed?  I see that 0005 introduces a call to that
> function, but if attnum == 0 then it doesn't call it.  Maybe it was
> necessary in an older version of the patch?

Regarding "attno >= 1" check I agree with you.  It should be changed
to assert.  But "attno <= rd_index->indnkeyatts" check appears to be
needed for current code already.  It appears that gistproperty() can
ask get_index_column_opclass() for non-key attribute.  Then
get_index_column_opclass()  returns garbage past oidvector value.
Typically get_opclass_opfamily_and_input_type() doesn't find this
garbage opclass oid and gistproperty() returns null as expected.  But
this is bug and needs to be fixed.

I'm going to push 0001 changing "attno >= 1" to assert.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: BUG #15977: Inconsistent behavior in chained transactions
Next
From: Andrew Dunstan
Date:
Subject: Re: MSVC buildfarm critters are not running modules' TAP tests