[postgis-devel] Issue 139 in postgis: Default selectivity returned when geometry used for restricted join comes from another table, but accurate when from WKT

codesite-noreply at google.com codesite-noreply at google.com
Thu Mar 19 15:38:21 PDT 2009


Comment #1 on issue 139 by lr1234567: Default selectivity returned when  
geometry used for restricted join comes from another table, but accurate  
when from WKT
http://code.google.com/p/postgis/issues/detail?id=139

Just to add my 2 cents.

I tested the above on "POSTGIS="1.3.5" GEOS="3.0.3-CAPI-1.4.2" PROJ="Rel.  
4.6.1, 21
August 2008" USE_STATS", PostgreSQL 8.3.7

  The above two return in about the same speed (though plans are very  
different --
(the _ST_Contains goes into a nested loop for the non constant geometry )  
but the &&
is applied first non-nested and both timings are about the same on my box  
92 ms)

But this one even on my 8.3.7 performs really badly (5-6 times worse than  
the above
queries - 600 ms) which is closer to what Robert was trying to do) and  
bizarrely
doesn't even try to use an index.  So there seems to be a distinct  
disadvantage to
doing subselects like this.

SELECT
  count(*)
FROM
  points
  where ST_Contains((SELECT shape FROM shapes WHERE shape_id = 1), point);

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings



More information about the postgis-devel mailing list