[postgis-devel] Re: postgis/geos profiling

strk at refractions.net strk at refractions.net
Fri Sep 24 05:38:49 PDT 2004


Some profiling over distance() vs intersects().

The profiler script is in CVS (utils/profile_intersects.pl).

The scripts takes two spatial tables.
The first is for extent extraction.
The extent of first table is subdivided in BPSxBPS cells
and each of the features in second spatial table is
checked for intersection with each cell.

  - index scan is been disabled ! -

At the end of each BPS query loop a summary is printed
containing worst and best runs in percentile one over
the other (distance, intersects).

't' is the number of queries returning 'true'.

  Type: MULTILINESTRING
  Rows: 3183
  bps   t       intr    dist    intr/dist
----------------------------------------------------------
    2   371     145254  152154  0.95
    2   769     225747  159403  1.41
    2   1801    467103  149191  3.13
    2   283     118823  155096  0.76
    2    (min/max/avg)          0.76    3.13    1.56
    2   worst   313%    131%
    2   best    31%     76%

These are large boxes. The cell which contains MORE intersecting
features is the one in which intersects() does is worst job.
The one with less intersecting cells give the best intersects() run.

  Rows: 3183
  bps   t       intr    dist    intr/dist
----------------------------------------------------------
    3   0       49965   158799  0.31
    3   346     134842  161126  0.83
    3   325     118629  165073  0.71
    3   804     236623  153393  1.54
    3   459     163660  156635  1.04
    3   160     87627   161721  0.54
    3   872     262444  156008  1.68
    3   243     109996  159614  0.68
    3   51      61193   162184  0.37
    3    (min/max/avg)          0.31    1.68    0.85
    3   worst   168%    322%
    3   best    59%     31%

Here the relation between true values and intr/dist factor
still holds true. 

--strk;



More information about the postgis-devel mailing list