Debian Codegraph @

contrib/btree_gin/expected/bool.out

raw
1 set enable_seqscan=off;
2 CREATE TABLE test_bool (
3 i boolean
4 );
5 INSERT INTO test_bool VALUES (false),(true),(null);
6 CREATE INDEX idx_bool ON test_bool USING gin (i);
7 SELECT * FROM test_bool WHERE i<true ORDER BY i;
8 i
9 ---
10 f
11 (1 row)
12
13 SELECT * FROM test_bool WHERE i<=true ORDER BY i;
14 i
15 ---
16 f
17 t
18 (2 rows)
19
20 SELECT * FROM test_bool WHERE i=true ORDER BY i;
21 i
22 ---
23 t
24 (1 row)
25
26 SELECT * FROM test_bool WHERE i>=true ORDER BY i;
27 i
28 ---
29 t
30 (1 row)
31
32 SELECT * FROM test_bool WHERE i>true ORDER BY i;
33 i
34 ---
35 (0 rows)
36
37 SELECT * FROM test_bool WHERE i<false ORDER BY i;
38 i
39 ---
40 (0 rows)
41
42 SELECT * FROM test_bool WHERE i<=false ORDER BY i;
43 i
44 ---
45 f
46 (1 row)
47
48 SELECT * FROM test_bool WHERE i=false ORDER BY i;
49 i
50 ---
51 f
52 (1 row)
53
54 SELECT * FROM test_bool WHERE i>=false ORDER BY i;
55 i
56 ---
57 f
58 t
59 (2 rows)
60
61 SELECT * FROM test_bool WHERE i>false ORDER BY i;
62 i
63 ---
64 t
65 (1 row)
66
67 EXPLAIN (COSTS OFF) SELECT * FROM test_bool WHERE i<true ORDER BY i;
68 QUERY PLAN
69 -------------------------------------------
70 Sort
71 Sort Key: i
72 -> Bitmap Heap Scan on test_bool
73 Recheck Cond: (i < true)
74 -> Bitmap Index Scan on idx_bool
75 Index Cond: (i < true)
76 (6 rows)
77
78 EXPLAIN (COSTS OFF) SELECT * FROM test_bool WHERE i<=true ORDER BY i;
79 QUERY PLAN
80 -------------------------------------------
81 Sort
82 Sort Key: i
83 -> Bitmap Heap Scan on test_bool
84 Recheck Cond: (i <= true)
85 -> Bitmap Index Scan on idx_bool
86 Index Cond: (i <= true)
87 (6 rows)
88
89 EXPLAIN (COSTS OFF) SELECT * FROM test_bool WHERE i=true ORDER BY i;
90 QUERY PLAN
91 -------------------------------------------
92 Sort
93 Sort Key: i
94 -> Bitmap Heap Scan on test_bool
95 Recheck Cond: i
96 -> Bitmap Index Scan on idx_bool
97 Index Cond: (i = true)
98 (6 rows)
99
100 EXPLAIN (COSTS OFF) SELECT * FROM test_bool WHERE i>=true ORDER BY i;
101 QUERY PLAN
102 -------------------------------------------
103 Sort
104 Sort Key: i
105 -> Bitmap Heap Scan on test_bool
106 Recheck Cond: (i >= true)
107 -> Bitmap Index Scan on idx_bool
108 Index Cond: (i >= true)
109 (6 rows)
110
111 EXPLAIN (COSTS OFF) SELECT * FROM test_bool WHERE i>true ORDER BY i;
112 QUERY PLAN
113 -------------------------------------------
114 Sort
115 Sort Key: i
116 -> Bitmap Heap Scan on test_bool
117 Recheck Cond: (i > true)
118 -> Bitmap Index Scan on idx_bool
119 Index Cond: (i > true)
120 (6 rows)
121
122 -- probably sufficient to check just this one:
123 EXPLAIN (COSTS OFF) SELECT * FROM test_bool WHERE i=false ORDER BY i;
124 QUERY PLAN
125 -------------------------------------------
126 Sort
127 Sort Key: i
128 -> Bitmap Heap Scan on test_bool
129 Recheck Cond: (NOT i)
130 -> Bitmap Index Scan on idx_bool
131 Index Cond: (i = false)
132 (6 rows)
133