public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrei Lepikhov <[email protected]>
To: Felipe López Montes <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Simple query with Planner underestimating rows.
Date: Wed, 29 Jan 2025 15:57:15 +0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <CACJPJu8CT7wDgKXpx9b7HjavywsjqWUt8Zd3f=bFBa_3tYRs1Q@mail.gmail.com>
References: <CACJPJu-0u221Bker1yn=AJ3xJbW0j29mSM=EvkA_SXecv75hqw@mail.gmail.com>
	<[email protected]>
	<CACJPJu8CT7wDgKXpx9b7HjavywsjqWUt8Zd3f=bFBa_3tYRs1Q@mail.gmail.com>

On 1/29/25 15:32, Felipe López Montes wrote:
> Hi,
> 
> Thank you for your reply,
> 
> I have already tried creating such statistics on t3.programme_identifier 
> and t3.participant_identifier and the plan is the same, however I cannot 
> create them for the right part of the join as they are from different 
> tables (t1 and t2)
Of course, because for now, a join clause can't be estimated by extended 
statistics. It applies only to a scan filter (clause referencing only 
one relation).
I have meant that with the development patch [1] applied, you may create 
two statistics on t3(participant_identifier,programme_identifier) and 
t2(participant_identifier,programme_identifier). These statistics would 
then be used to estimate the join clause and may resolve the problem.

[1] using extended statistics to improve join estimates
https://www.postgresql.org/message-id/flat/c8c0ff31-3a8a-7562-bbd3-78b2ec65f16c%40enterprisedb.com

-- 
regards, Andrei Lepikhov





view thread (4+ messages)

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Simple query with Planner underestimating rows.
  In-Reply-To: <[email protected]>

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

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