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 1q8ga3-0007An-0j for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Jun 2023 12:23:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q8ga1-0004nP-L0 for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Jun 2023 12:23:29 +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 1q8ga1-0004nG-9G for pgsql-hackers@lists.postgresql.org; Mon, 12 Jun 2023 12:23:29 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q8gZy-001vJb-Ng for pgsql-hackers@postgresql.org; Mon, 12 Jun 2023 12:23:28 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-977c8423dccso1101729966b.1 for ; Mon, 12 Jun 2023 05:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686572606; x=1689164606; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=X47kSDGBZUWnDy7e4Cg+KI8KEkNh5YcF7s1SbIafFVg=; b=Dc+7r26XMX+tpJPBeLXW3nVRlL4NQFsJBgbP0yBjv3fUeZVy6Sqr97MKo96cBYKlCX sjQBkKSflF+WP6i0pOQOC7nuBQF65aTrV/B73Dz14aVvS317SJDE2XDwbSZ5CEqAosCz xLN7Y8zv+cQtsXFxCK4GXcUU1Q1uYoMIZ79eJvCfu5frBsSo7nmWhwB+XgIAkvgJ0sF8 /5b15l3oARPOCBM87XBtbMAtnVQD9B2tNwLf1BKhQhPlPcLG1XnbZnf+g2L9x5Um13Ia oWxiKogyqn01CSozs6XojPWg9V2M10PLl3uh7VfyUXY5DB53mGaPRGUGKYAWMhoz0Ina YQuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686572606; x=1689164606; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=X47kSDGBZUWnDy7e4Cg+KI8KEkNh5YcF7s1SbIafFVg=; b=gKcUcml2DtZ+7Ux3RlHy5uupQB1f9SoNJRN6WNP0zrSg119li3RKMQ7T7CPU5j/6WV fWeaGP7pF/9rxXQjjWVm/78VLcfPhimSHVvhFLHHQjNabpcjwrmx/ls354vuVxPD2NhM FoeM6LS7XcTDhjgAnr/K+UVXhLLVO2ZUhv702iNwCA+h/Z6VhRWKPEjbt7Kd078EurD1 FrxUcmAxXLkg884pIQtbNcJ0LM8BSo5b6J+EftUr6zsqALCXM8ck6lzbgOEWjM/MjRVQ ptIvd7c1QkWoL/XpAT0icc6HhGIbhDEAe3SdvtAi+lkZ9r8vM3YO4ARcQZ0vXsAKMclj XhRA== X-Gm-Message-State: AC+VfDym4qswnH4gTH1o5YaV/RlqkoiEn/AJFJLgwuF3COFVs1jEGYK6 lqOV8WljahQzAYeqos9x9f1GpcJshBV+HOjwcFE= X-Google-Smtp-Source: ACHHUZ6rFaO07If/8v6O5I4cVDEVU9J0Zt1eV4AHmRxltoLraiSe4HDYN7NZMvvt+xHPPS+SXHhadL6bcz9gRNPg604= X-Received: by 2002:a17:907:25ca:b0:971:55e2:82c3 with SMTP id ae10-20020a17090725ca00b0097155e282c3mr6829232ejc.20.1686572605690; Mon, 12 Jun 2023 05:23:25 -0700 (PDT) MIME-Version: 1.0 References: <31cc6df9-53fe-3cd9-af5b-ac0d801163f4@iki.fi> In-Reply-To: From: Pavel Borisov Date: Mon, 12 Jun 2023 16:23:14 +0400 Message-ID: Subject: Re: Let's make PostgreSQL multi-threaded To: Dilip Kumar Cc: Hannu Krosing , Heikki Linnakangas , pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Is the following true or not? 1. If we switch processes to threads but leave the amount of session local variables unchanged, there would be hardly any performance gain. 2. If we move some backend's local variables into shared memory then the performance gain would be very near to what we get with threads having equal amount of session-local variables. In other words, the overall goal in principle is to gain from less memory copying wherever it doesn't add the burden of locks for concurrent variables access? Regards, Pavel Borisov, Supabase