[postgis-users] find adjacent polygons query problem

Paul Ramsey pramsey at refractions.net
Sun Jul 9 17:58:06 PDT 2006


What are your versions? Have you run VACCUM ANALYZE?
P

On 9-Jul-06, at 2:40 PM, Alex Kuznetsov wrote:

> Hello List!
>
> If I run the query like this:
>
> SELECT a.caname FROM ca23jan06 a, ca23jan06 b
> WHERE b.caname = 'Cataraqui Region' AND a.the_geom && b.the_geom
> GROUP BY a.caname ORDER BY a.caname;
>
> it returns the result instantly,
> but if I try something like this:
>
> SELECT a.caname FROM ca23jan06 a, ca23jan06 b
> WHERE b.caname = 'Cataraqui Region' AND a.the_geom && b.the_geom
> AND distance(a.the_geom , b.the_geom) = 0
> GROUP BY a.caname ORDER BY a.caname;
>
> or this:
>
> SELECT a.caname FROM ca23jan06 a, ca23jan06 b
> WHERE b.caname = 'Cataraqui Region' AND a.the_geom && b.the_geom
> AND touches(a.the_geom , b.the_geom)
> GROUP BY a.caname ORDER BY a.caname;
>
> the process takes forever and I have to interrupt this violently
>
> I've built oid index for ca23jan06 but it doesn't help
> What can be the cause of such a behavior?
>
> Any idea will be much appreciated,
>
> Thank you,
>
> Alex Kuznetsov
> SSFC GIS student
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list