Re: BUG #17560: Planner can not find plan with lowest cost - Mailing list pgsql-bugs

From Stanisław Skonieczny
Subject Re: BUG #17560: Planner can not find plan with lowest cost
Date
Msg-id CADp+y_GKjB3mx9DMNxzjniNoShZqZs1o62zPxLMH9DMB5ngL3w@mail.gmail.com
Whole thread Raw
In response to Re: BUG #17560: Planner can not find plan with lowest cost  (Francisco Olarte <folarte@peoplecall.com>)
List pgsql-bugs


On Fri, Jul 29, 2022 at 9:31 AM Francisco Olarte <folarte@peoplecall.com> wrote:
Stanislaw:

On Thu, 28 Jul 2022 at 20:57, PG Bug reporting form
<noreply@postgresql.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
 

pgsql-bugs by date:

Previous
From: Laetitia Avrot
Date:
Subject: Re: Statistics updates is delayed when using `commit and chain`
Next
From: Richard Guo
Date:
Subject: Re: Re[2]: BUG #17561: Server crashes on executing row() with very long argument list