Re: [PATCH] analyze: move elevel calculation into do_analyze_rel()

From: Lev Nikolaev <lev(dot)nikolaev(at)tantorlabs(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] analyze: move elevel calculation into do_analyze_rel()
Date: 2026-03-31 17:56:09
Message-ID: 903e5b83-e94b-440e-b47d-fedd151c854d@tantorlabs.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

I reworked the patch slightly.

Since do_analyze_rel() is static, removing the extra elevel argument is
local to analyze.c only. No behavioral change is intended.

--

Best regards,

Lev Nikolaev,

Tantor Labs LLC,

https://tantorlabs.com/

30.03.2026 16:03, Лев Николаев пишет:
>
> Hi hackers,
>
> While reading analyze.c in current master, I noticed a small cleanup
> opportunity in the ANALYZE code path.
>
> Currently, analyze_rel() computes elevel from params.options, but does
> not use it directly. It only passes the value down to
> do_analyze_rel(). At the same time, do_analyze_rel() already receives
> params and derives verbose from params.options for its own purposes.
>
> The attached patch moves the elevel calculation into do_analyze_rel()
> and removes the extra elevel argument from its declaration,
> definition, and call sites.
>
> No behavioral change is intended here. The logging level selection
> remains the same; the calculation is just moved closer to the actual
> use sites.
>
> Comments and feedback would be appreciated.
>
> --
>
> Best regards,
>
> Lev Nikolaev,
>
> Tantor Labs LLC,
>
> https://tantorlabs.com/
>

Attachment Content-Type Size
0001-analyze-move-elevel-calculation-into-do_analyze_rel.patch text/x-patch 3.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2026-03-31 18:03:02 Re: EXPLAIN: showing ReadStream / prefetch stats
Previous Message Corey Huinker 2026-03-31 17:47:43 Re: implement CAST(expr AS type FORMAT 'template')