Re: BUG #17560: Planner can not find plan with lowest cost

From: Stanisław Skonieczny <stanislaw(dot)skonieczny(at)gmail(dot)com>
To: Francisco Olarte <folarte(at)peoplecall(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17560: Planner can not find plan with lowest cost
Date: 2022-08-01 09:06:24
Message-ID: CADp+y_GKjB3mx9DMNxzjniNoShZqZs1o62zPxLMH9DMB5ngL3w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Jul 29, 2022 at 9:31 AM Francisco Olarte <folarte(at)peoplecall(dot)com>
wrote:

> Stanislaw:
>
> On Thu, 28 Jul 2022 at 20:57, PG Bug reporting form
> <noreply(at)postgresql(dot)org> wrote:
>
> > create table ss_temp_table1 as select id, v1, v2 from ss_d order by id
> desc
> > limit 100000;
> ...
> > FROM ss_d AS d
> > JOIN ss_temp_table1 AS t1 ON t1.id = d.id AND t1.v1 = d.v1 AND
> t1.v2
> > = d.v2
>
> Do your real tables/queries have the same kind of redudant condition (
> i.e., "AND t1.v1 = d.v1 AND t1.v2" is redundant due to id being a "PK"
> )?
>
>
It is not redundant. There might be rows in ss_d and ss_temp_table1 that
have same id, but different v1, v2 values and this join should reject it,
however usually that is a minority.

> Francisco Olarte.
>

Stanisław Skonieczny

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2022-08-01 10:03:44 Re: Re[2]: BUG #17561: Server crashes on executing row() with very long argument list
Previous Message Laetitia Avrot 2022-08-01 08:13:36 Re: Statistics updates is delayed when using `commit and chain`