Re: Bug in GiST paring heap comparator

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in GiST paring heap comparator
Date: 2019-09-02 05:11:42
Message-ID: FB746354-B9E7-4CF4-9C26-F2471EEC5900@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> 2 сент. 2019 г., в 9:54, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru> написал(а):
>
> It appears to be related to implementation of comparison function in
> pairing heap used as priority queue for KNN. It used plain float
> comparison, which doesn't handle Inf and Nan values well. Attached
> patch replaced it with float8_cmp_internal().

Thanks! This patch fixes tests of my new GiST build :)

While patch looks good to me, I want to add that that there's a lot of <= and > comparisons in gistproc.c in function:

static float8
computeDistance(bool isLeaf, BOX *box, Point *point)

Should we fix this too? Or add comment why current code is safe.

Thanks!

Best regards, Andrey Borodin.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2019-09-02 06:28:02 Re: Bug in GiST paring heap comparator
Previous Message amul sul 2019-09-02 05:08:02 Re: [HACKERS] advanced partition matching algorithm for partition-wise join