Remove redundant AttStatsSlot initialization in eqjoinsel()

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Remove redundant AttStatsSlot initialization in eqjoinsel()
Date: 2025-12-29 08:59:48
Message-ID: CAEoWx2kfWifbgfyjZwb0HzUZ8QC5+pj-6RCqE6xH6Xg6SCyprA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hackers,

I noticed this problem while reviewing Tom’s patch [1]. The
function eqjoinsel() unnecessarily zero-out sslot1 and sslot2 before
calling get_attstatsslot() because get_attstatsslot() will unconditionally
zero-out sslot in the first place.

I searched over the source tree, none of other callers of
get_attstatsslot() initialize sslot. So for consistency, we should remove
the unnecessary zero-out from eqjoinsel().

[1] https://postgr.es/m/2380165.1766871097@sss.pgh.pa.us

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

Attachment Content-Type Size
v1-0001-Remove-redundant-AttStatsSlot-initialization-in-e.patch application/octet-stream 1.3 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2025-12-29 09:01:46 Re: Don't cast away const where possible
Previous Message Bertrand Drouvot 2025-12-29 08:58:08 Re: More const-marking cleanup