pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: cfederico87@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16053: Query planner performance regression in sql query with multiple CTE in v12
Date: Sat, 12 Oct 2019 18:17:21 +0100
Message-ID: <87eezhx5ck.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <16053-c96a1db8b5cbffde@postgresql.org>
References: <16053-c96a1db8b5cbffde@postgresql.org>

>>>>> "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)





view thread (3+ messages)  latest in thread

Message-ID: <87eezhx5ck.fsf@news-spur.riddles.org.uk>
Permalink:  ../87eezhx5ck.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/87eezhx5ck.fsf@news-spur.riddles.org.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, cfederico87@gmail.com
  Subject: Re: BUG #16053: Query planner performance regression in sql query with multiple CTE in v12
  In-Reply-To: <87eezhx5ck.fsf@news-spur.riddles.org.uk>
  References: <16053-c96a1db8b5cbffde@postgresql.org> <87eezhx5ck.fsf@news-spur.riddles.org.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox