hi,
i observed strange behavior using hash index. is it a known bug?
the index was created before loading data into table. when i recreate the
tc01_tc01pk____idx index everything is ok.
and i can see some other strange things with hash indexes in other tables.
is it possible that i'm using hash indexes in a bad way? or is it because
of using multiple indexes on one column?
any ideas?
thanks,
kuba
db_c01=# select version();
version
---------------------------------------------------------------
PostgreSQL 7.1.2 on i686-pc-linux-gnu, compiled by GCC 2.95.4
-- running debian, kernel 2.4, installed from .deb package
db_c01=# \d tc01
Table "tc01"
Attribute | Type | Modifier
-----------+-----------------------+--------------------------------------------------------
tc01pk___ | integer | not null default
nextval('"tc01_tc01pk____seq"'::text)
tc01mobil | character varying(30) | not null
tc01jmeno | character varying(50) |
tc01prijm | character varying(50) |
tc01zusta | double precision | not null
tc03pk___ | integer | not null
tc01akt__ | boolean | not null default 't'::bool
Indices: tc01_pkey,
tc01_tc01pk____idx,
tc01_tc01prijm_idx
-- tc01_tc01pk is a hash index on tc01pk___
-- tc01_pkey is a btree index on tc01pk___
db_c01=# explain select oid, * from tc01 order by tc01pk___ desc LIMIT 1;
Limit (cost=0.00..0.06 rows=1 width=57)
-> Index Scan Backward using tc01_pkey on tc01 (cost=0.00..59.00
rows=1000 width=57)
db_c01=# select oid, * from tc01 order by tc01pk___ desc LIMIT 1;
oid | tc01pk___ | tc01mobil | tc01jmeno | tc01prijm | tc01zusta |
tc03pk__
---------+-----------+------------+-----------+-----------+-----------+---------
1469963 | 10003 | 0609123456 | pepa | vomacka | 10000 |
(1 row)
db_c01=# explain select oid, * from tc01 where tc01pk___ = 10003;
Index Scan using tc01_tc01pk____idx on tc01 (cost=0.00..8.14 rows=10
width=57)
db_c01=# select oid, * from tc01 where tc01pk___ = 10003;
oid | tc01pk___ | tc01mobil | tc01jmeno | tc01prijm | tc01zusta |
tc03pk___ | t
-----+-----------+-----------+-----------+-----------+-----------+-----------+--
(0 rows)