Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vba1M-0084r6-0h for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Jan 2026 07:56:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vba0K-009cVC-2d for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Jan 2026 07:55:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vba0K-009cV4-1f for pgsql-hackers@lists.postgresql.org; Fri, 02 Jan 2026 07:55:25 +0000 Received: from mail-oo1-xc30.google.com ([2607:f8b0:4864:20::c30]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vba0I-0043DP-12 for pgsql-hackers@lists.postgresql.org; Fri, 02 Jan 2026 07:55:24 +0000 Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-65cff0c342eso8284859eaf.3 for ; Thu, 01 Jan 2026 23:55:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767340519; x=1767945319; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=AwpTQhZquulmnmr8/r1EEJGEnOyiP5fmjhWMLbkR3MI=; b=bsUfnVTx7p2eMqTK7x2TzaW2JWfwSKRsK0p8icBa1kNaZ1O7yOZrhJ56IEIROnn4lc jsYrL2zaYC25gZc+X0RcV4n85QL79KeQVkMvj1lVzNNCS+of+8PhB8/07vzOAd+8p5PJ XEt/UIY6QsVJcLwaVO5LKhYwhj1ZUWzfnSBoZJHRXsQ9tT8THHCpNmm8KvoOGoWFB5KX BPWEn6bECBXyntnYeYYdqQE4wzq3tSeVRxSjx8mLPevJc7VMPHXAeA+1d1qP3BljXkeV xLCfYIOj7IakVLT1n+R8Q/8nz1fep5oW4mQc0TdLcttCgXXio2GLGw2vFTyic0Bw8v6k kHog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767340519; x=1767945319; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AwpTQhZquulmnmr8/r1EEJGEnOyiP5fmjhWMLbkR3MI=; b=KJ8HBamh4ma+ASBm8KozzGLVfwnclPRqf5NgM8gUSCkRQnwL2lYtL5SnQdVQahl6ql dMWiV2IooCsth4qd5L7fgsaUOm87Vp/BLlFHjwffDQi4eeIXD4j06deU5S5ZvbnDCF8s W2hhia2CivtTlsFnK7uGMv9lEBSpVvNg8P9Wm5V88E3m0wj2eYDWuWa3h9U8G4Sgm2kj ZFNYhvSEy6aBbgQh/k01viu/7WJibvWVeo5iZzQTXQGmsrK15bgGd+WcsGRQmEAeHFGB iLfv4AwpMayDNMi7wS5QVJdYxrDnxtUNopQxiif7hzi8fwm33Qs9C+Gxvth+W8u4kYDC M6Fw== X-Gm-Message-State: AOJu0Yzxw0WsWwxImZf7lT9vSz/k5B04ALB1vRyU6eDb2kcPhEXa9x3e 4prTNfLosUQzyGilWzp2paIQkRinnxPuYg+ELOYfrNUs8gHcNkI4im6lmTg+iKFgBD8HBfkIW8h pxW651tOY+rAY6QD0OpNYVYkcS7A/vN9VQVS9TFJoTQ== X-Gm-Gg: AY/fxX6rAXzsFbOl6FtIVKAj+cuoDH9HnAw1AF/UYUyzZKEnBAnrXThE97zoXnGd/UY aoQOp7XjRge9mVfgKwTB4puwSs44rB9IDWeYN8c37YzBE6Xf4L3kO4Ki218qQOkF4lbTYalOWKx QOb3BOReQ2uXaBfTN/x8uSj7qvz6kXHulwJ+23Yep7bAxWLKb6NbM5WScw5RShsWg2w1RpnoTdu i4mNZU2jDIK0TsPHTDVQzYfsLfV5EV0IJ2t3s8k00K+rn9QznInDfZ9uDthqW0sYrzyP41D X-Google-Smtp-Source: AGHT+IEkPWoVHQU7htq9a5wZ6/PtScyczpliZkeN22aKQ5+oTO9lz8wqPz1apd8dxHKYgsS+Fle9G9d+AVIsF2SnZAw= X-Received: by 2002:a05:6820:4289:b0:65d:163:3ea with SMTP id 006d021491bc7-65d0e94d67emr13874308eaf.5.1767340519121; Thu, 01 Jan 2026 23:55:19 -0800 (PST) MIME-Version: 1.0 From: Babak Ghadiri Date: Fri, 2 Jan 2026 11:25:07 +0330 X-Gm-Features: AQt7F2qx9tNFgj1E7B70NDYeaU0DGtpuvBFgAy5twCtJOZFzVYJgXhdvhid4EeI Message-ID: Subject: Parallelizing startup with many databases To: pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000d6e6ff06476307c3" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d6e6ff06476307c3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, I hope you are doing well. In PostgreSQL 16, startup appears to initialize databases sequentially and primarily uses a single CPU core. In clusters with a very large number of databases (around 5,000 in our case), this results in noticeably long startup times after restarts or crash recovery. I would like to ask: - Is the largely single-threaded startup behavior a fundamental architectural constraint (e.g. catalog dependencies, locking, recovery ordering), or mainly an unimplemented optimization? - Are there any existing discussions, patches, versions (18+) to parallelize parts of startup or otherwise improve startup scalability with many databases? - Are there any PostgreSQL configuration settings known to dramatically reduce startup time, or is startup performance mostly fixed by architecture in this scenario? I understand that having many databases in a single cluster is not the most common or recommended multi-tenant model, but this is an existing system an= d I=E2=80=99m trying to better understand the current limits and future direc= tion. Thank you for your time and insights. Best regards. --000000000000d6e6ff06476307c3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,
I hope you are doing well.

In PostgreSQL = 16, startup appears to initialize databases sequentially and
primarily u= ses a single CPU core. In clusters with a very large number of
databases= (around 5,000 in our case), this results in noticeably long
startup tim= es after restarts or crash recovery.

I would like to ask:

- I= s the largely single-threaded startup behavior a fundamental architectural<= br>=C2=A0 constraint (e.g. catalog dependencies, locking, recovery ordering= ), or mainly
=C2=A0 an unimplemented optimization?
- Are there any ex= isting discussions, patches, versions (18+) to parallelize parts of startup= or otherwise improve=C2=A0startup scalability with many databases?
- Ar= e there any PostgreSQL configuration settings known to dramatically reduce = startup time, or is startup performance mostly fixed by architecture in thi= s scenario?

I understand that having many databases in a single clus= ter is not the most
common or recommended multi-tenant model, but this i= s an existing system and
I=E2=80=99m trying to better understand the cur= rent limits and future direction.

Thank you for your time and insigh= ts.

Best regards.
--000000000000d6e6ff06476307c3--