From: Paul Ramsey Date: Fri, 16 Oct 2009 23:30:20 +0000 (+0000) Subject: Muck with index logging code. X-Git-Tag: 1.5.0b1~359 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32afce852801beeee758669e4dc1da3af1baefe7;p=postgis Muck with index logging code. git-svn-id: http://svn.osgeo.org/postgis/trunk@4661 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/geography_gist.c b/postgis/geography_gist.c index f88ba5522..498984516 100644 --- a/postgis/geography_gist.c +++ b/postgis/geography_gist.c @@ -41,6 +41,13 @@ */ #define LIMIT_RATIO 0.1 +/* +** For debugging +*/ +#if POSTGIS_DEBUG_LEVEL > 0 + static int geog_counter_leaf = 0; + static int geog_counter_internal = 0; +#endif /* ** GiST prototypes @@ -704,8 +711,11 @@ static inline bool geography_gist_consistent_leaf(GIDX *key, GIDX *query, Strate { bool retval; - POSTGIS_DEBUGF(4, "[GIST] leaf consistent, strategy: %d", strategy); - + POSTGIS_DEBUGF(4, "[GIST] leaf consistent, strategy [%d], count[%i], bounds[%.12g %.12g %.12g, %.12g %.12g %.12g]", + strategy, geog_counter_leaf++, + GIDX_GET_MIN(query, 0), GIDX_GET_MIN(query, 1), GIDX_GET_MIN(query, 2), + GIDX_GET_MAX(query, 0), GIDX_GET_MAX(query, 1), GIDX_GET_MAX(query, 2) ); + switch (strategy) { case RTOverlapStrategyNumber: @@ -735,7 +745,10 @@ static inline bool geography_gist_consistent_internal(GIDX *key, GIDX *query, St { bool retval; - POSTGIS_DEBUGF(4, "[GIST] internal consistent, strategy: %d", strategy); + POSTGIS_DEBUGF(4, "[GIST] internal consistent, strategy [%d], count[%i], bounds[%.12g %.12g %.12g, %.12g %.12g %.12g]", + strategy, geog_counter_internal++, + GIDX_GET_MIN(query, 0), GIDX_GET_MIN(query, 1), GIDX_GET_MIN(query, 2), + GIDX_GET_MAX(query, 0), GIDX_GET_MAX(query, 1), GIDX_GET_MAX(query, 2) ); switch (strategy) { diff --git a/postgis/lwgeom_gist.c b/postgis/lwgeom_gist.c index c9b8bae58..f89c1a1f0 100644 --- a/postgis/lwgeom_gist.c +++ b/postgis/lwgeom_gist.c @@ -648,22 +648,9 @@ lwgeom_rtree_internal_consistent(BOX2DFLOAT4 *key, BOX2DFLOAT4 *query, (query->ymin<= key->ymax))); -#if POSTGIS_DEBUG_LEVEL >=4 - /*keep track and report info about how many times this is called */ - if (counter_intern == 0) - { - POSTGIS_DEBUGF(4, "search bounding box is: <%.16g %.16g,%.16g %.16g> - size box2d= %ld", - query->xmin,query->ymin,query->xmax,query->ymax,sizeof(BOX2DFLOAT4)); - - } - - - POSTGIS_DEBUGF(4, "%i:(int)<%.8g %.8g,%.8g %.8g>&&<%.8g %.8g,%.8g %.8g> %i",counter_intern,key->xmin,key->ymin,key->xmax,key->ymax, + POSTGIS_DEBUGF(4, "%i:(int)<%.8g %.8g,%.8g %.8g>&&<%.8g %.8g,%.8g %.8g> %i",counter_intern++,key->xmin,key->ymin,key->xmax,key->ymax, query->xmin,query->ymin,query->xmax,query->ymax, (int) retval); - counter_intern++; -#endif - return(retval); break; @@ -726,13 +713,11 @@ lwgeom_rtree_leaf_consistent(BOX2DFLOAT4 *key, ((query->ymax>= key->ymax) && (query->ymin<= key->ymax))); -#if POSTGIS_DEBUG_LEVEL >= 4 /*keep track and report info about how many times this is called */ POSTGIS_DEBUGF(4, "%i:gist test (leaf) <%.6g %.6g,%.6g %.6g> && <%.6g %.6g,%.6g %.6g> --> %i", - counter_leaf,key->xmin,key->ymin,key->xmax,key->ymax, + counter_leaf++,key->xmin,key->ymin,key->xmax,key->ymax, query->xmin,query->ymin,query->xmax,query->ymax, (int) retval); - counter_leaf++; -#endif + return(retval); break;