]> granicus.if.org Git - postgis/commitdiff
Muck with index logging code.
authorPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 16 Oct 2009 23:30:20 +0000 (23:30 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 16 Oct 2009 23:30:20 +0000 (23:30 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4661 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/geography_gist.c
postgis/lwgeom_gist.c

index f88ba5522ae998ea83e58533236c05957cad13ae..498984516dcf086dae2d51766fdd28a41d3e3514 100644 (file)
 */
 #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)
        {
index c9b8bae58180f6a8384ea6c3906f4bf28703317c..f89c1a1f0d4df244bcf48c9151c936d8693e5a78 100644 (file)
@@ -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;