[postgis-devel] 3D spatial index is not working

Paul Ramsey pramsey at opengeo.org
Thu Dec 29 13:03:21 PST 2011


Jose,
What syntax did you use to create your index? In order to get an index
that can do 3-d and 4-d ops, you need to use the appropriate opclass.

create index my_gix on mytable using gist (geom gist_geometry_nd_ops);

Hopefully this works,
Paul

On Thu, Dec 29, 2011 at 12:54 PM, Jose Carlos Martinez Llario
<jomarlla at cgf.upv.es> wrote:
> Dear PostGIS team,
>
> p3d is a table with points in 3d and an spatial index on geom.
> Explain analyze shows 3d spatial index is not working.  I forced PostgreSQL
> to use index with SET enable_seqscan = false just in case.
>
> r8612-1=# explain analyze select count(*) from p3d where geom &&&
> 'LINESTRING (690388.797 4369343.266 600,690906.097 4369841.766
> 600.5)'::geometry;
> QUERY PLAN
> Aggregate  (cost=10000002117.72..10000002117.73 rows=1 width=0) (actual
> time=54.430..54.431 rows=1 loops=1)
>  ->  Seq Scan on p3d  (cost=10000000000.00..10000002117.50 rows=87 width=0)
> (actual time=0.041..53.394 rows=2148 loops=1)
>        Filter: (geom &&&
> '0102000080020000004E621098A9112541DD2406D1EFAA50410000000000C08240E7FBA931B4152541DD2406716CAB50410000000000C48240'::geometry)
>
> Has PostGIS 2.0 already implemented 3d spatial index right?
> What Im doing wrong then?
>
> Im using trunk r8612.
>
> Thanks in advance,
> Best,
> Jose
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel



More information about the postgis-devel mailing list