Re: Is there value in having optimizer stats for joins/foreignkeys? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Is there value in having optimizer stats for joins/foreignkeys?
Date
Msg-id 246035.1764627115@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is there value in having optimizer stats for joins/foreignkeys?  (Tomas Vondra <tomas@vondra.me>)
Responses Re: Is there value in having optimizer stats for joins/foreignkeys?
List pgsql-hackers
Tomas Vondra <tomas@vondra.me> writes:
> On 12/1/25 21:10, Corey Huinker wrote:
>> Threads like [1] and [2] have gotten me thinking that there may be some
>> value in storing statistics about joins.

> Do I understand correctly you propose to collect such stats for every
> foreign key? I recall something like that was proposed in the past, and
> the argument against was that for many joins it'd be a waste because the
> estimates are good enough. And for OLTP systems that's probably true.

Yeah, I think that automated choices about this are unlikely to work
well.  We chose the syntax for CREATE STATISTICS with an eye to
allowing users to declaratively tell us to collect stats about
specific joins, and I still think that's a more promising approach.
But nobody's yet worked out any details.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Changing the state of data checksums in a running cluster
Next
From: Myles Lewis
Date:
Subject: Re: [PATCH] contrib: Add pg_datemath extension with datediff function