Re: [PATCH] Improve function toast_delete_external (src/backend/access/table/toast_helper.c) - Mailing list pgsql-hackers

From Dong Wook Lee
Subject Re: [PATCH] Improve function toast_delete_external (src/backend/access/table/toast_helper.c)
Date
Msg-id CAAcByaJJBJU_y9gGiSTtjeTEshE=Ovv-VuedvFfC4paJSKHkeg@mail.gmail.com
Whole thread Raw
In response to [PATCH] Improve function toast_delete_external (src/backend/access/table/toast_helper.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Responses Re: [PATCH] Improve function toast_delete_external (src/backend/access/table/toast_helper.c)  (Ranier Vilela <ranier.vf@gmail.com>)
List pgsql-hackers
Yes, now I understand it.
Thank you for letting me know about that.

Thanks.

2022년 2월 10일 (목) 00:39, Ranier Vilela <ranier.vf@gmail.com>님이 작성:

Em qua., 9 de fev. de 2022 às 11:34, Dong Wook Lee <sh95119@gmail.com> escreveu:
Hi,

I've applied your patch. I think it's reasonable.
but  IMHO It looks more complicated to read because of many conditions
in if statement.
so what about just moving up if-statement?

No.
Your version is worse than HEAD, please don't.

1. Do not declare variables after statement.
Although Postgres accepts C99, this is not acceptable, for a number of problems, already discussed.

2. Still slow unnecessarily, because still test TupleDescAttr(tupleDesc, i)->attlen,
which is much more onerous than test isnull.

3. We don't write Baby C code.
C has short break expressions, use-it!

My version is the right thing, here.

regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: wrong fds used for refilenodes after pg_upgrade relfilenode changes Reply-To:
Next
From: Andres Freund
Date:
Subject: Re: wrong fds used for refilenodes after pg_upgrade relfilenode changes