summaryrefslogtreecommitdiffstats
path: root/contrib/btree_gist/sql/varbit.sql
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/btree_gist/sql/varbit.sql')
-rw-r--r--contrib/btree_gist/sql/varbit.sql36
1 files changed, 36 insertions, 0 deletions
diff --git a/contrib/btree_gist/sql/varbit.sql b/contrib/btree_gist/sql/varbit.sql
new file mode 100644
index 0000000..e2a33b5
--- /dev/null
+++ b/contrib/btree_gist/sql/varbit.sql
@@ -0,0 +1,36 @@
+-- varbit check
+
+CREATE TABLE varbittmp (a varbit);
+
+\copy varbittmp from 'data/varbit.data'
+
+SET enable_seqscan=on;
+
+SELECT count(*) FROM varbittmp WHERE a < '1110100111010';
+
+SELECT count(*) FROM varbittmp WHERE a <= '1110100111010';
+
+SELECT count(*) FROM varbittmp WHERE a = '1110100111010';
+
+SELECT count(*) FROM varbittmp WHERE a >= '1110100111010';
+
+SELECT count(*) FROM varbittmp WHERE a > '1110100111010';
+
+CREATE INDEX varbitidx ON varbittmp USING GIST ( a );
+
+SET enable_seqscan=off;
+
+SELECT count(*) FROM varbittmp WHERE a < '1110100111010'::varbit;
+
+SELECT count(*) FROM varbittmp WHERE a <= '1110100111010'::varbit;
+
+SELECT count(*) FROM varbittmp WHERE a = '1110100111010'::varbit;
+
+SELECT count(*) FROM varbittmp WHERE a >= '1110100111010'::varbit;
+
+SELECT count(*) FROM varbittmp WHERE a > '1110100111010'::varbit;
+
+-- Test index-only scans
+SET enable_bitmapscan=off;
+EXPLAIN (COSTS OFF)
+SELECT a FROM bittmp WHERE a BETWEEN '1000000' and '1000001';