From: | "Victor Krasinsky" <victor(at)psoft(dot)lviv(dot)ua> |
---|---|
To: | <pgsql-bugs(at)postgresql(dot)org> |
Subject: | BUG: bigint and indexes ? |
Date: | 2002-03-01 13:19:29 |
Message-ID: | 12bd01c1c123$b84d3bd0$6b70a8c0@pcvictor |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Is it a known bug if optimizer, that Postgres can't use indexes created on a int8 (bigint) ?
This problem exists in 7.1.3 and even in 7.2.
test=# CREATE TABLE parent_child (
test(# parent_id int8 NOT NULL,
test(# parent_type int4 NOT NULL,
test(# child_id int8 NOT NULL PRIMARY KEY,
test(# child_type int4 NOT NULL,
test(# account_id int8 NOT NULL,
test(# p_begin date,
test(# suspended int4);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'parent_child_pkey' for table 'parent_child'
CREATE
test=# explain select * from parent_child where child_id=1;
NOTICE: QUERY PLAN:
Seq Scan on parent_child (cost=0.00..22.50 rows=1 width=40)
EXPLAIN
test=# create index parent_child_childtype on parent_child(child_type);
CREATE
test=# explain select * from parent_child where child_type=1;
NOTICE: QUERY PLAN:
Index Scan using parent_child_childtype on parent_child (cost=0.00..17.07 rows=5 width=40)
EXPLAIN
test=#
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-03-01 14:37:40 | Re: Indexes not always used after inserts/updates/vacuum analyze |
Previous Message | UltraMax | 2002-03-01 12:36:43 | Re: cannot install postgresql 7.2 |