1--
2-- HASH_INDEX
3-- grep 843938989 hash.data
4--
5
6SELECT * FROM hash_i4_heap
7   WHERE hash_i4_heap.random = 843938989;
8
9--
10-- hash index
11-- grep 66766766 hash.data
12--
13SELECT * FROM hash_i4_heap
14   WHERE hash_i4_heap.random = 66766766;
15
16--
17-- hash index
18-- grep 1505703298 hash.data
19--
20SELECT * FROM hash_name_heap
21   WHERE hash_name_heap.random = '1505703298'::name;
22
23--
24-- hash index
25-- grep 7777777 hash.data
26--
27SELECT * FROM hash_name_heap
28   WHERE hash_name_heap.random = '7777777'::name;
29
30--
31-- hash index
32-- grep 1351610853 hash.data
33--
34SELECT * FROM hash_txt_heap
35   WHERE hash_txt_heap.random = '1351610853'::text;
36
37--
38-- hash index
39-- grep 111111112222222233333333 hash.data
40--
41SELECT * FROM hash_txt_heap
42   WHERE hash_txt_heap.random = '111111112222222233333333'::text;
43
44--
45-- hash index
46-- grep 444705537 hash.data
47--
48SELECT * FROM hash_f8_heap
49   WHERE hash_f8_heap.random = '444705537'::float8;
50
51--
52-- hash index
53-- grep 88888888 hash.data
54--
55SELECT * FROM hash_f8_heap
56   WHERE hash_f8_heap.random = '88888888'::float8;
57
58--
59-- hash index
60-- grep '^90[^0-9]' hashovfl.data
61--
62-- SELECT count(*) AS i988 FROM hash_ovfl_heap
63--    WHERE x = 90;
64
65--
66-- hash index
67-- grep '^1000[^0-9]' hashovfl.data
68--
69-- SELECT count(*) AS i0 FROM hash_ovfl_heap
70--    WHERE x = 1000;
71
72--
73-- HASH
74--
75UPDATE hash_i4_heap
76   SET random = 1
77   WHERE hash_i4_heap.seqno = 1492;
78
79SELECT h.seqno AS i1492, h.random AS i1
80   FROM hash_i4_heap h
81   WHERE h.random = 1;
82
83UPDATE hash_i4_heap
84   SET seqno = 20000
85   WHERE hash_i4_heap.random = 1492795354;
86
87SELECT h.seqno AS i20000
88   FROM hash_i4_heap h
89   WHERE h.random = 1492795354;
90
91UPDATE hash_name_heap
92   SET random = '0123456789abcdef'::name
93   WHERE hash_name_heap.seqno = 6543;
94
95SELECT h.seqno AS i6543, h.random AS c0_to_f
96   FROM hash_name_heap h
97   WHERE h.random = '0123456789abcdef'::name;
98
99UPDATE hash_name_heap
100   SET seqno = 20000
101   WHERE hash_name_heap.random = '76652222'::name;
102
103--
104-- this is the row we just replaced; index scan should return zero rows
105--
106SELECT h.seqno AS emptyset
107   FROM hash_name_heap h
108   WHERE h.random = '76652222'::name;
109
110UPDATE hash_txt_heap
111   SET random = '0123456789abcdefghijklmnop'::text
112   WHERE hash_txt_heap.seqno = 4002;
113
114SELECT h.seqno AS i4002, h.random AS c0_to_p
115   FROM hash_txt_heap h
116   WHERE h.random = '0123456789abcdefghijklmnop'::text;
117
118UPDATE hash_txt_heap
119   SET seqno = 20000
120   WHERE hash_txt_heap.random = '959363399'::text;
121
122SELECT h.seqno AS t20000
123   FROM hash_txt_heap h
124   WHERE h.random = '959363399'::text;
125
126UPDATE hash_f8_heap
127   SET random = '-1234.1234'::float8
128   WHERE hash_f8_heap.seqno = 8906;
129
130SELECT h.seqno AS i8096, h.random AS f1234_1234
131   FROM hash_f8_heap h
132   WHERE h.random = '-1234.1234'::float8;
133
134UPDATE hash_f8_heap
135   SET seqno = 20000
136   WHERE hash_f8_heap.random = '488912369'::float8;
137
138SELECT h.seqno AS f20000
139   FROM hash_f8_heap h
140   WHERE h.random = '488912369'::float8;
141
142-- UPDATE hash_ovfl_heap
143--    SET x = 1000
144--   WHERE x = 90;
145
146-- this vacuums the index as well
147-- VACUUM hash_ovfl_heap;
148
149-- SELECT count(*) AS i0 FROM hash_ovfl_heap
150--   WHERE x = 90;
151
152-- SELECT count(*) AS i988 FROM hash_ovfl_heap
153--  WHERE x = 1000;
154