diff options
Diffstat (limited to 'contrib/btree_gin/expected')
30 files changed, 1622 insertions, 0 deletions
diff --git a/contrib/btree_gin/expected/bit.out b/contrib/btree_gin/expected/bit.out new file mode 100644 index 0000000..3c00a20 --- /dev/null +++ b/contrib/btree_gin/expected/bit.out @@ -0,0 +1,44 @@ +set enable_seqscan=off; +CREATE TABLE test_bit ( + i bit(3) +); +INSERT INTO test_bit VALUES ('001'),('010'),('011'),('100'),('101'),('110'); +CREATE INDEX idx_bit ON test_bit USING gin (i); +SELECT * FROM test_bit WHERE i<'100'::bit(3) ORDER BY i; + i +----- + 001 + 010 + 011 +(3 rows) + +SELECT * FROM test_bit WHERE i<='100'::bit(3) ORDER BY i; + i +----- + 001 + 010 + 011 + 100 +(4 rows) + +SELECT * FROM test_bit WHERE i='100'::bit(3) ORDER BY i; + i +----- + 100 +(1 row) + +SELECT * FROM test_bit WHERE i>='100'::bit(3) ORDER BY i; + i +----- + 100 + 101 + 110 +(3 rows) + +SELECT * FROM test_bit WHERE i>'100'::bit(3) ORDER BY i; + i +----- + 101 + 110 +(2 rows) + diff --git a/contrib/btree_gin/expected/bool.out b/contrib/btree_gin/expected/bool.out new file mode 100644 index 0000000..efb3e1e --- /dev/null +++ b/contrib/btree_gin/expected/bool.out @@ -0,0 +1,119 @@ +set enable_seqscan=off; +CREATE TABLE test_bool ( + i boolean +); +INSERT INTO test_bool VALUES (false),(true),(null); +CREATE INDEX idx_bool ON test_bool USING gin (i); +SELECT * FROM test_bool WHERE i<true ORDER BY i; + i +--- + f +(1 row) + +SELECT * FROM test_bool WHERE i<=true ORDER BY i; + i +--- + f + t +(2 rows) + +SELECT * FROM test_bool WHERE i=true ORDER BY i; + i +--- + t +(1 row) + +SELECT * FROM test_bool WHERE i>=true ORDER BY i; + i +--- + t +(1 row) + +SELECT * FROM test_bool WHERE i>true ORDER BY i; + i +--- +(0 rows) + +SELECT * FROM test_bool WHERE i<false ORDER BY i; + i +--- +(0 rows) + +SELECT * FROM test_bool WHERE i<=false ORDER BY i; + i +--- + f +(1 row) + +SELECT * FROM test_bool WHERE i=false ORDER BY i; + i +--- + f +(1 row) + +SELECT * FROM test_bool WHERE i>=false ORDER BY i; + i +--- + f + t +(2 rows) + +SELECT * FROM test_bool WHERE i>false ORDER BY i; + i +--- + t +(1 row) + +EXPLAIN (COSTS OFF) SELECT * FROM test_bool WHERE i<true ORDER BY i; + QUERY PLAN +------------------------------------------- + Sort + Sort Key: i + -> Bitmap Heap Scan on test_bool + Recheck Cond: (i < true) + -> Bitmap Index Scan on idx_bool + Index Cond: (i < true) +(6 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_bool WHERE i<=true ORDER BY i; + QUERY PLAN +------------------------------------------- + Sort + Sort Key: i + -> Bitmap Heap Scan on test_bool + Recheck Cond: (i <= true) + -> Bitmap Index Scan on idx_bool + Index Cond: (i <= true) +(6 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_bool WHERE i=true ORDER BY i; + QUERY PLAN +----------------------------- + Sort + Sort Key: i + -> Seq Scan on test_bool + Filter: i +(4 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_bool WHERE i>=true ORDER BY i; + QUERY PLAN +------------------------------------------- + Sort + Sort Key: i + -> Bitmap Heap Scan on test_bool + Recheck Cond: (i >= true) + -> Bitmap Index Scan on idx_bool + Index Cond: (i >= true) +(6 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_bool WHERE i>true ORDER BY i; + QUERY PLAN +------------------------------------------- + Sort + Sort Key: i + -> Bitmap Heap Scan on test_bool + Recheck Cond: (i > true) + -> Bitmap Index Scan on idx_bool + Index Cond: (i > true) +(6 rows) + diff --git a/contrib/btree_gin/expected/bpchar.out b/contrib/btree_gin/expected/bpchar.out new file mode 100644 index 0000000..2eb8855 --- /dev/null +++ b/contrib/btree_gin/expected/bpchar.out @@ -0,0 +1,109 @@ +set enable_seqscan=off; +CREATE TABLE test_bpchar ( + i char(10) +); +INSERT INTO test_bpchar VALUES ('a'),('ab'),('abc'),('abc '),('abb'),('axy'),('xyz'),('xyz '); +CREATE INDEX idx_bpchar ON test_bpchar USING gin (i); +SELECT * FROM test_bpchar WHERE i<'abc' ORDER BY i; + i +------------ + a + ab + abb +(3 rows) + +SELECT * FROM test_bpchar WHERE i<='abc' ORDER BY i; + i +------------ + a + ab + abb + abc + abc +(5 rows) + +SELECT * FROM test_bpchar WHERE i='abc' ORDER BY i; + i +------------ + abc + abc +(2 rows) + +SELECT * FROM test_bpchar WHERE i='abc ' ORDER BY i; + i +------------ + abc + abc +(2 rows) + +SELECT * FROM test_bpchar WHERE i>='abc' ORDER BY i; + i +------------ + abc + abc + axy + xyz + xyz +(5 rows) + +SELECT * FROM test_bpchar WHERE i>'abc' ORDER BY i; + i +------------ + axy + xyz + xyz +(3 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_bpchar WHERE i<'abc' ORDER BY i; + QUERY PLAN +----------------------------------------------- + Sort + Sort Key: i + -> Bitmap Heap Scan on test_bpchar + Recheck Cond: (i < 'abc'::bpchar) + -> Bitmap Index Scan on idx_bpchar + Index Cond: (i < 'abc'::bpchar) +(6 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_bpchar WHERE i<='abc' ORDER BY i; + QUERY PLAN +------------------------------------------------ + Sort + Sort Key: i + -> Bitmap Heap Scan on test_bpchar + Recheck Cond: (i <= 'abc'::bpchar) + -> Bitmap Index Scan on idx_bpchar + Index Cond: (i <= 'abc'::bpchar) +(6 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_bpchar WHERE i='abc' ORDER BY i; + QUERY PLAN +----------------------------------------- + Bitmap Heap Scan on test_bpchar + Recheck Cond: (i = 'abc'::bpchar) + -> Bitmap Index Scan on idx_bpchar + Index Cond: (i = 'abc'::bpchar) +(4 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_bpchar WHERE i>='abc' ORDER BY i; + QUERY PLAN +------------------------------------------------ + Sort + Sort Key: i + -> Bitmap Heap Scan on test_bpchar + Recheck Cond: (i >= 'abc'::bpchar) + -> Bitmap Index Scan on idx_bpchar + Index Cond: (i >= 'abc'::bpchar) +(6 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_bpchar WHERE i>'abc' ORDER BY i; + QUERY PLAN +----------------------------------------------- + Sort + Sort Key: i + -> Bitmap Heap Scan on test_bpchar + Recheck Cond: (i > 'abc'::bpchar) + -> Bitmap Index Scan on idx_bpchar + Index Cond: (i > 'abc'::bpchar) +(6 rows) + diff --git a/contrib/btree_gin/expected/bytea.out b/contrib/btree_gin/expected/bytea.out new file mode 100644 index 0000000..b0ed7a5 --- /dev/null +++ b/contrib/btree_gin/expected/bytea.out @@ -0,0 +1,46 @@ +set enable_seqscan=off; +-- ensure consistent test output regardless of the default bytea format +SET bytea_output TO escape; +CREATE TABLE test_bytea ( + i bytea +); +INSERT INTO test_bytea VALUES ('a'),('ab'),('abc'),('abb'),('axy'),('xyz'); +CREATE INDEX idx_bytea ON test_bytea USING gin (i); +SELECT * FROM test_bytea WHERE i<'abc'::bytea ORDER BY i; + i +----- + a + ab + abb +(3 rows) + +SELECT * FROM test_bytea WHERE i<='abc'::bytea ORDER BY i; + i +----- + a + ab + abb + abc +(4 rows) + +SELECT * FROM test_bytea WHERE i='abc'::bytea ORDER BY i; + i +----- + abc +(1 row) + +SELECT * FROM test_bytea WHERE i>='abc'::bytea ORDER BY i; + i +----- + abc + axy + xyz +(3 rows) + +SELECT * FROM test_bytea WHERE i>'abc'::bytea ORDER BY i; + i +----- + axy + xyz +(2 rows) + diff --git a/contrib/btree_gin/expected/char.out b/contrib/btree_gin/expected/char.out new file mode 100644 index 0000000..09e0315 --- /dev/null +++ b/contrib/btree_gin/expected/char.out @@ -0,0 +1,37 @@ +set enable_seqscan=off; +CREATE TABLE test_char ( + i "char" +); +INSERT INTO test_char VALUES ('a'),('b'),('c'),('d'),('e'),('f'); +CREATE INDEX idx_char ON test_char USING gin (i); +SELECT * FROM test_char WHERE i<'d'::"char" ORDER BY i; + i +--- +(0 rows) + +SELECT * FROM test_char WHERE i<='d'::"char" ORDER BY i; + i +--- +(0 rows) + +SELECT * FROM test_char WHERE i='d'::"char" ORDER BY i; + i +--- + d +(1 row) + +SELECT * FROM test_char WHERE i>='d'::"char" ORDER BY i; + i +--- + d + e + f +(3 rows) + +SELECT * FROM test_char WHERE i>'d'::"char" ORDER BY i; + i +--- + e + f +(2 rows) + diff --git a/contrib/btree_gin/expected/cidr.out b/contrib/btree_gin/expected/cidr.out new file mode 100644 index 0000000..3d1198a --- /dev/null +++ b/contrib/btree_gin/expected/cidr.out @@ -0,0 +1,51 @@ +set enable_seqscan=off; +CREATE TABLE test_cidr ( + i cidr +); +INSERT INTO test_cidr VALUES + ( '1.2.3.4' ), + ( '1.2.4.4' ), + ( '1.2.5.4' ), + ( '1.2.6.4' ), + ( '1.2.7.4' ), + ( '1.2.8.4' ) +; +CREATE INDEX idx_cidr ON test_cidr USING gin (i); +SELECT * FROM test_cidr WHERE i<'1.2.6.4'::cidr ORDER BY i; + i +------------ + 1.2.3.4/32 + 1.2.4.4/32 + 1.2.5.4/32 +(3 rows) + +SELECT * FROM test_cidr WHERE i<='1.2.6.4'::cidr ORDER BY i; + i +------------ + 1.2.3.4/32 + 1.2.4.4/32 + 1.2.5.4/32 + 1.2.6.4/32 +(4 rows) + +SELECT * FROM test_cidr WHERE i='1.2.6.4'::cidr ORDER BY i; + i +------------ + 1.2.6.4/32 +(1 row) + +SELECT * FROM test_cidr WHERE i>='1.2.6.4'::cidr ORDER BY i; + i +------------ + 1.2.6.4/32 + 1.2.7.4/32 + 1.2.8.4/32 +(3 rows) + +SELECT * FROM test_cidr WHERE i>'1.2.6.4'::cidr ORDER BY i; + i +------------ + 1.2.7.4/32 + 1.2.8.4/32 +(2 rows) + diff --git a/contrib/btree_gin/expected/date.out b/contrib/btree_gin/expected/date.out new file mode 100644 index 0000000..40dfa30 --- /dev/null +++ b/contrib/btree_gin/expected/date.out @@ -0,0 +1,51 @@ +set enable_seqscan=off; +CREATE TABLE test_date ( + i date +); +INSERT INTO test_date VALUES + ( '2004-10-23' ), + ( '2004-10-24' ), + ( '2004-10-25' ), + ( '2004-10-26' ), + ( '2004-10-27' ), + ( '2004-10-28' ) +; +CREATE INDEX idx_date ON test_date USING gin (i); +SELECT * FROM test_date WHERE i<'2004-10-26'::date ORDER BY i; + i +------------ + 10-23-2004 + 10-24-2004 + 10-25-2004 +(3 rows) + +SELECT * FROM test_date WHERE i<='2004-10-26'::date ORDER BY i; + i +------------ + 10-23-2004 + 10-24-2004 + 10-25-2004 + 10-26-2004 +(4 rows) + +SELECT * FROM test_date WHERE i='2004-10-26'::date ORDER BY i; + i +------------ + 10-26-2004 +(1 row) + +SELECT * FROM test_date WHERE i>='2004-10-26'::date ORDER BY i; + i +------------ + 10-26-2004 + 10-27-2004 + 10-28-2004 +(3 rows) + +SELECT * FROM test_date WHERE i>'2004-10-26'::date ORDER BY i; + i +------------ + 10-27-2004 + 10-28-2004 +(2 rows) + diff --git a/contrib/btree_gin/expected/enum.out b/contrib/btree_gin/expected/enum.out new file mode 100644 index 0000000..71e0c4b --- /dev/null +++ b/contrib/btree_gin/expected/enum.out @@ -0,0 +1,63 @@ +set enable_seqscan=off; +CREATE TYPE rainbow AS ENUM ('r','o','y','g','b','i','v'); +CREATE TABLE test_enum ( + i rainbow +); +INSERT INTO test_enum VALUES ('v'),('y'),('r'),('g'),('o'),('i'),('b'); +CREATE INDEX idx_enum ON test_enum USING gin (i); +SELECT * FROM test_enum WHERE i<'g'::rainbow ORDER BY i; + i +--- + r + o + y +(3 rows) + +SELECT * FROM test_enum WHERE i<='g'::rainbow ORDER BY i; + i +--- + r + o + y + g +(4 rows) + +SELECT * FROM test_enum WHERE i='g'::rainbow ORDER BY i; + i +--- + g +(1 row) + +SELECT * FROM test_enum WHERE i>='g'::rainbow ORDER BY i; + i +--- + g + b + i + v +(4 rows) + +SELECT * FROM test_enum WHERE i>'g'::rainbow ORDER BY i; + i +--- + b + i + v +(3 rows) + +explain (costs off) SELECT * FROM test_enum WHERE i>='g'::rainbow ORDER BY i; + QUERY PLAN +----------------------------------------------- + Sort + Sort Key: i + -> Bitmap Heap Scan on test_enum + Recheck Cond: (i >= 'g'::rainbow) + -> Bitmap Index Scan on idx_enum + Index Cond: (i >= 'g'::rainbow) +(6 rows) + +-- make sure we handle the non-evenly-numbered oid case for enums +create type e as enum ('0', '2', '3'); +alter type e add value '1' after '0'; +create table t as select (i % 4)::text::e from generate_series(0, 100000) as i; +create index on t using gin (e); diff --git a/contrib/btree_gin/expected/float4.out b/contrib/btree_gin/expected/float4.out new file mode 100644 index 0000000..7b9134f --- /dev/null +++ b/contrib/btree_gin/expected/float4.out @@ -0,0 +1,44 @@ +set enable_seqscan=off; +CREATE TABLE test_float4 ( + i float4 +); +INSERT INTO test_float4 VALUES (-2),(-1),(0),(1),(2),(3); +CREATE INDEX idx_float4 ON test_float4 USING gin (i); +SELECT * FROM test_float4 WHERE i<1::float4 ORDER BY i; + i +---- + -2 + -1 + 0 +(3 rows) + +SELECT * FROM test_float4 WHERE i<=1::float4 ORDER BY i; + i +---- + -2 + -1 + 0 + 1 +(4 rows) + +SELECT * FROM test_float4 WHERE i=1::float4 ORDER BY i; + i +--- + 1 +(1 row) + +SELECT * FROM test_float4 WHERE i>=1::float4 ORDER BY i; + i +--- + 1 + 2 + 3 +(3 rows) + +SELECT * FROM test_float4 WHERE i>1::float4 ORDER BY i; + i +--- + 2 + 3 +(2 rows) + diff --git a/contrib/btree_gin/expected/float8.out b/contrib/btree_gin/expected/float8.out new file mode 100644 index 0000000..a41d4f9 --- /dev/null +++ b/contrib/btree_gin/expected/float8.out @@ -0,0 +1,44 @@ +set enable_seqscan=off; +CREATE TABLE test_float8 ( + i float8 +); +INSERT INTO test_float8 VALUES (-2),(-1),(0),(1),(2),(3); +CREATE INDEX idx_float8 ON test_float8 USING gin (i); +SELECT * FROM test_float8 WHERE i<1::float8 ORDER BY i; + i +---- + -2 + -1 + 0 +(3 rows) + +SELECT * FROM test_float8 WHERE i<=1::float8 ORDER BY i; + i +---- + -2 + -1 + 0 + 1 +(4 rows) + +SELECT * FROM test_float8 WHERE i=1::float8 ORDER BY i; + i +--- + 1 +(1 row) + +SELECT * FROM test_float8 WHERE i>=1::float8 ORDER BY i; + i +--- + 1 + 2 + 3 +(3 rows) + +SELECT * FROM test_float8 WHERE i>1::float8 ORDER BY i; + i +--- + 2 + 3 +(2 rows) + diff --git a/contrib/btree_gin/expected/inet.out b/contrib/btree_gin/expected/inet.out new file mode 100644 index 0000000..aa6147f --- /dev/null +++ b/contrib/btree_gin/expected/inet.out @@ -0,0 +1,51 @@ +set enable_seqscan=off; +CREATE TABLE test_inet ( + i inet +); +INSERT INTO test_inet VALUES + ( '1.2.3.4/16' ), + ( '1.2.4.4/16' ), + ( '1.2.5.4/16' ), + ( '1.2.6.4/16' ), + ( '1.2.7.4/16' ), + ( '1.2.8.4/16' ) +; +CREATE INDEX idx_inet ON test_inet USING gin (i); +SELECT * FROM test_inet WHERE i<'1.2.6.4/16'::inet ORDER BY i; + i +------------ + 1.2.3.4/16 + 1.2.4.4/16 + 1.2.5.4/16 +(3 rows) + +SELECT * FROM test_inet WHERE i<='1.2.6.4/16'::inet ORDER BY i; + i +------------ + 1.2.3.4/16 + 1.2.4.4/16 + 1.2.5.4/16 + 1.2.6.4/16 +(4 rows) + +SELECT * FROM test_inet WHERE i='1.2.6.4/16'::inet ORDER BY i; + i +------------ + 1.2.6.4/16 +(1 row) + +SELECT * FROM test_inet WHERE i>='1.2.6.4/16'::inet ORDER BY i; + i +------------ + 1.2.6.4/16 + 1.2.7.4/16 + 1.2.8.4/16 +(3 rows) + +SELECT * FROM test_inet WHERE i>'1.2.6.4/16'::inet ORDER BY i; + i +------------ + 1.2.7.4/16 + 1.2.8.4/16 +(2 rows) + diff --git a/contrib/btree_gin/expected/install_btree_gin.out b/contrib/btree_gin/expected/install_btree_gin.out new file mode 100644 index 0000000..631a0df --- /dev/null +++ b/contrib/btree_gin/expected/install_btree_gin.out @@ -0,0 +1,9 @@ +CREATE EXTENSION btree_gin; +-- Check whether any of our opclasses fail amvalidate +SELECT amname, opcname +FROM pg_opclass opc LEFT JOIN pg_am am ON am.oid = opcmethod +WHERE opc.oid >= 16384 AND NOT amvalidate(opc.oid); + amname | opcname +--------+--------- +(0 rows) + diff --git a/contrib/btree_gin/expected/int2.out b/contrib/btree_gin/expected/int2.out new file mode 100644 index 0000000..20d66a1 --- /dev/null +++ b/contrib/btree_gin/expected/int2.out @@ -0,0 +1,44 @@ +set enable_seqscan=off; +CREATE TABLE test_int2 ( + i int2 +); +INSERT INTO test_int2 VALUES (-2),(-1),(0),(1),(2),(3); +CREATE INDEX idx_int2 ON test_int2 USING gin (i); +SELECT * FROM test_int2 WHERE i<1::int2 ORDER BY i; + i +---- + -2 + -1 + 0 +(3 rows) + +SELECT * FROM test_int2 WHERE i<=1::int2 ORDER BY i; + i +---- + -2 + -1 + 0 + 1 +(4 rows) + +SELECT * FROM test_int2 WHERE i=1::int2 ORDER BY i; + i +--- + 1 +(1 row) + +SELECT * FROM test_int2 WHERE i>=1::int2 ORDER BY i; + i +--- + 1 + 2 + 3 +(3 rows) + +SELECT * FROM test_int2 WHERE i>1::int2 ORDER BY i; + i +--- + 2 + 3 +(2 rows) + diff --git a/contrib/btree_gin/expected/int4.out b/contrib/btree_gin/expected/int4.out new file mode 100644 index 0000000..0f0122c --- /dev/null +++ b/contrib/btree_gin/expected/int4.out @@ -0,0 +1,44 @@ +set enable_seqscan=off; +CREATE TABLE test_int4 ( + i int4 +); +INSERT INTO test_int4 VALUES (-2),(-1),(0),(1),(2),(3); +CREATE INDEX idx_int4 ON test_int4 USING gin (i); +SELECT * FROM test_int4 WHERE i<1::int4 ORDER BY i; + i +---- + -2 + -1 + 0 +(3 rows) + +SELECT * FROM test_int4 WHERE i<=1::int4 ORDER BY i; + i +---- + -2 + -1 + 0 + 1 +(4 rows) + +SELECT * FROM test_int4 WHERE i=1::int4 ORDER BY i; + i +--- + 1 +(1 row) + +SELECT * FROM test_int4 WHERE i>=1::int4 ORDER BY i; + i +--- + 1 + 2 + 3 +(3 rows) + +SELECT * FROM test_int4 WHERE i>1::int4 ORDER BY i; + i +--- + 2 + 3 +(2 rows) + diff --git a/contrib/btree_gin/expected/int8.out b/contrib/btree_gin/expected/int8.out new file mode 100644 index 0000000..307e19e --- /dev/null +++ b/contrib/btree_gin/expected/int8.out @@ -0,0 +1,44 @@ +set enable_seqscan=off; +CREATE TABLE test_int8 ( + i int8 +); +INSERT INTO test_int8 VALUES (-2),(-1),(0),(1),(2),(3); +CREATE INDEX idx_int8 ON test_int8 USING gin (i); +SELECT * FROM test_int8 WHERE i<1::int8 ORDER BY i; + i +---- + -2 + -1 + 0 +(3 rows) + +SELECT * FROM test_int8 WHERE i<=1::int8 ORDER BY i; + i +---- + -2 + -1 + 0 + 1 +(4 rows) + +SELECT * FROM test_int8 WHERE i=1::int8 ORDER BY i; + i +--- + 1 +(1 row) + +SELECT * FROM test_int8 WHERE i>=1::int8 ORDER BY i; + i +--- + 1 + 2 + 3 +(3 rows) + +SELECT * FROM test_int8 WHERE i>1::int8 ORDER BY i; + i +--- + 2 + 3 +(2 rows) + diff --git a/contrib/btree_gin/expected/interval.out b/contrib/btree_gin/expected/interval.out new file mode 100644 index 0000000..1f6ef54 --- /dev/null +++ b/contrib/btree_gin/expected/interval.out @@ -0,0 +1,51 @@ +set enable_seqscan=off; +CREATE TABLE test_interval ( + i interval +); +INSERT INTO test_interval VALUES + ( '03:55:08' ), + ( '04:55:08' ), + ( '05:55:08' ), + ( '08:55:08' ), + ( '09:55:08' ), + ( '10:55:08' ) +; +CREATE INDEX idx_interval ON test_interval USING gin (i); +SELECT * FROM test_interval WHERE i<'08:55:08'::interval ORDER BY i; + i +-------------------------- + @ 3 hours 55 mins 8 secs + @ 4 hours 55 mins 8 secs + @ 5 hours 55 mins 8 secs +(3 rows) + +SELECT * FROM test_interval WHERE i<='08:55:08'::interval ORDER BY i; + i +-------------------------- + @ 3 hours 55 mins 8 secs + @ 4 hours 55 mins 8 secs + @ 5 hours 55 mins 8 secs + @ 8 hours 55 mins 8 secs +(4 rows) + +SELECT * FROM test_interval WHERE i='08:55:08'::interval ORDER BY i; + i +-------------------------- + @ 8 hours 55 mins 8 secs +(1 row) + +SELECT * FROM test_interval WHERE i>='08:55:08'::interval ORDER BY i; + i +--------------------------- + @ 8 hours 55 mins 8 secs + @ 9 hours 55 mins 8 secs + @ 10 hours 55 mins 8 secs +(3 rows) + +SELECT * FROM test_interval WHERE i>'08:55:08'::interval ORDER BY i; + i +--------------------------- + @ 9 hours 55 mins 8 secs + @ 10 hours 55 mins 8 secs +(2 rows) + diff --git a/contrib/btree_gin/expected/macaddr.out b/contrib/btree_gin/expected/macaddr.out new file mode 100644 index 0000000..ebceb01 --- /dev/null +++ b/contrib/btree_gin/expected/macaddr.out @@ -0,0 +1,51 @@ +set enable_seqscan=off; +CREATE TABLE test_macaddr ( + i macaddr +); +INSERT INTO test_macaddr VALUES + ( '22:00:5c:03:55:08' ), + ( '22:00:5c:04:55:08' ), + ( '22:00:5c:05:55:08' ), + ( '22:00:5c:08:55:08' ), + ( '22:00:5c:09:55:08' ), + ( '22:00:5c:10:55:08' ) +; +CREATE INDEX idx_macaddr ON test_macaddr USING gin (i); +SELECT * FROM test_macaddr WHERE i<'22:00:5c:08:55:08'::macaddr ORDER BY i; + i +------------------- + 22:00:5c:03:55:08 + 22:00:5c:04:55:08 + 22:00:5c:05:55:08 +(3 rows) + +SELECT * FROM test_macaddr WHERE i<='22:00:5c:08:55:08'::macaddr ORDER BY i; + i +------------------- + 22:00:5c:03:55:08 + 22:00:5c:04:55:08 + 22:00:5c:05:55:08 + 22:00:5c:08:55:08 +(4 rows) + +SELECT * FROM test_macaddr WHERE i='22:00:5c:08:55:08'::macaddr ORDER BY i; + i +------------------- + 22:00:5c:08:55:08 +(1 row) + +SELECT * FROM test_macaddr WHERE i>='22:00:5c:08:55:08'::macaddr ORDER BY i; + i +------------------- + 22:00:5c:08:55:08 + 22:00:5c:09:55:08 + 22:00:5c:10:55:08 +(3 rows) + +SELECT * FROM test_macaddr WHERE i>'22:00:5c:08:55:08'::macaddr ORDER BY i; + i +------------------- + 22:00:5c:09:55:08 + 22:00:5c:10:55:08 +(2 rows) + diff --git a/contrib/btree_gin/expected/macaddr8.out b/contrib/btree_gin/expected/macaddr8.out new file mode 100644 index 0000000..025b0c1 --- /dev/null +++ b/contrib/btree_gin/expected/macaddr8.out @@ -0,0 +1,51 @@ +set enable_seqscan=off; +CREATE TABLE test_macaddr8 ( + i macaddr8 +); +INSERT INTO test_macaddr8 VALUES + ( '22:00:5c:03:55:08:01:02' ), + ( '22:00:5c:04:55:08:01:02' ), + ( '22:00:5c:05:55:08:01:02' ), + ( '22:00:5c:08:55:08:01:02' ), + ( '22:00:5c:09:55:08:01:02' ), + ( '22:00:5c:10:55:08:01:02' ) +; +CREATE INDEX idx_macaddr8 ON test_macaddr8 USING gin (i); +SELECT * FROM test_macaddr8 WHERE i<'22:00:5c:08:55:08:01:02'::macaddr8 ORDER BY i; + i +------------------------- + 22:00:5c:03:55:08:01:02 + 22:00:5c:04:55:08:01:02 + 22:00:5c:05:55:08:01:02 +(3 rows) + +SELECT * FROM test_macaddr8 WHERE i<='22:00:5c:08:55:08:01:02'::macaddr8 ORDER BY i; + i +------------------------- + 22:00:5c:03:55:08:01:02 + 22:00:5c:04:55:08:01:02 + 22:00:5c:05:55:08:01:02 + 22:00:5c:08:55:08:01:02 +(4 rows) + +SELECT * FROM test_macaddr8 WHERE i='22:00:5c:08:55:08:01:02'::macaddr8 ORDER BY i; + i +------------------------- + 22:00:5c:08:55:08:01:02 +(1 row) + +SELECT * FROM test_macaddr8 WHERE i>='22:00:5c:08:55:08:01:02'::macaddr8 ORDER BY i; + i +------------------------- + 22:00:5c:08:55:08:01:02 + 22:00:5c:09:55:08:01:02 + 22:00:5c:10:55:08:01:02 +(3 rows) + +SELECT * FROM test_macaddr8 WHERE i>'22:00:5c:08:55:08:01:02'::macaddr8 ORDER BY i; + i +------------------------- + 22:00:5c:09:55:08:01:02 + 22:00:5c:10:55:08:01:02 +(2 rows) + diff --git a/contrib/btree_gin/expected/money.out b/contrib/btree_gin/expected/money.out new file mode 100644 index 0000000..a0ba571 --- /dev/null +++ b/contrib/btree_gin/expected/money.out @@ -0,0 +1,44 @@ +set enable_seqscan=off; +CREATE TABLE test_money ( + i money +); +INSERT INTO test_money VALUES ('-2'),('-1'),('0'),('1'),('2'),('3'); +CREATE INDEX idx_money ON test_money USING gin (i); +SELECT * FROM test_money WHERE i<'1'::money ORDER BY i; + i +-------- + -$2.00 + -$1.00 + $0.00 +(3 rows) + +SELECT * FROM test_money WHERE i<='1'::money ORDER BY i; + i +-------- + -$2.00 + -$1.00 + $0.00 + $1.00 +(4 rows) + +SELECT * FROM test_money WHERE i='1'::money ORDER BY i; + i +------- + $1.00 +(1 row) + +SELECT * FROM test_money WHERE i>='1'::money ORDER BY i; + i +------- + $1.00 + $2.00 + $3.00 +(3 rows) + +SELECT * FROM test_money WHERE i>'1'::money ORDER BY i; + i +------- + $2.00 + $3.00 +(2 rows) + diff --git a/contrib/btree_gin/expected/name.out b/contrib/btree_gin/expected/name.out new file mode 100644 index 0000000..174de65 --- /dev/null +++ b/contrib/btree_gin/expected/name.out @@ -0,0 +1,97 @@ +set enable_seqscan=off; +CREATE TABLE test_name ( + i name +); +INSERT INTO test_name VALUES ('a'),('ab'),('abc'),('abb'),('axy'),('xyz'); +CREATE INDEX idx_name ON test_name USING gin (i); +SELECT * FROM test_name WHERE i<'abc' ORDER BY i; + i +----- + a + ab + abb +(3 rows) + +SELECT * FROM test_name WHERE i<='abc' ORDER BY i; + i +----- + a + ab + abb + abc +(4 rows) + +SELECT * FROM test_name WHERE i='abc' ORDER BY i; + i +----- + abc +(1 row) + +SELECT * FROM test_name WHERE i>='abc' ORDER BY i; + i +----- + abc + axy + xyz +(3 rows) + +SELECT * FROM test_name WHERE i>'abc' ORDER BY i; + i +----- + axy + xyz +(2 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_name WHERE i<'abc' ORDER BY i; + QUERY PLAN +--------------------------------------------- + Sort + Sort Key: i + -> Bitmap Heap Scan on test_name + Recheck Cond: (i < 'abc'::name) + -> Bitmap Index Scan on idx_name + Index Cond: (i < 'abc'::name) +(6 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_name WHERE i<='abc' ORDER BY i; + QUERY PLAN +---------------------------------------------- + Sort + Sort Key: i + -> Bitmap Heap Scan on test_name + Recheck Cond: (i <= 'abc'::name) + -> Bitmap Index Scan on idx_name + Index Cond: (i <= 'abc'::name) +(6 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_name WHERE i='abc' ORDER BY i; + QUERY PLAN +--------------------------------------- + Bitmap Heap Scan on test_name + Recheck Cond: (i = 'abc'::name) + -> Bitmap Index Scan on idx_name + Index Cond: (i = 'abc'::name) +(4 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_name WHERE i>='abc' ORDER BY i; + QUERY PLAN +---------------------------------------------- + Sort + Sort Key: i + -> Bitmap Heap Scan on test_name + Recheck Cond: (i >= 'abc'::name) + -> Bitmap Index Scan on idx_name + Index Cond: (i >= 'abc'::name) +(6 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_name WHERE i>'abc' ORDER BY i; + QUERY PLAN +--------------------------------------------- + Sort + Sort Key: i + -> Bitmap Heap Scan on test_name + Recheck Cond: (i > 'abc'::name) + -> Bitmap Index Scan on idx_name + Index Cond: (i > 'abc'::name) +(6 rows) + diff --git a/contrib/btree_gin/expected/numeric.out b/contrib/btree_gin/expected/numeric.out new file mode 100644 index 0000000..f10a672 --- /dev/null +++ b/contrib/btree_gin/expected/numeric.out @@ -0,0 +1,44 @@ +set enable_seqscan=off; +CREATE TABLE test_numeric ( + i numeric +); +INSERT INTO test_numeric VALUES (-2),(-1),(0),(1),(2),(3); +CREATE INDEX idx_numeric ON test_numeric USING gin (i); +SELECT * FROM test_numeric WHERE i<'1'::numeric ORDER BY i; + i +---- + -2 + -1 + 0 +(3 rows) + +SELECT * FROM test_numeric WHERE i<='1'::numeric ORDER BY i; + i +---- + -2 + -1 + 0 + 1 +(4 rows) + +SELECT * FROM test_numeric WHERE i='1'::numeric ORDER BY i; + i +--- + 1 +(1 row) + +SELECT * FROM test_numeric WHERE i>='1'::numeric ORDER BY i; + i +--- + 1 + 2 + 3 +(3 rows) + +SELECT * FROM test_numeric WHERE i>'1'::numeric ORDER BY i; + i +--- + 2 + 3 +(2 rows) + diff --git a/contrib/btree_gin/expected/oid.out b/contrib/btree_gin/expected/oid.out new file mode 100644 index 0000000..19e15c7 --- /dev/null +++ b/contrib/btree_gin/expected/oid.out @@ -0,0 +1,44 @@ +set enable_seqscan=off; +CREATE TABLE test_oid ( + i oid +); +INSERT INTO test_oid VALUES (0),(1),(2),(3),(4),(5); +CREATE INDEX idx_oid ON test_oid USING gin (i); +SELECT * FROM test_oid WHERE i<3::oid ORDER BY i; + i +--- + 0 + 1 + 2 +(3 rows) + +SELECT * FROM test_oid WHERE i<=3::oid ORDER BY i; + i +--- + 0 + 1 + 2 + 3 +(4 rows) + +SELECT * FROM test_oid WHERE i=3::oid ORDER BY i; + i +--- + 3 +(1 row) + +SELECT * FROM test_oid WHERE i>=3::oid ORDER BY i; + i +--- + 3 + 4 + 5 +(3 rows) + +SELECT * FROM test_oid WHERE i>3::oid ORDER BY i; + i +--- + 4 + 5 +(2 rows) + diff --git a/contrib/btree_gin/expected/text.out b/contrib/btree_gin/expected/text.out new file mode 100644 index 0000000..3e31ad7 --- /dev/null +++ b/contrib/btree_gin/expected/text.out @@ -0,0 +1,44 @@ +set enable_seqscan=off; +CREATE TABLE test_text ( + i text +); +INSERT INTO test_text VALUES ('a'),('ab'),('abc'),('abb'),('axy'),('xyz'); +CREATE INDEX idx_text ON test_text USING gin (i); +SELECT * FROM test_text WHERE i<'abc' ORDER BY i; + i +----- + a + ab + abb +(3 rows) + +SELECT * FROM test_text WHERE i<='abc' ORDER BY i; + i +----- + a + ab + abb + abc +(4 rows) + +SELECT * FROM test_text WHERE i='abc' ORDER BY i; + i +----- + abc +(1 row) + +SELECT * FROM test_text WHERE i>='abc' ORDER BY i; + i +----- + abc + axy + xyz +(3 rows) + +SELECT * FROM test_text WHERE i>'abc' ORDER BY i; + i +----- + axy + xyz +(2 rows) + diff --git a/contrib/btree_gin/expected/time.out b/contrib/btree_gin/expected/time.out new file mode 100644 index 0000000..be6b084 --- /dev/null +++ b/contrib/btree_gin/expected/time.out @@ -0,0 +1,51 @@ +set enable_seqscan=off; +CREATE TABLE test_time ( + i time +); +INSERT INTO test_time VALUES + ( '03:55:08' ), + ( '04:55:08' ), + ( '05:55:08' ), + ( '08:55:08' ), + ( '09:55:08' ), + ( '10:55:08' ) +; +CREATE INDEX idx_time ON test_time USING gin (i); +SELECT * FROM test_time WHERE i<'08:55:08'::time ORDER BY i; + i +---------- + 03:55:08 + 04:55:08 + 05:55:08 +(3 rows) + +SELECT * FROM test_time WHERE i<='08:55:08'::time ORDER BY i; + i +---------- + 03:55:08 + 04:55:08 + 05:55:08 + 08:55:08 +(4 rows) + +SELECT * FROM test_time WHERE i='08:55:08'::time ORDER BY i; + i +---------- + 08:55:08 +(1 row) + +SELECT * FROM test_time WHERE i>='08:55:08'::time ORDER BY i; + i +---------- + 08:55:08 + 09:55:08 + 10:55:08 +(3 rows) + +SELECT * FROM test_time WHERE i>'08:55:08'::time ORDER BY i; + i +---------- + 09:55:08 + 10:55:08 +(2 rows) + diff --git a/contrib/btree_gin/expected/timestamp.out b/contrib/btree_gin/expected/timestamp.out new file mode 100644 index 0000000..a236cdc --- /dev/null +++ b/contrib/btree_gin/expected/timestamp.out @@ -0,0 +1,51 @@ +set enable_seqscan=off; +CREATE TABLE test_timestamp ( + i timestamp +); +INSERT INTO test_timestamp VALUES + ( '2004-10-26 03:55:08' ), + ( '2004-10-26 04:55:08' ), + ( '2004-10-26 05:55:08' ), + ( '2004-10-26 08:55:08' ), + ( '2004-10-26 09:55:08' ), + ( '2004-10-26 10:55:08' ) +; +CREATE INDEX idx_timestamp ON test_timestamp USING gin (i); +SELECT * FROM test_timestamp WHERE i<'2004-10-26 08:55:08'::timestamp ORDER BY i; + i +-------------------------- + Tue Oct 26 03:55:08 2004 + Tue Oct 26 04:55:08 2004 + Tue Oct 26 05:55:08 2004 +(3 rows) + +SELECT * FROM test_timestamp WHERE i<='2004-10-26 08:55:08'::timestamp ORDER BY i; + i +-------------------------- + Tue Oct 26 03:55:08 2004 + Tue Oct 26 04:55:08 2004 + Tue Oct 26 05:55:08 2004 + Tue Oct 26 08:55:08 2004 +(4 rows) + +SELECT * FROM test_timestamp WHERE i='2004-10-26 08:55:08'::timestamp ORDER BY i; + i +-------------------------- + Tue Oct 26 08:55:08 2004 +(1 row) + +SELECT * FROM test_timestamp WHERE i>='2004-10-26 08:55:08'::timestamp ORDER BY i; + i +-------------------------- + Tue Oct 26 08:55:08 2004 + Tue Oct 26 09:55:08 2004 + Tue Oct 26 10:55:08 2004 +(3 rows) + +SELECT * FROM test_timestamp WHERE i>'2004-10-26 08:55:08'::timestamp ORDER BY i; + i +-------------------------- + Tue Oct 26 09:55:08 2004 + Tue Oct 26 10:55:08 2004 +(2 rows) + diff --git a/contrib/btree_gin/expected/timestamptz.out b/contrib/btree_gin/expected/timestamptz.out new file mode 100644 index 0000000..d53963d --- /dev/null +++ b/contrib/btree_gin/expected/timestamptz.out @@ -0,0 +1,51 @@ +set enable_seqscan=off; +CREATE TABLE test_timestamptz ( + i timestamptz +); +INSERT INTO test_timestamptz VALUES + ( '2004-10-26 03:55:08' ), + ( '2004-10-26 04:55:08' ), + ( '2004-10-26 05:55:08' ), + ( '2004-10-26 08:55:08' ), + ( '2004-10-26 09:55:08' ), + ( '2004-10-26 10:55:08' ) +; +CREATE INDEX idx_timestamptz ON test_timestamptz USING gin (i); +SELECT * FROM test_timestamptz WHERE i<'2004-10-26 08:55:08'::timestamptz ORDER BY i; + i +------------------------------ + Tue Oct 26 03:55:08 2004 PDT + Tue Oct 26 04:55:08 2004 PDT + Tue Oct 26 05:55:08 2004 PDT +(3 rows) + +SELECT * FROM test_timestamptz WHERE i<='2004-10-26 08:55:08'::timestamptz ORDER BY i; + i +------------------------------ + Tue Oct 26 03:55:08 2004 PDT + Tue Oct 26 04:55:08 2004 PDT + Tue Oct 26 05:55:08 2004 PDT + Tue Oct 26 08:55:08 2004 PDT +(4 rows) + +SELECT * FROM test_timestamptz WHERE i='2004-10-26 08:55:08'::timestamptz ORDER BY i; + i +------------------------------ + Tue Oct 26 08:55:08 2004 PDT +(1 row) + +SELECT * FROM test_timestamptz WHERE i>='2004-10-26 08:55:08'::timestamptz ORDER BY i; + i +------------------------------ + Tue Oct 26 08:55:08 2004 PDT + Tue Oct 26 09:55:08 2004 PDT + Tue Oct 26 10:55:08 2004 PDT +(3 rows) + +SELECT * FROM test_timestamptz WHERE i>'2004-10-26 08:55:08'::timestamptz ORDER BY i; + i +------------------------------ + Tue Oct 26 09:55:08 2004 PDT + Tue Oct 26 10:55:08 2004 PDT +(2 rows) + diff --git a/contrib/btree_gin/expected/timetz.out b/contrib/btree_gin/expected/timetz.out new file mode 100644 index 0000000..45aee71 --- /dev/null +++ b/contrib/btree_gin/expected/timetz.out @@ -0,0 +1,51 @@ +set enable_seqscan=off; +CREATE TABLE test_timetz ( + i timetz +); +INSERT INTO test_timetz VALUES + ( '03:55:08 GMT+2' ), + ( '04:55:08 GMT+2' ), + ( '05:55:08 GMT+2' ), + ( '08:55:08 GMT+2' ), + ( '09:55:08 GMT+2' ), + ( '10:55:08 GMT+2' ) +; +CREATE INDEX idx_timetz ON test_timetz USING gin (i); +SELECT * FROM test_timetz WHERE i<'08:55:08 GMT+2'::timetz ORDER BY i; + i +------------- + 03:55:08-02 + 04:55:08-02 + 05:55:08-02 +(3 rows) + +SELECT * FROM test_timetz WHERE i<='08:55:08 GMT+2'::timetz ORDER BY i; + i +------------- + 03:55:08-02 + 04:55:08-02 + 05:55:08-02 + 08:55:08-02 +(4 rows) + +SELECT * FROM test_timetz WHERE i='08:55:08 GMT+2'::timetz ORDER BY i; + i +------------- + 08:55:08-02 +(1 row) + +SELECT * FROM test_timetz WHERE i>='08:55:08 GMT+2'::timetz ORDER BY i; + i +------------- + 08:55:08-02 + 09:55:08-02 + 10:55:08-02 +(3 rows) + +SELECT * FROM test_timetz WHERE i>'08:55:08 GMT+2'::timetz ORDER BY i; + i +------------- + 09:55:08-02 + 10:55:08-02 +(2 rows) + diff --git a/contrib/btree_gin/expected/uuid.out b/contrib/btree_gin/expected/uuid.out new file mode 100644 index 0000000..60fd8d6 --- /dev/null +++ b/contrib/btree_gin/expected/uuid.out @@ -0,0 +1,104 @@ +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; + i +-------------------------------------- + 00000000-0000-0000-0000-000000000000 + 299bc99f-2f79-4e3e-bfea-2cbfd62a7c27 + 6264af33-0d43-4337-bf4e-43509b8a4be8 +(3 rows) + +SELECT * FROM test_uuid WHERE i<='ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i; + i +-------------------------------------- + 00000000-0000-0000-0000-000000000000 + 299bc99f-2f79-4e3e-bfea-2cbfd62a7c27 + 6264af33-0d43-4337-bf4e-43509b8a4be8 + ce41c936-6acb-4feb-8c91-852a673e5a5c +(4 rows) + +SELECT * FROM test_uuid WHERE i='ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i; + i +-------------------------------------- + ce41c936-6acb-4feb-8c91-852a673e5a5c +(1 row) + +SELECT * FROM test_uuid WHERE i>='ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i; + i +-------------------------------------- + ce41c936-6acb-4feb-8c91-852a673e5a5c + d2ce731f-f2a8-4a2b-be37-8f0ba637427f + ffffffff-ffff-ffff-ffff-ffffffffffff +(3 rows) + +SELECT * FROM test_uuid WHERE i>'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i; + i +-------------------------------------- + d2ce731f-f2a8-4a2b-be37-8f0ba637427f + ffffffff-ffff-ffff-ffff-ffffffffffff +(2 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_uuid WHERE i<'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i; + QUERY PLAN +------------------------------------------------------------------------------ + Sort + Sort Key: i + -> Bitmap Heap Scan on test_uuid + Recheck Cond: (i < 'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid) + -> Bitmap Index Scan on idx_uuid + Index Cond: (i < 'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid) +(6 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_uuid WHERE i<='ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i; + QUERY PLAN +------------------------------------------------------------------------------- + Sort + Sort Key: i + -> Bitmap Heap Scan on test_uuid + Recheck Cond: (i <= 'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid) + -> Bitmap Index Scan on idx_uuid + Index Cond: (i <= 'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid) +(6 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_uuid WHERE i='ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i; + QUERY PLAN +------------------------------------------------------------------------ + Bitmap Heap Scan on test_uuid + Recheck Cond: (i = 'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid) + -> Bitmap Index Scan on idx_uuid + Index Cond: (i = 'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid) +(4 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_uuid WHERE i>='ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i; + QUERY PLAN +------------------------------------------------------------------------------- + Sort + Sort Key: i + -> Bitmap Heap Scan on test_uuid + Recheck Cond: (i >= 'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid) + -> Bitmap Index Scan on idx_uuid + Index Cond: (i >= 'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid) +(6 rows) + +EXPLAIN (COSTS OFF) SELECT * FROM test_uuid WHERE i>'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid ORDER BY i; + QUERY PLAN +------------------------------------------------------------------------------ + Sort + Sort Key: i + -> Bitmap Heap Scan on test_uuid + Recheck Cond: (i > 'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid) + -> Bitmap Index Scan on idx_uuid + Index Cond: (i > 'ce41c936-6acb-4feb-8c91-852a673e5a5c'::uuid) +(6 rows) + diff --git a/contrib/btree_gin/expected/varbit.out b/contrib/btree_gin/expected/varbit.out new file mode 100644 index 0000000..e8a7718 --- /dev/null +++ b/contrib/btree_gin/expected/varbit.out @@ -0,0 +1,44 @@ +set enable_seqscan=off; +CREATE TABLE test_varbit ( + i varbit +); +INSERT INTO test_varbit VALUES ('001'),('010'),('011'),('100'),('101'),('110'); +CREATE INDEX idx_varbit ON test_varbit USING gin (i); +SELECT * FROM test_varbit WHERE i<'100'::varbit ORDER BY i; + i +----- + 001 + 010 + 011 +(3 rows) + +SELECT * FROM test_varbit WHERE i<='100'::varbit ORDER BY i; + i +----- + 001 + 010 + 011 + 100 +(4 rows) + +SELECT * FROM test_varbit WHERE i='100'::varbit ORDER BY i; + i +----- + 100 +(1 row) + +SELECT * FROM test_varbit WHERE i>='100'::varbit ORDER BY i; + i +----- + 100 + 101 + 110 +(3 rows) + +SELECT * FROM test_varbit WHERE i>'100'::varbit ORDER BY i; + i +----- + 101 + 110 +(2 rows) + diff --git a/contrib/btree_gin/expected/varchar.out b/contrib/btree_gin/expected/varchar.out new file mode 100644 index 0000000..086afbc --- /dev/null +++ b/contrib/btree_gin/expected/varchar.out @@ -0,0 +1,44 @@ +set enable_seqscan=off; +CREATE TABLE test_varchar ( + i varchar +); +INSERT INTO test_varchar VALUES ('a'),('ab'),('abc'),('abb'),('axy'),('xyz'); +CREATE INDEX idx_varchar ON test_varchar USING gin (i); +SELECT * FROM test_varchar WHERE i<'abc'::varchar ORDER BY i; + i +----- + a + ab + abb +(3 rows) + +SELECT * FROM test_varchar WHERE i<='abc'::varchar ORDER BY i; + i +----- + a + ab + abb + abc +(4 rows) + +SELECT * FROM test_varchar WHERE i='abc'::varchar ORDER BY i; + i +----- + abc +(1 row) + +SELECT * FROM test_varchar WHERE i>='abc'::varchar ORDER BY i; + i +----- + abc + axy + xyz +(3 rows) + +SELECT * FROM test_varchar WHERE i>'abc'::varchar ORDER BY i; + i +----- + axy + xyz +(2 rows) + |