From: | Andres Freund <andres(at)2ndquadrant(dot)com> |
---|---|
To: | gotoschool6g <gotoschool6g(at)gmail(dot)com> |
Cc: | Abhijit Menon-Sen <ams(at)2ndQuadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_xlogdump --stats |
Date: | 2014-07-04 10:36:17 |
Message-ID: | 20140704103617.GR25909@awork2.anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2014-07-04 18:31:34 +0800, gotoschool6g wrote:
> >
> > I'm pretty sure that most committers would want to apply the
> > rm_identity part in a separate commit first. Could you make it
> > two patches, one introducing rm_identity, and another with
> > xlogdump using it?
>
> Carp the code:
>
> const char *
> clog_identify(uint8 info)
> {
> switch (info)
> {
> case CLOG_ZEROPAGE:
> return "ZEROPAGE";
> case CLOG_TRUNCATE:
> return "TRUNCATE";
> break;
> }
> return NULL;
> }
>
> or
>
> const char *
> clog_identify(uint8 info)
> {
> if(info==CLOG_ZEROPAGE)return "ZEROPAGE";
> if(info==CLOG_TRUNCATE)return "TRUNCATE";
> return NULL;
> }
>
> is a bit faster than:
Any halfway decent compiler will not use a local variable here. Don't
think that matters much. Also the code isn't a performance bottleneck...
Greetings,
Andres Freund
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | furuyao | 2014-07-04 10:45:20 | Re: pg_receivexlog add synchronous mode |
Previous Message | gotoschool6g | 2014-07-04 10:31:34 | Re: pg_xlogdump --stats |