File: oid.out

package info (click to toggle)
postgresql-rum 1.3.14-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,956 kB
  • sloc: ansic: 29,184; sql: 6,614; perl: 546; python: 97; makefile: 68; sh: 64
file content (78 lines) | stat: -rw-r--r-- 1,368 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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 rum (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)

EXPLAIN (costs off)
SELECT *, i <=> 0::oid FROM test_oid ORDER BY i <=> 0::oid;
              QUERY PLAN              
--------------------------------------
 Index Scan using idx_oid on test_oid
   Order By: (i <=> '0'::oid)
(2 rows)

SELECT *, i <=> 0::oid FROM test_oid ORDER BY i <=> 0::oid;
 i | ?column? 
---+----------
 0 |        0
 1 |        1
 2 |        2
 3 |        3
 4 |        4
 5 |        5
(6 rows)

EXPLAIN (costs off)
SELECT *, i <=> 1::oid FROM test_oid WHERE i<1::oid ORDER BY i <=> 1::oid;
              QUERY PLAN              
--------------------------------------
 Index Scan using idx_oid on test_oid
   Index Cond: (i < '1'::oid)
   Order By: (i <=> '1'::oid)
(3 rows)

SELECT *, i <=> 1::oid FROM test_oid WHERE i<1::oid ORDER BY i <=> 1::oid;
 i | ?column? 
---+----------
 0 |        1
(1 row)