From a9289708af0bff1c45deae79a7c8f6db75d8ca16 Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Wed, 22 Aug 2001 18:27:54 +0000
Subject: New contrib module for BTREE emulation in GiST. From Oleg Bartunov
 and Teodor Sigaev.

---
 contrib/btree_gist/sql/btree_gist.sql | 36 +++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 contrib/btree_gist/sql/btree_gist.sql

(limited to 'contrib/btree_gist/sql/btree_gist.sql')

diff --git a/contrib/btree_gist/sql/btree_gist.sql b/contrib/btree_gist/sql/btree_gist.sql
new file mode 100644
index 0000000000..d408105cc7
--- /dev/null
+++ b/contrib/btree_gist/sql/btree_gist.sql
@@ -0,0 +1,36 @@
+--
+-- first, define the datatype.  Turn off echoing so that expected file
+-- does not depend on contents of seg.sql.
+--
+\set ECHO none
+\i btree_gist.sql
+\set ECHO all
+
+create table inttmp (b int4);
+
+\copy inttmp from 'data/test_btree.data'
+
+create table tstmp ( t datetime );
+
+\copy tstmp from 'data/test_btree_ts.data'
+
+-- without idx
+
+select count(*) from inttmp where b <=10;
+
+select count(*) from tstmp where t < '2001-05-29 08:33:09+04';
+
+-- create idx
+
+create index aaaidx on inttmp using gist ( b );
+
+create index tsidx on tstmp using gist ( t );
+
+--with idx
+
+set enable_seqscan=off;
+
+select count(*) from inttmp where b <=10;
+
+select count(*) from tstmp where t < '2001-05-29 08:33:09+04';
+
-- 
cgit v1.2.1

