2000-01-09 04:48:39 +01:00
|
|
|
--
|
|
|
|
-- HASH_INDEX
|
|
|
|
-- grep 843938989 hash.data
|
|
|
|
--
|
2005-04-07 03:51:41 +02:00
|
|
|
SELECT * FROM hash_i4_heap
|
1997-04-29 16:23:51 +02:00
|
|
|
WHERE hash_i4_heap.random = 843938989;
|
2000-01-09 04:48:39 +01:00
|
|
|
seqno | random
|
|
|
|
-------+-----------
|
|
|
|
15 | 843938989
|
1997-04-29 16:23:51 +02:00
|
|
|
(1 row)
|
|
|
|
|
2000-01-09 04:48:39 +01:00
|
|
|
--
|
|
|
|
-- hash index
|
|
|
|
-- grep 66766766 hash.data
|
|
|
|
--
|
2005-04-07 03:51:41 +02:00
|
|
|
SELECT * FROM hash_i4_heap
|
1997-04-29 16:23:51 +02:00
|
|
|
WHERE hash_i4_heap.random = 66766766;
|
2000-01-09 04:48:39 +01:00
|
|
|
seqno | random
|
|
|
|
-------+--------
|
1997-04-29 16:23:51 +02:00
|
|
|
(0 rows)
|
|
|
|
|
2000-01-09 04:48:39 +01:00
|
|
|
--
|
|
|
|
-- hash index
|
|
|
|
-- grep 1505703298 hash.data
|
|
|
|
--
|
2005-04-07 03:51:41 +02:00
|
|
|
SELECT * FROM hash_name_heap
|
1998-04-26 06:12:15 +02:00
|
|
|
WHERE hash_name_heap.random = '1505703298'::name;
|
2000-01-09 04:48:39 +01:00
|
|
|
seqno | random
|
|
|
|
-------+------------
|
|
|
|
9838 | 1505703298
|
1997-04-29 16:23:51 +02:00
|
|
|
(1 row)
|
|
|
|
|
2000-01-09 04:48:39 +01:00
|
|
|
--
|
|
|
|
-- hash index
|
|
|
|
-- grep 7777777 hash.data
|
|
|
|
--
|
2005-04-07 03:51:41 +02:00
|
|
|
SELECT * FROM hash_name_heap
|
1998-04-26 06:12:15 +02:00
|
|
|
WHERE hash_name_heap.random = '7777777'::name;
|
2000-01-09 04:48:39 +01:00
|
|
|
seqno | random
|
|
|
|
-------+--------
|
1997-04-29 16:23:51 +02:00
|
|
|
(0 rows)
|
|
|
|
|
2000-01-09 04:48:39 +01:00
|
|
|
--
|
|
|
|
-- hash index
|
|
|
|
-- grep 1351610853 hash.data
|
|
|
|
--
|
2005-04-07 03:51:41 +02:00
|
|
|
SELECT * FROM hash_txt_heap
|
1997-04-29 16:23:51 +02:00
|
|
|
WHERE hash_txt_heap.random = '1351610853'::text;
|
2000-01-09 04:48:39 +01:00
|
|
|
seqno | random
|
|
|
|
-------+------------
|
|
|
|
5677 | 1351610853
|
1997-04-29 16:23:51 +02:00
|
|
|
(1 row)
|
|
|
|
|
2000-01-09 04:48:39 +01:00
|
|
|
--
|
|
|
|
-- hash index
|
|
|
|
-- grep 111111112222222233333333 hash.data
|
|
|
|
--
|
2005-04-07 03:51:41 +02:00
|
|
|
SELECT * FROM hash_txt_heap
|
1997-04-29 16:23:51 +02:00
|
|
|
WHERE hash_txt_heap.random = '111111112222222233333333'::text;
|
2000-01-09 04:48:39 +01:00
|
|
|
seqno | random
|
|
|
|
-------+--------
|
1997-04-29 16:23:51 +02:00
|
|
|
(0 rows)
|
|
|
|
|
2000-01-09 04:48:39 +01:00
|
|
|
--
|
|
|
|
-- hash index
|
|
|
|
-- grep 444705537 hash.data
|
|
|
|
--
|
2005-04-07 03:51:41 +02:00
|
|
|
SELECT * FROM hash_f8_heap
|
1997-04-29 16:23:51 +02:00
|
|
|
WHERE hash_f8_heap.random = '444705537'::float8;
|
2000-01-09 04:48:39 +01:00
|
|
|
seqno | random
|
|
|
|
-------+-----------
|
|
|
|
7853 | 444705537
|
1997-04-29 16:23:51 +02:00
|
|
|
(1 row)
|
|
|
|
|
2000-01-09 04:48:39 +01:00
|
|
|
--
|
|
|
|
-- hash index
|
|
|
|
-- grep 88888888 hash.data
|
|
|
|
--
|
2005-04-07 03:51:41 +02:00
|
|
|
SELECT * FROM hash_f8_heap
|
1997-04-29 16:23:51 +02:00
|
|
|
WHERE hash_f8_heap.random = '88888888'::float8;
|
2000-01-09 04:48:39 +01:00
|
|
|
seqno | random
|
|
|
|
-------+--------
|
1997-04-29 16:23:51 +02:00
|
|
|
(0 rows)
|
|
|
|
|
2000-01-09 04:48:39 +01:00
|
|
|
--
|
|
|
|
-- hash index
|
|
|
|
-- grep '^90[^0-9]' hashovfl.data
|
|
|
|
--
|
|
|
|
-- SELECT count(*) AS i988 FROM hash_ovfl_heap
|
|
|
|
-- WHERE x = 90;
|
|
|
|
--
|
|
|
|
-- hash index
|
|
|
|
-- grep '^1000[^0-9]' hashovfl.data
|
|
|
|
--
|
|
|
|
-- SELECT count(*) AS i0 FROM hash_ovfl_heap
|
|
|
|
-- WHERE x = 1000;
|
|
|
|
--
|
|
|
|
-- HASH
|
|
|
|
--
|
|
|
|
UPDATE hash_i4_heap
|
1997-04-29 16:23:51 +02:00
|
|
|
SET random = 1
|
|
|
|
WHERE hash_i4_heap.seqno = 1492;
|
2000-01-09 04:48:39 +01:00
|
|
|
SELECT h.seqno AS i1492, h.random AS i1
|
1997-04-29 16:23:51 +02:00
|
|
|
FROM hash_i4_heap h
|
|
|
|
WHERE h.random = 1;
|
2000-01-09 04:48:39 +01:00
|
|
|
i1492 | i1
|
|
|
|
-------+----
|
|
|
|
1492 | 1
|
1997-04-29 16:23:51 +02:00
|
|
|
(1 row)
|
|
|
|
|
2010-11-23 21:27:50 +01:00
|
|
|
UPDATE hash_i4_heap
|
|
|
|
SET seqno = 20000
|
1997-04-29 16:23:51 +02:00
|
|
|
WHERE hash_i4_heap.random = 1492795354;
|
2010-11-23 21:27:50 +01:00
|
|
|
SELECT h.seqno AS i20000
|
1997-04-29 16:23:51 +02:00
|
|
|
FROM hash_i4_heap h
|
|
|
|
WHERE h.random = 1492795354;
|
2000-01-09 04:48:39 +01:00
|
|
|
i20000
|
|
|
|
--------
|
|
|
|
20000
|
1997-04-29 16:23:51 +02:00
|
|
|
(1 row)
|
|
|
|
|
2010-11-23 21:27:50 +01:00
|
|
|
UPDATE hash_name_heap
|
1998-04-26 06:12:15 +02:00
|
|
|
SET random = '0123456789abcdef'::name
|
|
|
|
WHERE hash_name_heap.seqno = 6543;
|
2000-01-09 04:48:39 +01:00
|
|
|
SELECT h.seqno AS i6543, h.random AS c0_to_f
|
1998-04-26 06:12:15 +02:00
|
|
|
FROM hash_name_heap h
|
|
|
|
WHERE h.random = '0123456789abcdef'::name;
|
2000-01-09 04:48:39 +01:00
|
|
|
i6543 | c0_to_f
|
|
|
|
-------+------------------
|
|
|
|
6543 | 0123456789abcdef
|
1997-04-29 16:23:51 +02:00
|
|
|
(1 row)
|
|
|
|
|
2000-01-09 04:48:39 +01:00
|
|
|
UPDATE hash_name_heap
|
1997-04-29 16:23:51 +02:00
|
|
|
SET seqno = 20000
|
1998-04-26 06:12:15 +02:00
|
|
|
WHERE hash_name_heap.random = '76652222'::name;
|
2000-01-09 04:48:39 +01:00
|
|
|
--
|
2010-11-23 21:27:50 +01:00
|
|
|
-- this is the row we just replaced; index scan should return zero rows
|
2000-01-09 04:48:39 +01:00
|
|
|
--
|
|
|
|
SELECT h.seqno AS emptyset
|
1998-04-26 06:12:15 +02:00
|
|
|
FROM hash_name_heap h
|
|
|
|
WHERE h.random = '76652222'::name;
|
2000-01-09 04:48:39 +01:00
|
|
|
emptyset
|
|
|
|
----------
|
1997-04-29 16:23:51 +02:00
|
|
|
(0 rows)
|
|
|
|
|
2010-11-23 21:27:50 +01:00
|
|
|
UPDATE hash_txt_heap
|
1997-04-29 16:23:51 +02:00
|
|
|
SET random = '0123456789abcdefghijklmnop'::text
|
|
|
|
WHERE hash_txt_heap.seqno = 4002;
|
2000-01-09 04:48:39 +01:00
|
|
|
SELECT h.seqno AS i4002, h.random AS c0_to_p
|
1997-04-29 16:23:51 +02:00
|
|
|
FROM hash_txt_heap h
|
|
|
|
WHERE h.random = '0123456789abcdefghijklmnop'::text;
|
2000-01-09 04:48:39 +01:00
|
|
|
i4002 | c0_to_p
|
|
|
|
-------+----------------------------
|
|
|
|
4002 | 0123456789abcdefghijklmnop
|
1997-04-29 16:23:51 +02:00
|
|
|
(1 row)
|
|
|
|
|
2000-01-09 04:48:39 +01:00
|
|
|
UPDATE hash_txt_heap
|
1997-04-29 16:23:51 +02:00
|
|
|
SET seqno = 20000
|
|
|
|
WHERE hash_txt_heap.random = '959363399'::text;
|
2000-01-09 04:48:39 +01:00
|
|
|
SELECT h.seqno AS t20000
|
1997-04-29 16:23:51 +02:00
|
|
|
FROM hash_txt_heap h
|
|
|
|
WHERE h.random = '959363399'::text;
|
2000-01-09 04:48:39 +01:00
|
|
|
t20000
|
|
|
|
--------
|
|
|
|
20000
|
1997-04-29 16:23:51 +02:00
|
|
|
(1 row)
|
|
|
|
|
2000-01-09 04:48:39 +01:00
|
|
|
UPDATE hash_f8_heap
|
1997-04-29 16:23:51 +02:00
|
|
|
SET random = '-1234.1234'::float8
|
|
|
|
WHERE hash_f8_heap.seqno = 8906;
|
2010-11-23 21:27:50 +01:00
|
|
|
SELECT h.seqno AS i8096, h.random AS f1234_1234
|
1997-04-29 16:23:51 +02:00
|
|
|
FROM hash_f8_heap h
|
|
|
|
WHERE h.random = '-1234.1234'::float8;
|
2000-01-09 04:48:39 +01:00
|
|
|
i8096 | f1234_1234
|
|
|
|
-------+------------
|
|
|
|
8906 | -1234.1234
|
1997-04-29 16:23:51 +02:00
|
|
|
(1 row)
|
|
|
|
|
2010-11-23 21:27:50 +01:00
|
|
|
UPDATE hash_f8_heap
|
1997-04-29 16:23:51 +02:00
|
|
|
SET seqno = 20000
|
|
|
|
WHERE hash_f8_heap.random = '488912369'::float8;
|
2000-01-09 04:48:39 +01:00
|
|
|
SELECT h.seqno AS f20000
|
1997-04-29 16:23:51 +02:00
|
|
|
FROM hash_f8_heap h
|
|
|
|
WHERE h.random = '488912369'::float8;
|
2000-01-09 04:48:39 +01:00
|
|
|
f20000
|
|
|
|
--------
|
|
|
|
20000
|
1997-04-29 16:23:51 +02:00
|
|
|
(1 row)
|
|
|
|
|
2000-01-09 04:48:39 +01:00
|
|
|
-- UPDATE hash_ovfl_heap
|
|
|
|
-- SET x = 1000
|
|
|
|
-- WHERE x = 90;
|
|
|
|
-- this vacuums the index as well
|
|
|
|
-- VACUUM hash_ovfl_heap;
|
|
|
|
-- SELECT count(*) AS i0 FROM hash_ovfl_heap
|
|
|
|
-- WHERE x = 90;
|
|
|
|
-- SELECT count(*) AS i988 FROM hash_ovfl_heap
|
|
|
|
-- WHERE x = 1000;
|