Re: Why does bootstrap and later initdb stages happen via client?

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Why does bootstrap and later initdb stages happen via client?
Date: 2021-09-08 21:48:44
Message-ID: FA028E6B-AAD6-4AEE-8FD7-6CD1ABA40123@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On September 8, 2021 1:24:00 PM PDT, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>
>On 9/8/21 3:07 PM, Andres Freund wrote:
>> There of course is historical raisins for things happening in initdb - the
>> setup logic didn't use to be C. But now that it is C, it seems a bit absurd to
>> read bootstrap data in initdb, write the data to a pipe, and then read it
>> again in the backend. It for sure doesn't make things faster.
>
>
>I guess the downside would be that we'd need to teach the backend how to
>do more stuff that only needs to be done once per cluster, and then that
>code would be dead space for the rest of the lifetime of the cluster.
>
>
>Maybe the difference is sufficiently small that it doesn't matter.

Unused code doesn't itself cost much - the OS won't even page it in. And disk space wise, there's not much difference between code in initdb and code in postgres. It's callsites to the code that can be problematic. But there were already paying the price via --boot and a fair number of if (bootstrap) blocks.

Regards,

Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2021-09-08 21:54:27 Re: [PATCH] support tab-completion for single quote input with equal sign
Previous Message Tom Lane 2021-09-08 21:08:31 Re: [PATCH] support tab-completion for single quote input with equal sign