| From: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
|---|---|
| To: | Shinya Kato <shinya11(dot)kato(at)gmail(dot)com> |
| Cc: | Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: brin: Remove duplicate initialization in initialize_brin_buildstate() |
| Date: | 2026-02-11 02:32:32 |
| Message-ID: | 889A68D5-15E9-4B98-BDED-91DAAB80477A@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> On Feb 11, 2026, at 09:23, Shinya Kato <shinya11(dot)kato(at)gmail(dot)com> wrote:
>
> On Wed, Jan 21, 2026 at 3:30 PM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>>
>> Hi Hacker,
>>
>> Just noticed a redundant assignment in initialize_brin_buildstate():
>>
>> ```
>> static BrinBuildState *
>> initialize_brin_buildstate(Relation idxRel, BrinRevmap *revmap,
>> BlockNumber pagesPerRange, BlockNumber tablePages)
>> {
>> BrinBuildState *state;
>> BlockNumber lastRange = 0;
>>
>> state = palloc_object(BrinBuildState);
>>
>> <…omit some lines…>
>>
>> // Later, b437571 added the same again. This patch deletes these 3 lines.
>> state->bs_context = CurrentMemoryContext;
>> state->bs_emptyTuple = NULL;
>> state->bs_emptyTupleLen = 0;
>>
>> // Added by dae761a first
>> /* Remember the memory context to use for an empty tuple, if needed. */
>> state->bs_context = CurrentMemoryContext;
>> state->bs_emptyTuple = NULL;
>> state->bs_emptyTupleLen = 0;
>> ```
>>
>> So, filing a trivial patch to eliminate the redundancy.
>
> Thank you for the patch! It looks good to me, so I’ve marked the entry
> as Ready for Committer.
>
> --
> Best regards,
> Shinya Kato
> NTT OSS Center
Thanks a lot.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chao Li | 2026-02-11 03:00:53 | Is it OK to perform logging while holding a LWLock? |
| Previous Message | Henson Choi | 2026-02-11 01:42:56 | Re: Row pattern recognition |