Re: Frontend error logging style

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Frontend error logging style
Date: 2022-04-11 15:22:40
Message-ID: 274816.1649690560@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> writes:
> On 08.04.22 22:26, Tom Lane wrote:
>>> I think we should put a centralized level check
>>> into logging.c, and get rid of at least the "if (likely())"
>>> checks, because those are going to succeed approximately 100.0%
>>> of the time. Maybe there's an argument for keeping the unlikely()
>>> ones.

> Yeah, that seems ok to change. The previous coding style is more useful
> if you have a lot of debug messages in a hot code path, but that usually
> doesn't apply to where this is used.

The patch I presented keeps the unlikely() checks in the debug-level
macros. Do you think we should drop those too? I figured that avoiding
evaluating the arguments would be worth something.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2022-04-11 15:34:32 Re: Schema variables - new implementation for Postgres 15+1
Previous Message Zhihong Yu 2022-04-11 15:16:07 Re: CLUSTER on partitioned index