Re: BUG #19705: One NaN box makes a BRIN box_inclusion_ops index omit unrelated rows - Mailing list pgsql-bugs

From shihao zhong
Subject Re: BUG #19705: One NaN box makes a BRIN box_inclusion_ops index omit unrelated rows
Date
Msg-id CAGRkXqSN7vB_h41_jvsBbDb2sVNW=rmjxpndvL70oCDrYhbh=w@mail.gmail.com
Whole thread
In response to Re: BUG #19705: One NaN box makes a BRIN box_inclusion_ops index omit unrelated rows  (Manu <manuelreyesbravo@gmail.com>)
Responses Re: BUG #19705: One NaN box makes a BRIN box_inclusion_ops index omit unrelated rows
List pgsql-bugs
Hi Manu,

Thanks for the matrix.

> Most of what is left is ordering: the index scan fails with
> "inconsistent point values"

computeDistance() assumes low <= high and a query point without NaN.
So this doesn't need NaN rows. On a table with only finite values,
ORDER BY v <-> point '(1,NaN)' fails for all four GiST opclasses.

v6-0004 gives distance 0 to keys and query points with a NaN, as 0002
already does for internal keys. A box_ops leaf must be exact, and
index-only scans can't recheck, so it calls the operator instead.
With your script, GiST has 9 mismatches left on master, all point <@
polygon with a NaN vertex. GiST indexes built by unpatched master give
the same. 

0001 to 0003 are v5. 0003 is Kirill's polygon and circle patch after
pgindent.

> palloc_object(), which 18 does not have

18 has it. The conflict comes from 1b105f9472b, which changed those
lines in 19.

> I have not checked whether the patch there covers NaN too.

It doesn't. The v2 there leaves NaN on the same error on purpose.

Regards,
Shihao
Attachment

pgsql-bugs by date:

Previous
From: shihao zhong
Date:
Subject: Re: PostgreSQL 18.6/17.11: standby PANIC on restart after VM truncation
Next
From: Daniel Gustafsson
Date:
Subject: Re: autovacuum: automatically propagate updated parameters