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 1q6FJI-0004fu-2F for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jun 2023 18:52:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q6FJG-0002yf-3E for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jun 2023 18:52:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q6FJF-0002yW-Ps for pgsql-hackers@lists.postgresql.org; Mon, 05 Jun 2023 18:52:05 +0000 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q6FJ8-000ORN-1D for pgsql-hackers@postgresql.org; Mon, 05 Jun 2023 18:52:04 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 01CAB40004; Mon, 5 Jun 2023 18:51:51 +0000 (UTC) Content-Type: multipart/alternative; boundary="------------m6kFGji0SOSwl02VpfYDPN79" Message-ID: <31ec84ad-c10c-9351-bf9f-19679c832b73@dunslane.net> Date: Mon, 5 Jun 2023 14:51:50 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: Let's make PostgreSQL multi-threaded Content-Language: en-US To: Tom Lane , Heikki Linnakangas Cc: pgsql-hackers References: <31cc6df9-53fe-3cd9-af5b-ac0d801163f4@iki.fi> <4178104.1685978307@sss.pgh.pa.us> From: Andrew Dunstan In-Reply-To: <4178104.1685978307@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------m6kFGji0SOSwl02VpfYDPN79 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2023-06-05 Mo 11:18, Tom Lane wrote: > Heikki Linnakangas writes: >> I spoke with some folks at PGCon about making PostgreSQL multi-threaded, >> so that the whole server runs in a single process, with multiple >> threads. It has been discussed many times in the past, last thread on >> pgsql-hackers was back in 2017 when Konstantin made some experiments [0]. >> I feel that there is now pretty strong consensus that it would be a good >> thing, more so than before. Lots of work to get there, and lots of >> details to be hashed out, but no objections to the idea at a high level. >> The purpose of this email is to make that silent consensus explicit. If >> you have objections to switching from the current multi-process >> architecture to a single-process, multi-threaded architecture, please >> speak up. > For the record, I think this will be a disaster. There is far too much > code that will get broken, largely silently, and much of it is not > under our control. > > If we were starting out today we would probably choose a threaded implementation. But moving to threaded now seems to me like a multi-year-multi-person project with the prospect of years to come chasing bugs and the prospect of fairly modest advantages. The risk to reward doesn't look great. That's my initial reaction. I could be convinced otherwise. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------m6kFGji0SOSwl02VpfYDPN79 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


On 2023-06-05 Mo 11:18, Tom Lane wrote:
Heikki Linnakangas <hlinnaka@iki.fi> writes:
I spoke with some folks at PGCon about making PostgreSQL multi-threaded, 
so that the whole server runs in a single process, with multiple 
threads. It has been discussed many times in the past, last thread on 
pgsql-hackers was back in 2017 when Konstantin made some experiments [0].

      
I feel that there is now pretty strong consensus that it would be a good 
thing, more so than before. Lots of work to get there, and lots of 
details to be hashed out, but no objections to the idea at a high level.

      
The purpose of this email is to make that silent consensus explicit. If 
you have objections to switching from the current multi-process 
architecture to a single-process, multi-threaded architecture, please 
speak up.
For the record, I think this will be a disaster.  There is far too much
code that will get broken, largely silently, and much of it is not
under our control.

			


If we were starting out today we would probably choose a threaded implementation. But moving to threaded now seems to me like a multi-year-multi-person project with the prospect of years to come chasing bugs and the prospect of fairly modest advantages. The risk to reward doesn't look great.

That's my initial reaction. I could be convinced otherwise.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------m6kFGji0SOSwl02VpfYDPN79--