From: | "dan" <dan(dot)boeriu(at)roost(dot)com> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #5113: Postgres not scanning indexes |
Date: | 2009-10-13 22:46:59 |
Message-ID: | 200910132246.n9DMkxdb065836@wwwmaster.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged online:
Bug reference: 5113
Logged by: dan
Email address: dan(dot)boeriu(at)roost(dot)com
PostgreSQL version: 8.4.1
Operating system: redhat 5.3
Description: Postgres not scanning indexes
Details:
Let's say I have a table t with 5 columns c1 NOT NULL, c2 NOT NULL, c3, c4,
c5
and I have a UNIQUE index on (c1, c2) (remember c1 and c2 have a not null
constraint)
When I run the query:
select c1,c2 from t
I expect the explain to say index scan; instead it says table scan.
The index has ALL the info I need and in my case is about 2% the size of the
table. Why is Postgres still choosing to do a full table scan? The same
applies to a primary key - if (c1, c2) is the primary key then I expect:
select c1,c2 from t
to scan only the index - instead it scans the table
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Glaesemann | 2009-10-13 23:44:02 | Re: BUG #5113: Postgres not scanning indexes |
Previous Message | Chris Browne | 2009-10-13 18:59:10 | Re: BUG #5107: Lock never released |