pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Jian Guo <gjian@vmware.com>
To: Hans Buschmann <buschmann@nidsa.net>
To: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Cc: Zhenghua Lyu <zlyu@vmware.com>
Subject: Re: Wrong rows estimations with joins of CTEs slows queries by more than factor 500
Date: Mon, 21 Aug 2023 12:56:18 +0200
Message-ID: <8e629488-cb14-5f17-adb3-c02205ebacab@enterprisedb.com> (raw)
In-Reply-To: <SN6PR05MB5199C0095508555B7D8D0D23C41EA@SN6PR05MB5199.namprd05.prod.outlook.com>
References: <4504e67078d648cdac3651b2960da6e7@nidsa.net>
	<SN6PR05MB5199BB4BB8C982BB519B6660C417A@SN6PR05MB5199.namprd05.prod.outlook.com>
	<46a7d950-7ca7-8ab9-76dd-f0bc7611c609@enterprisedb.com>
	<SN6PR05MB5199C0095508555B7D8D0D23C41EA@SN6PR05MB5199.namprd05.prod.outlook.com>

On 8/21/23 10:16, Jian Guo wrote:
> Hi hackers,
> 
> I found a new approach to fix this issue, which seems better, so I would
> like to post another version of the patch here. The origin patch made
> the assumption of the values of Vars from CTE must be unique, which
> could be very wrong. This patch examines variables for Vars inside CTE,
> which avoided the bad assumption, so the results could be much more
> accurate.
> 

No problem with posting a reworked patch to the same thread, but I'll
repeat my suggestion to register this in the CF app [1]. The benefit is
that people are more likely to notice the patch and also cfbot [2] will
run regression tests.

[1] https://commitfest.postgresql.org
[2] http://cfbot.cputube.org/


-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





view thread (29+ messages)  latest in thread

Message-ID: <8e629488-cb14-5f17-adb3-c02205ebacab@enterprisedb.com>
Permalink:  ../8e629488-cb14-5f17-adb3-c02205ebacab@enterprisedb.com/
Also on:    postgresql.org/message-id/8e629488-cb14-5f17-adb3-c02205ebacab@enterprisedb.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tomas.vondra@enterprisedb.com, gjian@vmware.com, buschmann@nidsa.net, pgsql-hackers@lists.postgresql.org, zlyu@vmware.com
  Subject: Re: Wrong rows estimations with joins of CTEs slows queries by more than factor 500
  In-Reply-To: <8e629488-cb14-5f17-adb3-c02205ebacab@enterprisedb.com>

* 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