I think the best way to solve your problem is to separate all of your 
geometries out into separate rows. This would take a fair bit of time to do 
initially, but then you could get your results faster. If there is other data 
which is attached to the whole collection of geometries, then put the 
geometries in their own table, with a reference back to the original table. 
Here is an example of what I mean:

the_table
---------
data1     <<geom1><geom2>>
data2     <<geom3>>

>> becomes >>

the_table              the_geom_table
---------              --------------
data1    1             1     <geom1>
                       1     <geom2>
data2    2             2     <geom3>

You can use your already existing primary key as the foriegn key reference for 
the geom_table. And if you want to get the original table back, do something 
like this:

SELECT max(data), collect(the_geom)
FROM the_table LEFT JOIN the_geom_table ON the_table.pkey = the_geom_table.fkey
GROUP BY the_table.pkey

HTH.
Chris


Quoting strk <strk@freek.keybit.net>:

> Hello,
> This will be a litte long...
> 
> I need to get all geometry objects overlapping
> a bounding box.
> 
> Now, for multigeometries I'd like to have only
> the subset of object overlapping the bounding box,
> 
> The overlap operators will not do this for me because
> it will check the overall bounding volume for all
> objects in geometry.
> 
> The solution could be a function like
> geoms_overlapping_box3d(geometry, box3d)
> 
> I think this will be usefull also for the mapserver
> connector, so that a smaller dataset is transferred ...
> 
> Right now I'm doing this by hand using postgis function
> bbox_of_point, bbox_of_polygon and friends, but since
> I also want to know the extent of the recordset returned
> I'm having an erroneus information (I'm getting the extent
> BEFORE the objects reduction).
> 
> Best would be:
>         SELECT extent(geoms_overlapping_box3d(the_geom, <bbox>))
>         WHERE the_geom && <bbox>;
> 
> The overlapping check in the WHERE clause could be instead expressed as:
>         SELECT extent(geoms_overlapping_box3d(the_geom, <bbox>)) as the_geom
>         WHERE geoms_overlapping_box3d(the_geom, <bbox>) IS NOT NULL;
> 
> But the first form is faster, isn't it ?
> 
> --strk;
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 





