Re: pgbench - refactor init functions with buffers

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgbench - refactor init functions with buffers
Date: 2019-10-22 11:27:58
Message-ID: CAFiTN-vNQOAxT3STgJT4caMkv=kMEoaWA-4j9jU+ZWsaJqMTbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 22, 2019 at 3:30 PM Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:
>
>
> Hello Dilip,
>
> > - for (i = 0; i < nbranches * scale; i++)
> > + for (int i = 0; i < nbranches * scale; i++)
> > ...
> > - for (i = 0; i < ntellers * scale; i++)
> > + for (int i = 0; i < ntellers * scale; i++)
> > {
> >
> > I haven't read the complete patch. But, I have noticed that many
> > places you changed the variable declaration from c to c++ style (i.e
> > moved the declaration in the for loop). IMHO, generally in PG, we
> > don't follow this convention. Is there any specific reason to do
> > this?
>
> There are many places where it is used now in pg (120 occurrences in
> master, 7 in pgbench). I had a bug recently because of a stupidly reused
> index variable, so I tend to use this now it is admissible, moreover here
> I'm actually doing a refactoring patch, so it seems ok to include that.
>
I see. I was under impression that we don't use this style in PG.
But, since we are already using this style other places so no
objection from my side for this particular point.
Sorry for the noise.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeevan Ladhe 2019-10-22 11:33:30 Re: pgbench - refactor init functions with buffers
Previous Message Pavel Stehule 2019-10-22 11:20:36 Re: dropdb --force