Re: BUG #16053: Query planner performance regression in sql query with multiple CTE in v12 - Mailing list pgsql-bugs

From Andrew Gierth
Subject Re: BUG #16053: Query planner performance regression in sql query with multiple CTE in v12
Date
Msg-id 87eezhx5ck.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to BUG #16053: Query planner performance regression in sql query with multiple CTE in v12  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #16053: Query planner performance regression in sql querywith multiple CTE in v12
List pgsql-bugs
>>>>> "PG" == PG Bug reporting form <noreply@postgresql.org> writes:

 PG> After upgrading to v12 from v11.4 I've noticed one of the queries
 PG> run by an application has a significant performance degradation.

 PG> I've managed to create a toy db that illustrates the issue.
 PG> Following is a link of the db and the query in question (there
 PG> seems to be no way to attach a file from the web form. If I should
 PG> upload them somewhere else let me know)
 PG> https://www.dropbox.com/s/6n3ctdn2zohoann/toy-db_and_query.zip?dl=0 

You could at least have included the query in the message.

What seems to be happening here looks to me more down to chance than to
any bug. In v11, the join order is constrained by the CTEs, whereas in
v12 it is not; the misplan is the result of a mis-estimated 1-row result
from a subpath that may not have been considered under v11.

-- 
Andrew (irc:RhodiumToad)



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16053: Query planner performance regression in sql query with multiple CTE in v12
Next
From: Tomas Vondra
Date:
Subject: Re: BUG #16045: vacuum_db crash and illegal memory alloc afterpg_upgrade from PG11 to PG12