Re: MergeJoin beats HashJoin in the case of multiple hash clauses

From: Tender Wang <tndrwang(at)gmail(dot)com>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: MergeJoin beats HashJoin in the case of multiple hash clauses
Date: 2025-04-14 06:17:17
Message-ID: CAHewXNnA+5sjiZTF+4nEDNM1F-+2yP+1cpqZXwUkm6uwmPUW0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While I debug hashjoin codes, in estimate_multivariate_bucketsize(), I
find that
the list_copy(hashclauses) below is unnecessary if we have a single join
clause.

List *clauses = list_copy(hashclauses);
...

I adjust the place of list_copy() call as the attached patch.
This can save some overhead of function calls and memory copies.

Any thoughts?

--
Thanks, Tender Wang

Attachment Content-Type Size
0001-Adjust-the-place-of-list_copy-in-estimate_multivaria.patch text/plain 1.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2025-04-14 06:49:59 Re: An incorrect check in get_memoize_path
Previous Message Hayato Kuroda (Fujitsu) 2025-04-14 06:15:07 RE: Add pg_get_injection_points() for information of injection points