public inbox for [email protected]  
help / color / mirror / Atom feed
From: Richard Guo <[email protected]>
To: PostgreSQL-development <[email protected]>
Subject: Re: Short-circuit sort_inner_and_outer if there are no mergejoin clauses
Date: Thu, 25 Apr 2024 15:20:10 +0800
Message-ID: <CAMbWs4-5aehbCAJLqE-xqFRcJK3s-y3EX73YbTrjDQexcLBUhg@mail.gmail.com> (raw)
In-Reply-To: <CAMbWs48RKiZGFEd5A0JtztRY5ZdvVvNiHh0AKeuoz21F+0dVjQ@mail.gmail.com>
References: <CAMbWs48RKiZGFEd5A0JtztRY5ZdvVvNiHh0AKeuoz21F+0dVjQ@mail.gmail.com>

On Wed, Apr 24, 2024 at 5:13 PM Richard Guo <[email protected]> wrote:

> In sort_inner_and_outer, we create mergejoin join paths by explicitly
> sorting both relations on each possible ordering of the available
> mergejoin clauses.  However, if there are no available mergejoin
> clauses, we can skip this process entirely.  It seems that this is a
> relatively common scenario.  Checking the regression tests I noticed
> that there are a lot of cases where we would arrive here with an empty
> mergeclause_list.
>

FWIW, during the run of the core regression tests, I found that we enter
sort_inner_and_outer with an empty mergeclause_list a total of 11064
times.  Out of these occurrences, there are 293 instances where the join
type is JOIN_UNIQUE_OUTER, indicating the need to create a UniquePath
for the outer path.  Similarly, there are also 293 instances where the
join type is JOIN_UNIQUE_INNER, indicating the need to create a
UniquePath for the inner path.

Thanks
Richard


view thread (2+ 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]
  Subject: Re: Short-circuit sort_inner_and_outer if there are no mergejoin clauses
  In-Reply-To: <CAMbWs4-5aehbCAJLqE-xqFRcJK3s-y3EX73YbTrjDQexcLBUhg@mail.gmail.com>

* 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