Remove unused arguments from split_selfjoin_quals()

Started by Tender Wang3 months ago5 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

This thread has been committed, so CI has stopped here. Anything below is the last result it produced.

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t253478
psql -h localhost -U postgres

Built from patchset v3 (message #3), November 02, 2026 at 06:26 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t253478_3 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t253478_3 && git checkout t253478_3

Patchset v3 (message #3) is on t253478_3

Jump to latest
#1Tender Wang
tndrwang@gmail.com

Hi,

While reviewing a patch for a self-join elimination bug, I noticed that
split_selfjoin_quals() takes "from" and "to" arguments. These names also
seemed a little inconsistent with the "remove" and "keep" terminology
used by the surrounding SJE code.

Looking further, I found that neither of these arguments is actually
used by the function. The "root" argument is unused as well. I also
checked the history and found that these arguments have been unused
since the SJE code was initially committed.

The attached patch removes these three unused arguments and simplifies
the function interface. There is no functional change.

--
Thanks,
Tender Wang

Attachments:

t253478_1
0001-Remove-unused-arguments-from-split_selfjoin_quals.patchapplication/octet-stream; name=0001-Remove-unused-arguments-from-split_selfjoin_quals.patchDownload+3-5
#2Miłosz Bieniek
bieniek.milosz@proton.me
In reply to: Tender Wang (#1)
Re: Remove unused arguments from split_selfjoin_quals()

Hi Tender

I think `root` argument was introduced in [1]/messages/by-id/CAKJS1f8cJOCGyoxi7a_LG7eu+WKF9+HTff3wp1KKS5gcUg2Qfg@mail.gmail.com to do an assertion,
but that assertion was removed shortly after being added.
`from` and `to` on the other hand were introduced in [2]/messages/by-id/c97574c4-13e6-9107-26ab-af2bd626fc85@postgrespro.ru,
but weren't used from the start.

LGTM!

[1]: /messages/by-id/CAKJS1f8cJOCGyoxi7a_LG7eu+WKF9+HTff3wp1KKS5gcUg2Qfg@mail.gmail.com
[2]: /messages/by-id/c97574c4-13e6-9107-26ab-af2bd626fc85@postgrespro.ru

Kind regards,
Miłosz Bieniek

#3Tender Wang
tndrwang@gmail.com
In reply to: Miłosz Bieniek (#2)
Re: Remove unused arguments from split_selfjoin_quals()

Miłosz Bieniek <bieniek.milosz@proton.me> 于2026年8月27日周四 18:21写道:

I think `root` argument was introduced in [1] to do an assertion,
but that assertion was removed shortly after being added.
`from` and `to` on the other hand were introduced in [2],
but weren't used from the start.

LGTM!

[1] /messages/by-id/CAKJS1f8cJOCGyoxi7a_LG7eu+WKF9+HTff3wp1KKS5gcUg2Qfg@mail.gmail.com
[2] /messages/by-id/c97574c4-13e6-9107-26ab-af2bd626fc85@postgrespro.ru

Thanks, Miłosz, for the review and the historical details.

While looking through the SJE code again, I noticed that the "root"
argument of match_unique_clauses() is also unused. Attached is v2,
which removes that argument in addition to the three unused arguments
of split_selfjoin_quals() covered by the original patch.

There is no functional change.

--
Thanks,
Tender Wang

Attachments:

t253478_3
V2-Remove-unused-parameters-from-self-join-elimination-.patchtext/plain; charset=US-ASCII; name=V2-Remove-unused-parameters-from-self-join-elimination-.patchDownload+5-8
#4Fujii Masao
masao.fujii@gmail.com
In reply to: Tender Wang (#3)
Re: Remove unused arguments from split_selfjoin_quals()

On Sun, Nov 1, 2026 at 3:12 PM Tender Wang <tndrwang@gmail.com> wrote:

While looking through the SJE code again, I noticed that the "root"
argument of match_unique_clauses() is also unused. Attached is v2,
which removes that argument in addition to the three unused arguments
of split_selfjoin_quals() covered by the original patch.

Thanks for the patch! LGTM.
Barring any objections, I will commit it.

Regards,

--
Fujii Masao

#5Fujii Masao
masao.fujii@gmail.com
In reply to: Fujii Masao (#4)
Re: Remove unused arguments from split_selfjoin_quals()

On Mon, Nov 2, 2026 at 10:57 AM Fujii Masao <masao.fujii@gmail.com> wrote:

Barring any objections, I will commit it.

I've pushed the patch. Thanks!

Regards,

--
Fujii Masao