BUG #1326: Unique and Primary Key index over bigint type doesn't work

From: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1326: Unique and Primary Key index over bigint type doesn't work
Date: 2004-11-19 14:25:17
Message-ID: 20041119142517.E54007385E5@www.postgresql.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1326
Logged by: Fernando Kasten Peinado

Email address: fernandopeinado(at)uol(dot)com(dot)br

PostgreSQL version: 7.4.5

Operating system: Linux RedHat 7.3

Description: Unique and Primary Key index over bigint type doesn't
work

Details:

index is not used when Type is bigint.

sislu=> \d x
Table "public.x"
Column | Type | Modifiers
--------+------------------------+-----------
id | bigint | not null
name | character varying(100) |
age | integer |
bigid | bigint |
Indexes:
"x_pkey" primary key, btree (id)
"un_x_age" unique, btree (age)
"un_x_bigid" unique, btree (bigid)
"un_x_name" unique, btree (name)

sislu=> explain select * from x where x.id = 12345;
QUERY PLAN
---------------------------------------------------
Seq Scan on x (cost=0.00..22.50 rows=2 width=88)
Filter: (id = 12345)
(2 rows)

sislu=> explain select * from x where x.bigid = 12345;
QUERY PLAN
---------------------------------------------------
Seq Scan on x (cost=0.00..22.50 rows=2 width=88)
Filter: (bigid = 12345)
(2 rows)

sislu=> explain select * from x where x.name = 'asdf';
QUERY PLAN
--------------------------------------------------------------------
Index Scan using un_x_name on x (cost=0.00..4.82 rows=2 width=88)
Index Cond: ((name)::text = 'asdf'::text)
(2 rows)

sislu=> explain select * from x where x.age = 1;
QUERY PLAN
-------------------------------------------------------------------
Index Scan using un_x_age on x (cost=0.00..4.82 rows=2 width=88)
Index Cond: (age = 1)
(2 rows)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Huxton 2004-11-19 15:52:19 Re: BUG #1326: Unique and Primary Key index over bigint type
Previous Message David Schweikert 2004-11-19 12:20:34 select to_number('1,000', '999,999');