Thread

Commits

  1. Remove duplicate initialization in initialize_brin_buildstate().

  1. brin: Remove duplicate initialization in initialize_brin_buildstate()

    Chao Li <li.evan.chao@gmail.com> — 2026-01-21T06:29:54Z

    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.
    
    Best regards,
    --
    Chao Li (Evan)
    HighGo Software Co., Ltd.
    https://www.highgo.com/
    
  2. Re: brin: Remove duplicate initialization in initialize_brin_buildstate()

    Shinya Kato <shinya11.kato@gmail.com> — 2026-02-11T01:23:01Z

    On Wed, Jan 21, 2026 at 3:30 PM Chao Li <li.evan.chao@gmail.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
    
    
    
    
  3. Re: brin: Remove duplicate initialization in initialize_brin_buildstate()

    Chao Li <li.evan.chao@gmail.com> — 2026-02-11T02:32:32Z

    
    > On Feb 11, 2026, at 09:23, Shinya Kato <shinya11.kato@gmail.com> wrote:
    > 
    > On Wed, Jan 21, 2026 at 3:30 PM Chao Li <li.evan.chao@gmail.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/
    
    
    
    
    
    
    
    
  4. Re: brin: Remove duplicate initialization in initialize_brin_buildstate()

    Fujii Masao <masao.fujii@gmail.com> — 2026-03-09T15:10:22Z

    On Wed, Feb 11, 2026 at 11:33 AM Chao Li <li.evan.chao@gmail.com> wrote:
    >
    >
    >
    > > On Feb 11, 2026, at 09:23, Shinya Kato <shinya11.kato@gmail.com> wrote:
    > >
    > > On Wed, Jan 21, 2026 at 3:30 PM Chao Li <li.evan.chao@gmail.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.
    
    LGTM. Barring any objections, I will commit the patch.
    
    Regards,
    
    -- 
    Fujii Masao
    
    
    
    
  5. Re: brin: Remove duplicate initialization in initialize_brin_buildstate()

    Fujii Masao <masao.fujii@gmail.com> — 2026-03-10T13:57:18Z

    On Tue, Mar 10, 2026 at 12:10 AM Fujii Masao <masao.fujii@gmail.com> wrote:
    > LGTM. Barring any objections, I will commit the patch.
    
    I've pushed the patch. Thanks!
    
    Regards,
    
    -- 
    Fujii Masao