Re: [GENERAL] Query planner issue

2008-09-19 Thread Scott Marlowe
On Fri, Sep 19, 2008 at 4:17 AM, Andrea Moretto <[EMAIL PROTECTED]> wrote: > Hi there, > > I am currently running Postgres 8.3.1. > > I've got a table called DETAILS, the primary key is : DE_ID char(12), there > is another field CO_ID char (12). > DE_ID and CO_ID are indexed with a btree. This tab

Re: [GENERAL] Query planner issue

2008-09-19 Thread Kevin Hunter
As Richard already pointed out the query issues, I'll point out the low-hanging fruit. At 6:17am -0400 on Fri, 19 Sep 2008, Andrea Moretto wrote: > I am currently running Postgres 8.3.1. ^ The current minor release is 8.3.3 and 8.3.4 is expected Monday. U

Re: [GENERAL] Query planner issue

2008-09-19 Thread Andrea Moretto
Dear Richard, you are right. So Postgres takes a lot of time to get out an impossible result! The query I wrote is just a test, the concatenation is only a dummy. On 19/set/08, at 12:33, Richard Huxton wrote: Andrea Moretto wrote: I've got a table called DETAILS, the primary key is : DE_

Re: [GENERAL] Query planner issue

2008-09-19 Thread Richard Huxton
Andrea Moretto wrote: > I've got a table called DETAILS, the primary key is : DE_ID char(12), > there is another field CO_ID char (12). > If I run "explain analyze select * from details where co_id || co_id = > '0100760153722324445';" it runs a sequential scan not using the index > (which takes ab

[GENERAL] Query planner issue

2008-09-19 Thread Andrea Moretto
Hi there, I am currently running Postgres 8.3.1. I've got a table called DETAILS, the primary key is : DE_ID char(12), there is another field CO_ID char (12). DE_ID and CO_ID are indexed with a btree. This table is about 140 millions of records. If I execute an "explain select * from det