From: Sandro Santilli Date: Fri, 22 Apr 2005 01:07:09 +0000 (+0000) Subject: Fixed bug in join selectivity estimator returning invalid estimates (>1) X-Git-Tag: pgis_1_1_0~402 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fcbf304c984a30b4d3e539e00e785bed4d4c83fe;p=postgis Fixed bug in join selectivity estimator returning invalid estimates (>1) git-svn-id: http://svn.osgeo.org/postgis/trunk@1669 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/lwgeom/lwgeom_estimate.c b/lwgeom/lwgeom_estimate.c index 1338c52a7..d5bee8807 100644 --- a/lwgeom/lwgeom_estimate.c +++ b/lwgeom/lwgeom_estimate.c @@ -984,6 +984,9 @@ Datum LWGEOM_gist_joinsel(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(DEFAULT_GEOMETRY_JOINSEL); } + if ( rows_returned > total_tuples ) + PG_RETURN_FLOAT8(1.0); + PG_RETURN_FLOAT8(rows_returned / total_tuples); } @@ -2482,6 +2485,9 @@ Datum LWGEOM_estimated_extent(PG_FUNCTION_ARGS) /********************************************************************** * $Log$ + * Revision 1.32 2005/04/22 01:07:09 strk + * Fixed bug in join selectivity estimator returning invalid estimates (>1) + * * Revision 1.31 2005/04/18 14:12:43 strk * Slightly changed standard deviation computation to be more corner-case-friendly. *