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