summaryrefslogtreecommitdiffstats
path: root/contrib/btree_gin/sql/uuid.sql
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:46:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:46:48 +0000
commit311bcfc6b3acdd6fd152798c7f287ddf74fa2a98 (patch)
tree0ec307299b1dada3701e42f4ca6eda57d708261e /contrib/btree_gin/sql/uuid.sql
parentInitial commit. (diff)
downloadpostgresql-15-311bcfc6b3acdd6fd152798c7f287ddf74fa2a98.tar.xz
postgresql-15-311bcfc6b3acdd6fd152798c7f287ddf74fa2a98.zip
Adding upstream version 15.4.upstream/15.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'contrib/btree_gin/sql/uuid.sql')
-rw-r--r--contrib/btree_gin/sql/uuid.sql28
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/btree_gin/sql/uuid.sql b/contrib/btree_gin/sql/uuid.sql
new file mode 100644
index 0000000..3c141bd
--- /dev/null
+++ b/contrib/btree_gin/sql/uuid.sql
@@ -0,0 +1,28 @@
+set enable_seqscan=off;
+
+CREATE TABLE test_uuid (
+ i uuid
+);
+
+INSERT INTO test_uuid VALUES
+ ( '00000000-0000-0000-0000-000000000000' ),
+ ( '299bc99f-2f79-4e3e-bfea-2cbfd62a7c27' ),
+ ( '6264af33-0d43-4337-bf4e-43509b8a4be8' ),
+ ( 'ce41c936-6acb-4feb-8c91-852a673e5a5c' ),
+ ( 'd2ce731f-f2a8-4a2b-be37-8f0ba637427f' ),
+ ( 'ffffffff-ffff-ffff-ffff-ffffffffffff' )
+;
+
+CREATE INDEX idx_uuid ON test_uuid USING gin (i);
+
+SELECT * FROM test_uuid WHERE i<'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i;
+SELECT * FROM test_uuid WHERE i<='ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i;
+SELECT * FROM test_uuid WHERE i='ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i;
+SELECT * FROM test_uuid WHERE i>='ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i;
+SELECT * FROM test_uuid WHERE i>'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i;
+
+EXPLAIN (COSTS OFF) SELECT * FROM test_uuid WHERE i<'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i;
+EXPLAIN (COSTS OFF) SELECT * FROM test_uuid WHERE i<='ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i;
+EXPLAIN (COSTS OFF) SELECT * FROM test_uuid WHERE i='ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i;
+EXPLAIN (COSTS OFF) SELECT * FROM test_uuid WHERE i>='ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i;
+EXPLAIN (COSTS OFF) SELECT * FROM test_uuid WHERE i>'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i;