Re: GiST index build versus NaN coordinates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: GiST index build versus NaN coordinates
Date: 2016-07-12 19:24:01
Message-ID: 1391.1468351441@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> I looked into the problem reported in bug #14238,
> https://www.postgresql.org/message-id/20160708151747.1426.60150@wrigleys.postgresql.org
> I think that probably the most reasonable answer is to replace all the
> raw "double" comparisons in this code with float8_cmp_internal() or
> something that's the moral equivalent of that. Does anyone want to
> propose something else?

Here's a draft patch that modifies gistproc.c to treat NaNs essentially
as though they are infinities. I've only touched the code associated
with GiST index insertion, not with searches, so it's quite possible that
searches will still not work right in the presence of NaNs. However,
this does fix the index-build infinite loop complained of originally.

I've not yet looked at the SPGiST issues reported by Andreas.

regards, tom lane

Attachment Content-Type Size
handle-nans-in-gist-geometric-indexes.patch text/x-diff 13.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2016-07-12 19:29:10 DO with a large amount of statements get stuck with high memory consumption
Previous Message David Kellum 2016-07-12 19:04:49 Re: BUG #14245: Segfault on weird to_tsquery