Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9f4563f

Browse files
committed
Use IEEE infinity, not 1e10, for null-and-not-null case in gistpenalty().
Use of a randomly chosen large value was never exactly graceful, and now that there are penalty functions that are intentionally using infinity, it doesn't seem like a good idea for null-vs-not-null to be using something less.
1 parent c66e4f1 commit 9f4563f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/backend/access/gist/gistutil.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "access/reloptions.h"
2020
#include "storage/indexfsm.h"
2121
#include "storage/lmgr.h"
22+
#include "utils/builtins.h"
2223

2324
/*
2425
* static *S used for temrorary storage (saves stack and palloc() call)
@@ -538,8 +539,10 @@ gistpenalty(GISTSTATE *giststate, int attno,
538539
else if (isNullOrig && isNullAdd)
539540
penalty = 0.0;
540541
else
541-
penalty = 1e10; /* try to prevent mixing null and non-null
542-
* values */
542+
{
543+
/* try to prevent mixing null and non-null values */
544+
penalty = get_float4_infinity();
545+
}
543546

544547
return penalty;
545548
}

0 commit comments

Comments
 (0)