> create table xxx("position" public.geometry(PointZM,4326) not null); > create index ixd_xxx on xxx using gist(position gist_geometry_ops_nd); > insert into xxx select ST_SetSRID(ST_Makepoint(ST_X(position), ST_Y(position), date_part('epoch', timestamp), depth), 4326) from yyy limit 1000000; > analyze xxx; > explain analyze select * from xxx where position &&& ST_GeomFromText('LINESTRING(-180 -90 -1000000000, 180 90 1000000000)', 4326); Bitmap Heap Scan on xxx (cost=56.47..3147.37 rows=1000 width=320) (actual time=98.049..468.470 rows=524533 loops=1) Recheck Cond: ("position" &&& '01020000A0E61000000200000000000000008066C000000000008056C00000000065CDCDC1000000000080664000000000008056400000000065CDCD41'::geometry) -> Bitmap Index Scan on ixd_xxx (cost=0.00..56.22 rows=1000 width=0) (actual time=96.450..96.450 rows=524533 loops=1) Index Cond: ("position" &&& '01020000A0E61000000200000000000000008066C000000000008056C00000000065CDCDC1000000000080664000000000008056400000000065CDCD41'::geometry)