[postgis-users] Re: truly_inside
georef at tie.cl
Mon Oct 21 12:28:06 PDT 2002
Thanks to all of you !! ... and people says Opensource have no "support",
the simple && solutions works great.
I will try a benchmark against mapinfo intersect, after running the more
sofisticated solution with the gist index.
----- Original Message -----
From: David Blasby <dblasby at refractions.net>
To: <postgis-users at postgis.refractions.net>
Sent: Monday, October 21, 2002 2:17 PM
Subject: Re: [postgis-users] Re: truly_inside
> Juanse wrote:
> > Is the distance() method too slow, i am runnig
> > select count(*) t0,t1 where distance(t0.wkb_geomtry, t1.wkb_geometry)= 0
> > (t0.nombre = 'Galvarino')
> > and it takes for ages
> > t0 have 31 records
> > t1 have 1321 records
> try an:
> explain select count(*) t0,t1 where distance(t0.wkb_geomtry,
> (t0.nombre = 'Galvarino')
> you're probably doing a full join - thats 40,000 distance() calculations!
> You can do this to use an index and speed things up considerably:
> SELECT ... FROM t0,t1 WHERE t0.wkb_geometry && t1.wkb_geometry
> AND distance(t0.wkb_geomtry, t1.wkb_geometry)= 0
> This will first ensure that the geometry's bounding boxes intersect (&&),
> do the expensive distance calculation.
> Dont forget to make a GiST index on t0 and t1.
> postgis-users mailing list
> postgis-users at postgis.refractions.net
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.401 / Virus Database: 226 - Release Date: 10/10/02
More information about the postgis-users