diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-05-31 18:27:18 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-05-31 18:27:18 +0000 |
commit | 16f85390f205dafc9d663c3bf777d682ccbdd1dd (patch) | |
tree | 440aba94402949b0414353adc6d1c94ca2bdbf48 /contrib/rtree_gist/sql | |
parent | 3043810d977b8197f9671c98439104db80b8e914 (diff) | |
download | postgresql-16f85390f205dafc9d663c3bf777d682ccbdd1dd.tar.gz postgresql-16f85390f205dafc9d663c3bf777d682ccbdd1dd.zip |
Support for emulating RTREE indexing in GiST. Contributed by
Oleg Bartunov and Teodor Sigaev.
Diffstat (limited to 'contrib/rtree_gist/sql')
-rw-r--r-- | contrib/rtree_gist/sql/rtree_gist.sql | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/contrib/rtree_gist/sql/rtree_gist.sql b/contrib/rtree_gist/sql/rtree_gist.sql new file mode 100644 index 00000000000..a0506213227 --- /dev/null +++ b/contrib/rtree_gist/sql/rtree_gist.sql @@ -0,0 +1,38 @@ +-- +-- first, define the datatype. Turn off echoing so that expected file +-- does not depend on contents of seg.sql. +-- +\set ECHO none +\i rtree_gist.sql +\set ECHO all + +create table boxtmp (b box); + +\copy boxtmp from 'data/test_box.data' + +select count(*) from boxtmp where b && '(1000,1000,0,0)'::box; + +create index bix on boxtmp using rtree (b); + +select count(*) from boxtmp where b && '(1000,1000,0,0)'::box; + +drop index bix; + +create index bix on boxtmp using gist (b gist_box_ops); + +select count(*) from boxtmp where b && '(1000,1000,0,0)'::box; + +create table polytmp (p polygon); + +\copy polytmp from 'data/test_box.data' + +create index pix on polytmp using rtree (p); + +select count(*) from polytmp where p && '(1000,1000),(0,0)'::polygon; + +drop index pix; + +create index pix on polytmp using gist (p gist_poly_ops) with(islossy); + +select count(*) from polytmp where p && '(1000,1000),(0,0)'::polygon; + |