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 1q6CDf-0005IN-NI for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jun 2023 15:34:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q6CDd-00025x-Tk for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jun 2023 15:34:05 +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 1q6CDd-00024t-Jf for pgsql-hackers@lists.postgresql.org; Mon, 05 Jun 2023 15:34:05 +0000 Received: from meesny.iki.fi ([2001:67c:2b0:1c1::201]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q6CDa-000MmW-HC for pgsql-hackers@postgresql.org; Mon, 05 Jun 2023 15:34:04 +0000 Received: from [192.168.1.115] (dsl-hkibng22-54f8db-125.dhcp.inet.fi [84.248.219.125]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id 4QZd1f6q3WzyT7; Mon, 5 Jun 2023 18:33:58 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1685979239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qjxJe9c/q0nmrfHj/Rn5yMSjhGwQfYJO9/WU0xgc4DQ=; b=EHxvpHB+vsLqTMO+CAx3AOq4rqOoP5QkDWr6kCSaa/xMxryFKh68TJBz4QKRxkFANX5ccK Ov3vmGxwVXcE7K7JwsYu6Yr836Uq41Ag5Amokgx/s/253s+hOO/lkqE4ZC9tuW1kOpycLI huJ7v9TpgG5cvloI65nybkMufsKfhWg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1685979239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qjxJe9c/q0nmrfHj/Rn5yMSjhGwQfYJO9/WU0xgc4DQ=; b=ultRs6HztnmD7j5iKDWCIwvPi4TSGyyvEkGIfzQs6wnHRQcNT81qSFjXWPjruelhr4PgXf uVVyF/9VLR4jd42XN013xZ8VKOGubvJBoiFYZk2Do7Lyqr+lbNbTkrWwRwDlqdunGRHdJU W1scV0Dvc11XBoO7EeZhJt5z8TQeHEE= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1685979239; a=rsa-sha256; cv=none; b=EDSiwgis05ul7l8CzNFxPBBeLVbxbG4z+3qoz5fAtlkiBAdZdXIOr96Z3myxrkJoEXFsf/ +b6NKNn95AqzayfXiyC3bpea639x5WzOn59hDF1dP4Yw7CyJORuQ6w3ihBdwQO2U3bnmac kENRB9y7sBGjo9Nbxc1yFk7xq7ShMu8= Message-ID: <4ce6c0f8-e8a4-1672-93fd-49d3fa975ee5@iki.fi> Date: Mon, 5 Jun 2023 18:33:57 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: Let's make PostgreSQL multi-threaded Content-Language: en-US To: Tom Lane Cc: pgsql-hackers References: <31cc6df9-53fe-3cd9-af5b-ac0d801163f4@iki.fi> <4178104.1685978307@sss.pgh.pa.us> From: Heikki Linnakangas In-Reply-To: <4178104.1685978307@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 05/06/2023 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. Noted. Other large projects have gone through this transition. It's not easy, but it's a lot easier now than it was 10 years ago. The platform and compiler support is there now, all libraries have thread-safe interfaces, etc. I don't expect you or others to buy into any particular code change at this point, or to contribute time into it. Just to accept that it's a worthwhile goal. If the implementation turns out to be a disaster, then it won't be accepted, of course. But I'm optimistic. -- Heikki Linnakangas Neon (https://neon.tech)