From: | Dilip Kumar <dilipbalaut(at)gmail(dot)com> |
---|---|
To: | Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Remove unused variable from SharedSort |
Date: | 2020-11-15 10:19:58 |
Message-ID: | CAFiTN-uj=5hFh=f98RWL0gQSoz=zR2f9CVM=dPd0ZzcFWsfkqQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sun, Nov 15, 2020 at 12:50 PM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> On Thu, Nov 12, 2020 at 5:29 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> >
> > While going through the code I noticed that the nTapes member in
> > SharedSort is unused. This is just initialized with nworkers but
> > never used. The attached patch removes this variable.
> >
>
> We could have used that variable for an assert like
> Assert(state->worker <= shared->nTapes) in worker_freeze_result_tape()
> before accessing shared->tapes[state->worker] = output; as sometimes
> state->worker is being set to -1. But, it seems like we reach
> worker_freeze_result_tape(), only when WORKER(state) is true. So, we
> don't need that extra Assert and removing nTapes variable makes sense
> to me.
Right, but anyway IMHO adding extra shared memory variables for just
and assert purposes doesn't make sense.
> Patch looks good to me. Regression tests make check and make
> check-world ran successfully.
Thanks for looking into this.
--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Erik Rijkers | 2020-11-15 10:44:23 | Re: Supporting = operator in gin/gist_trgm_ops |
Previous Message | Li Japin | 2020-11-15 10:00:01 | Re: Terminate the idle sessions |