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=#

Reply via email to