Re: [HACKERS] [PATCH] kNN for SP-GiST - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: [HACKERS] [PATCH] kNN for SP-GiST
Date
Msg-id 5A8DAE0D-E4E8-48A6-BC8C-048A240875A0@yandex-team.ru
Whole thread Raw
In response to Re: [HACKERS] [PATCH] kNN for SP-GiST  (Nikita Glukhov <n.gluhov@postgrespro.ru>)
Responses Re: [HACKERS] [PATCH] kNN for SP-GiST  (Nikita Glukhov <n.gluhov@postgrespro.ru>)
List pgsql-hackers
Hi!

> 14 июля 2018 г., в 1:31, Nikita Glukhov <n.gluhov@postgrespro.ru> написал(а):
>
> Attached  6th version of the patches.
> ...
>> 2. The patch leaves contribs intact. Do extensions with sp-gist opclasses
>> need to update it's behavior somehow to be used as-is? Or to support new
>> functionality?
>
> There are no SP-GiST opclasses in contrib/, so there is nothing to change in
> contrib/.  Moreover, existing extensions need to be updated only for support of
> new distance-ordered searches -- they need to implement distances[][] array
> calculation in their spgInnerConsistent() and spgLeafConsistent() support
> functions.
So, if extension will not update anything - it will keep all preexisting functionality, right?

I have some more nitpicks about naming
+        recheckQual = out.recheck;
+        recheckDist = out.recheckDistances;
Can we call this things somehow in one fashion?

Also, this my be a stupid question, but do we really need to differ this two recheck cases? It is certain that we
cannotmerge them? 

This seems strange if-formatting
+    /* If allTheSame, they should all or none of 'em match */
+    if (innerTuple->allTheSame)
+        if (out.nNodes != 0 && out.nNodes != nNodes)
+            elog(ERROR, "inconsistent inner_consistent results for allTheSame inner tuple");
+
+    if (out.nNodes) // few lines before you compare with 0

Best regards, Andrey Borodin.

pgsql-hackers by date:

Previous
From: Vik Fearing
Date:
Subject: Re: Allow to specify a index name as ANALYZE parameter
Next
From: Tomas Vondra
Date:
Subject: Re: [HACKERS] PATCH: multivariate histograms and MCV lists