Counter-intuitively, do this (collecting all your smaller geometries into one big one to test other features for containment) is probably going to make your system SLOWER for any given containment query.

As a collection of small objects, the index system can partition out the few small objects that need to be tested for any given candidate feature. As a single large object, the same large object will have to be de-serialized, and every edge of that object tested against the candidate.

Paul

Kevin Neufeld wrote:
Scott Schulthess wrote:

Hello everyone,

I have a table with 60,000 rows.

Each row has a geometry field that is a polygon.

I want to concatenate all of these geometry objects into one big multipolygon, or at the very least, a polygon, so I can query easily on one geometry object to see if a point lies within that multipolygon.

 ...

Use collect(geometry set).

CREATE TABLE my_multi_polygon AS
 SELECT collect(geom) AS geom
 FROM my_poly_table;

-------------
Kevin Neufeld
Software Developer
Refractions Research Inc.
300-1207 Douglas St.
Victoria, B.C., V8W 2E7

Phone: (250) 383-3022
Email: [EMAIL PROTECTED]

_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users


--

  Paul Ramsey
  Refractions Research
  http://www.refractions.net
  [EMAIL PROTECTED]
  Phone: 250-383-3022
  Cell: 250-885-0632
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to