[postgis-users] Speed up query
Szymon Guz
mabewlun at gmail.com
Wed Oct 19 09:28:26 PDT 2011
On 19 October 2011 18:21, Gheorghiu, Mihai <mgheorghiu at chpmail.com> wrote:
> I have a query that places points in polygons:
>
> insert into results (
>
> select a.point_id, b.polygon_id
>
> from points a, polygons b
>
> where
> st_contains(ST_GeomFromWKB(ST_AsBinary(b.geog),4326),ST_GeomFromWKB(ST_AsBinary(a.geog),4326))
> = 't'
>
> );
>
> There are ~1M points and ~300k polygons. There are geo indexes on the geog
> columns of both tables.
>
> What changes would make the query faster?
>
>
>
> Thank you very much.
>
>
>
> Michael
>
... and the problem is?
Especially I'd like to know is the time, show us explain analyze of the
query and show table structures.
regards
Szymon
--
*http://simononsoftware.com/* <http://simononsoftware.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20111019/3f23df8a/attachment.html>
More information about the postgis-users
mailing list