Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q7Kgp-0002Of-39 for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jun 2023 18:48:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q7Kgn-00076C-WE for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jun 2023 18:48:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q7Kgn-00075n-MG for pgsql-hackers@lists.postgresql.org; Thu, 08 Jun 2023 18:48:53 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q7Kgl-0014VZ-98; Thu, 08 Jun 2023 18:48:53 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2F83A5C0223; Thu, 8 Jun 2023 14:48:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 08 Jun 2023 14:48:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1686250130; x=1686336530; bh=Kk HPqsM5tybXWt7kNNCCagbgi2JLlqXfxe75cK1dVLg=; b=rmggLQDY3Wst/mwgcY ytAMrwfp/yiY1JltWCij/Ov3J/ROGd7qj4smbQndOfdCo9RFxfNtQlJ5aQgGO73n /tpBN6s9f82MfQajqc5zH2643dKUYXlTCfDDbyANsUV3y7wLyKFGBoYX/+UzZOa3 tLNkI8N7GeaQY+/qbJRTduK3Mk4D046cbtLRBovygGnPnyPwcPL0rkWwQGoANs6y oq7QjPIeiKsydr2OUm3Z2GOEtT3kyLO+2lER/ts5TZ8McYCpwuBixaurDTy/M2/D aAEM0UAg3Gw+5BDMbHNZxhujunkHOEXd5amSNPKUIyF9UppNf4LaRbPZqPuT99cQ 5y5w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1686250130; x=1686336530; bh=KkHPqsM5tybXW t7kNNCCagbgi2JLlqXfxe75cK1dVLg=; b=SuaXqkKVPwhKin/flgiNu4dh9Bfj4 Xc4QPJbQCT+07IWYZI9fHfL70/+RUiTy6dgtAtaYA87T2DWD6aayu2mZfDMLzZnj LFVbWqnyJ5MH9BufxDQF3XgrLN8TUXn2ICg9wVg40dQ6KU0G19u2OWDApd+RhgWo oaCoboqmHzNMXD7ZxBseR9CJLoHhkgq59wN4rFoMa9FE8qT+ar8JLptBtHimGdlK vtzN9UYi91dt4+qKYeCpOguM/17PhHO/hrierJrFRSQ96RO5E589BVurLeos7Zj6 gFCTtAcAW2TDdUfHFfD9q2HL9Rg5dlyL31jZBXSnywrR7FRixHyGRe4Ig== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedtiedgudefudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgu rhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtf frrghtthgvrhhnpedvffefvefhteevffegieetfefhtddvffejvefhueetgeeludehteev udeitedtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Jun 2023 14:48:49 -0400 (EDT) Date: Thu, 8 Jun 2023 11:48:48 -0700 From: Andres Freund To: Matthias van de Meent Cc: Hannu Krosing , Robert Haas , "Jonathan S. Katz" , Heikki Linnakangas , Tom Lane , pgsql-hackers Subject: Re: Let's make PostgreSQL multi-threaded Message-ID: <20230608184848.4ejjqjeeicgbnbzb@awork3.anarazel.de> References: <4178104.1685978307@sss.pgh.pa.us> <4ce6c0f8-e8a4-1672-93fd-49d3fa975ee5@iki.fi> <20230607213721.al3etgcgtija3ytz@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-06-08 17:55:57 +0200, Matthias van de Meent wrote: > While I agree that "sharing page tables across processes" is useful, > it looks like it'd be much more effort to correctly implement for e.g. > DSM than implementing threading. > Konstantin's diff is "only" 20.1k lines [0] added and/or modified, > which is a lot, but it's manageable (13k+ of which are from files that > were auto-generated and then committed, likely accidentally). Honestly, I don't think this patch is in a good enough state to allow a realistic estimation of the overall work. Making global variables TLS is the *easy* part. Redesigning postmaster, definining how to deal with extension libraries, extension compatibility, developing tools to make developing a threaded postgres feasible, dealing with freeing session lifetime memory allocations that previously were freed via process exit, making the change realistically reviewable, portability are all much harder. Greetings, Andres Freund