]> granicus.if.org Git - postgis/commitdiff
#2543, invalid join selectivity error from simple query
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 4 Feb 2014 22:44:33 +0000 (22:44 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 4 Feb 2014 22:44:33 +0000 (22:44 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@12222 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
postgis/gserialized_estimate.c

diff --git a/NEWS b/NEWS
index 98f61756032ab1fbafdbe17e1cbe3a4b4bd68f8c..51e8fefa17f77bde733356c25f4629fd103f2f95 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -43,6 +43,7 @@ PostGIS 2.2.0
            raster_columns and raster_overviews
   - #2532, Add missing raster/geometry commutator operators
   - #2540, Change GUC name for GDAL_DATA to postgis.gdal_datapath
+  - #2543, invalid join selectivity error from simple query
   - #2552, Fix handling of NULL raster in ST_AsTIFF, ST_AsPNG
            and ST_AsJPEG
   - #2555, Fix parsing issue of range arguments of ST_Reclass
index 43101d9284e54d1a22194ce785398104fb3b43b9..1add23d4209b3626424d1be0b7f0e3dc96f345a2 100644 (file)
@@ -1074,6 +1074,10 @@ estimate_join_selectivity(const ND_STATS *s1, const ND_STATS *s2)
         * number of rows that can be returned.
         */
        selectivity = val / ntuples_max;
+
+    /* Guard against over-estimates :) */
+    if ( selectivity > 1.0 ) 
+        selectivity = 1.0;
        
        return selectivity;
 }