mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-26 10:02:50 +00:00
3cda119445
git-svn-id: http://svn.osgeo.org/postgis/trunk@2 b70326c6-7e19-0410-871a-916f4a2858ee
59 lines
1.5 KiB
Plaintext
59 lines
1.5 KiB
Plaintext
You are now connected as new user postgres.
|
|
CREATE
|
|
|
|
--- test some of the searching capabilities
|
|
|
|
-- GiST index
|
|
|
|
CREATE INDEX quick_gist on test using gist (the_geom gist_geometry_ops) with (islossy);
|
|
CREATE
|
|
|
|
select * from test where the_geom && 'BOX3D(125 125,135 135)'::box3d order by num;
|
|
num | the_geom
|
|
------+------------------------------
|
|
2594 | POINT(130.504303 126.53112)
|
|
3618 | POINT(130.447205 131.655289)
|
|
7245 | POINT(128.10466 130.94133)
|
|
(3 rows)
|
|
|
|
|
|
set enable_seqscan = off;
|
|
SET VARIABLE
|
|
|
|
select * from test where the_geom && 'BOX3D(125 125,135 135)'::box3d order by num;
|
|
num | the_geom
|
|
------+------------------------------
|
|
2594 | POINT(130.504303 126.53112)
|
|
3618 | POINT(130.447205 131.655289)
|
|
7245 | POINT(128.10466 130.94133)
|
|
(3 rows)
|
|
|
|
|
|
|
|
--- RTree (not recommended)
|
|
|
|
CREATE INDEX quick_rt on test using rtree (the_geom rt_geometry_ops);
|
|
CREATE
|
|
set enable_seqscan = on;
|
|
SET VARIABLE
|
|
select * from test where the_geom && 'BOX3D(125 125,135 135)'::box3d order by num;
|
|
num | the_geom
|
|
------+------------------------------
|
|
2594 | POINT(130.504303 126.53112)
|
|
3618 | POINT(130.447205 131.655289)
|
|
7245 | POINT(128.10466 130.94133)
|
|
(3 rows)
|
|
|
|
set enable_seqscan = off;
|
|
SET VARIABLE
|
|
select * from test where the_geom && 'BOX3D(125 125,135 135)'::box3d order by num;
|
|
num | the_geom
|
|
------+------------------------------
|
|
2594 | POINT(130.504303 126.53112)
|
|
3618 | POINT(130.447205 131.655289)
|
|
7245 | POINT(128.10466 130.94133)
|
|
(3 rows)
|
|
|
|
|
|
|