Re: should we have a fast-path planning for OLTP starjoins?

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nico Williams <nico(at)cryptonector(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: should we have a fast-path planning for OLTP starjoins?
Date: 2025-11-19 19:35:11
Message-ID: 236a8745-68a4-4659-bbbe-90673aa10614@vondra.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/15/25 16:57, Tom Lane wrote:
> Nico Williams <nico(at)cryptonector(dot)com> writes:
>> Some unsolicited advice:
>> ...
>> But here you can just use the order that the SQL uses. It gives the
>> author some power.
>
> If that's the approach you want, it's been possible for decades:
> "set join_collapse_limit = 1" and away you go. I don't feel a
> need to invent a different version of that for star schemas.
>
> I do not think this patch should have ambitions beyond the stated
> one of avoiding useless join-order search effort. If you try to
> load more than that onto the plate you'll probably end in failure.
>

FWIW I certainly agree with this. The motivation is to speed up planning
with starjoin-like queries, and that's still the primary goal. If it
could handle more complex cases (snowflake, inverse starjoin), great.
But I have no ambition to make it somehow generic and much more complex.

The main thing I'm really unsure about is what to do about joins that
increase the cardinality. AFAICS that's the only possible regression if
we simply move joins with dimensions at the end. Not sure what to do
about that before the actual join search ...

regards

--
Tomas Vondra

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-11-19 19:36:53 Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?
Previous Message Jacob Champion 2025-11-19 19:26:02 Re: Make PGOAUTHCAFILE in libpq-oauth work out of debug mode