mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-24 00:52:40 +00:00
Guard against crazy selectivity numbers
git-svn-id: http://svn.osgeo.org/postgis/trunk@13600 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
parent
a3e647241f
commit
79cebf829c
|
@ -1091,9 +1091,15 @@ estimate_join_selectivity(const ND_STATS *s1, const ND_STATS *s2)
|
|||
*/
|
||||
selectivity = val / ntuples_max;
|
||||
|
||||
/* Guard against over-estimates :) */
|
||||
if ( selectivity > 1.0 )
|
||||
selectivity = 1.0;
|
||||
/* Guard against over-estimates and crazy numbers :) */
|
||||
if ( isnan(selectivity) || ! isfinite(selectivity) || selectivity < 0.0 )
|
||||
{
|
||||
selectivity = DEFAULT_ND_JOINSEL;
|
||||
}
|
||||
else if ( selectivity > 1.0 )
|
||||
{
|
||||
selectivity = 1.0;
|
||||
}
|
||||
|
||||
return selectivity;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue