mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
config
contrib
adddepend
array
btree_gist
chkpass
cube
dbase
dblink
dbmirror
dbsize
earthdistance
findoidjoins
fulltextindex
fuzzystrmatch
intagg
intarray
ipc_check
isbn_issn
lo
ltree
mSQL-interface
mac
miscutil
mysql
noupdate
oid2name
oracle
pg_autovacuum
pg_dumplo
pg_logger
pg_trgm
pg_upgrade
pgbench
pgcrypto
pgstattuple
reindexdb
rserv
rtree_gist
bench
data
expected
sql
rtree_gist.sql
Makefile
README.rtree_gist
rtree_gist.c
rtree_gist.sql.in
seg
spi
start-scripts
string
tablefunc
tips
tools
tsearch
tsearch2
userlock
vacuumlo
xml
xml2
Makefile
README
contrib-global.mk
doc
src
COPYRIGHT
GNUmakefile.in
Makefile
README
README.CVS
aclocal.m4
configure
configure.in
48 lines
861 B
PL/PgSQL
48 lines
861 B
PL/PgSQL
--
|
|
-- 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);
|
|
|
|
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);
|
|
|
|
SELECT count(*)
|
|
FROM polytmp
|
|
WHERE p && '(1000,1000),(0,0)'::polygon;
|