diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-11-27 17:12:54 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-11-27 17:12:54 -0500 |
commit | 9f4563f743eab0682f908d51fa3a9c630b31322d (patch) | |
tree | d235b04260a11ff829d84f9a4ac7ebc705b69704 /src/backend/access/gist/gistutil.c | |
parent | c66e4f138b04d749a713ad075e16f3d60975f5ad (diff) | |
download | postgresql-9f4563f743eab0682f908d51fa3a9c630b31322d.tar.gz postgresql-9f4563f743eab0682f908d51fa3a9c630b31322d.zip |
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.
Diffstat (limited to 'src/backend/access/gist/gistutil.c')
-rw-r--r-- | src/backend/access/gist/gistutil.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index d91025dbe7f..8e57d907f86 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -19,6 +19,7 @@ #include "access/reloptions.h" #include "storage/indexfsm.h" #include "storage/lmgr.h" +#include "utils/builtins.h" /* * static *S used for temrorary storage (saves stack and palloc() call) @@ -538,8 +539,10 @@ gistpenalty(GISTSTATE *giststate, int attno, else if (isNullOrig && isNullAdd) penalty = 0.0; else - penalty = 1e10; /* try to prevent mixing null and non-null - * values */ + { + /* try to prevent mixing null and non-null values */ + penalty = get_float4_infinity(); + } return penalty; } |