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 1q6GVF-000808-BJ for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jun 2023 20:08:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q6GVD-00072G-0O for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jun 2023 20:08:31 +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 1q6GVC-000727-CQ for pgsql-hackers@lists.postgresql.org; Mon, 05 Jun 2023 20:08:30 +0000 Received: from mail-yw1-x1129.google.com ([2607:f8b0:4864:20::1129]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q6GV9-000Oz0-3r for pgsql-hackers@postgresql.org; Mon, 05 Jun 2023 20:08:28 +0000 Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-565a3cdba71so64669897b3.0 for ; Mon, 05 Jun 2023 13:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joeconway.com; s=google; t=1685995705; x=1688587705; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=r0XKGgR/LEt+dNv+3vILwf4zW+Ty6h//2LSTCMEHsa4=; b=QhEy3YbDYLM1aR/p61MohcNBfdsjWto/2q1ehAABn1m0G7Juh7F3jjbEanMvn0Ot8O SdJHyHpLvgriG3VEflFCCr2Dsj9kosF8Vq9YW8jDoWnJ3WGDgikTB4d789yOBDGxDweL YFxVSXh3wmahlV3wNPgqPAY2YZbPjV2CghCxStmXxSnLfvNwm6LD5DmZ1rTGWgL9z4I4 hqx10viNT6V7t9wu2S+o8+IcSPyqUrkUPuPHkSt2SIsAYBqItm/JAf6xE0PZzNKmOszT fBtTRfZDImyBzp0G6jSZ61lsZMSF3bO775VXjpuRz//ZhiGU17Aep5p4ApfjkKotwmH7 bDlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685995705; x=1688587705; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=r0XKGgR/LEt+dNv+3vILwf4zW+Ty6h//2LSTCMEHsa4=; b=QtemDR/sLZS3OxMZPxNKHXBb3G2WpMnkhOJc9tbKV2h8Kw+GXZoul7/C9DMgUy/etq A0gJ6mLH+xiRM096ll/U4WGPfzWQnLHVoVOrcADIDTzCb9Yd3v7dN72O2Ad31dh765s0 InRAOMn14YQKB5YfnRBQ5G3+S+gneePoByT6N9ayphFvD8NzwSQ87HO+QiLypLDEZb0O 5erBdHt5h0vo3v1WDJr0lNUZTqCW4prsKR6RDyH5WYXSDqt3GlgnMajAaGeGLU6/hABi EDT9PppRLXnHyJq50z6fpQImmrb4Vfidp3mtF8sMFCmSBOjtwE7q94h1/TgTPDUK0dFf sC1Q== X-Gm-Message-State: AC+VfDwWF4LapcMQBjdRHLucK19tuKfi1KKbdKFTDwhFyN/T8ii2p+Ty BjZPPPZke+r276jO19j/n5DS7g== X-Google-Smtp-Source: ACHHUZ6o+S3US8w2wTJzVdGyBIovDqMupWCKhKUYiUzRVqDcJyj6/yHD/eU2lpdFSQF1G37VQbdWqQ== X-Received: by 2002:a0d:f943:0:b0:569:16a4:392f with SMTP id j64-20020a0df943000000b0056916a4392fmr12437122ywf.41.1685995705545; Mon, 05 Jun 2023 13:08:25 -0700 (PDT) Received: from [192.168.4.41] (162-239-31-113.lightspeed.dybhfl.sbcglobal.net. [162.239.31.113]) by smtp.gmail.com with ESMTPSA id t134-20020a81838c000000b00568938ca41bsm3560193ywf.53.2023.06.05.13.08.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Jun 2023 13:08:25 -0700 (PDT) Message-ID: <16a3acca-4dd2-cbcd-d078-1e01802a0b74@joeconway.com> Date: Mon, 5 Jun 2023 16:08:24 -0400 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: Andrew Dunstan , Tom Lane , Heikki Linnakangas Cc: pgsql-hackers References: <31cc6df9-53fe-3cd9-af5b-ac0d801163f4@iki.fi> <4178104.1685978307@sss.pgh.pa.us> <31ec84ad-c10c-9351-bf9f-19679c832b73@dunslane.net> From: Joe Conway In-Reply-To: <31ec84ad-c10c-9351-bf9f-19679c832b73@dunslane.net> 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 6/5/23 14:51, Andrew Dunstan wrote: > > 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. I read through the thread thus far, and Andrew's response is the one that best aligns with my reaction. -- Joe Conway PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com