Re: Optimizer problem in 8.1.6

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fernando Schapachnik <fernando(at)mecon(dot)gov(dot)ar>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Optimizer problem in 8.1.6
Date: 2007-06-22 17:54:56
Message-ID: 24598.1182534896@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Fernando Schapachnik <fernando(at)mecon(dot)gov(dot)ar> writes:
> En un mensaje anterior, Tom Lane escribi:
>> Is this query really what you want to do? Because the OR overrides all
>> the join conditions, meaning that rows having p.id_cola_por_ambito=1
>> AND p.id_situacion!=6 must produce Cartesian products against every
>> row in each of the other tables.

> Yes, yes, we found this while working on improving the query. I just
> wanted to point out that the optimizer was doing a sequential scan
> in a situation it could unfould de active_users definition, add the
> login='xxx' clause, and use the index on the users table.

What for, when the query requires fetching the entire table anyway?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Fernando Schapachnik 2007-06-22 17:59:36 Re: Optimizer problem in 8.1.6
Previous Message Harpreet Dhaliwal 2007-06-22 17:49:33 writing debug output in perl