Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEb7X-002Oys-OX for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Jun 2024 20:51:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sEb7X-002YRm-7h for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Jun 2024 20:51:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEb7W-002YRe-UI for pgsql-hackers@lists.postgresql.org; Tue, 04 Jun 2024 20:51:02 +0000 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sEb7Q-003TRt-9w for pgsql-hackers@lists.postgresql.org; Tue, 04 Jun 2024 20:51:01 +0000 Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-7e1d0a674bfso7879439f.1 for ; Tue, 04 Jun 2024 13:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717534254; x=1718139054; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=gQ7Kfi0Qi2WTuVp3GhV9goMeeShFW60gOt+uYK3X1zM=; b=AqSyAiSMplkFSlNEnw6x4mdBTbAGiP+MvnGKyMjKa7sM1ULzE6Gkzo8ZEk88vr0UE0 jwWifztxSv1NzyAL63Xwp4vPrUP8VyMxX0gNmldistmf9B5wj707/9kV79vrkILqGulW 7Y/blOMHZtPSbKYSyN1r8zKctpDtBrlBC/33a1SLWQMNxi9o+qma//zNuLfEH/Q/Hva1 fadfvPbl/dmoghm4UmPYtP606FNRfYIbZ27rgwNVTKLbS5x00z5F+NkB2UAZVWWZPB5I Zwwz2N3/W8gTxiL+pz55vKfTEqV4aD3qWhNmv3CaepKfA/Zy8m2AIy0mWXWKsjQ8YLqN LAkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717534254; x=1718139054; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=gQ7Kfi0Qi2WTuVp3GhV9goMeeShFW60gOt+uYK3X1zM=; b=DTWcffk5ANAIhSAy+/dY7GLXV5eTGto6+XviMduMNY6i4lJveiXiT19ff1feeSzYxq DWP6jifGxz7K6bBOE4mKq9a/mHEAKtqqE8/RCCbSGWW+UDNeoJ4tNEVRvE48ZK+bmSXh ZwEp5atNIhn3M/61mB5616FTLLAmadS2g1r199VZk8xVSCqQROldWlrQbqA9vMJ8GO4m XLPkmQKHc8NhpcJRHLOTTWUL7Atpa+3R2FDUqkssrjouOj02yX07vxWvbLYWGyHRDtHN FdL3x3vKgCf4pctlCAUhqxf0UkQ3QQ+uw3IyCJO57DbYmHe9mP6yx/FJK0CJnc8+NzKo ehQQ== X-Forwarded-Encrypted: i=1; AJvYcCXIZDJYUna7ANXnYl7Q8GV+T6V76MOH3P91D7U4yUhVEfXDN5Lik0UrboFX9DCcedqvgIBqfq2XxQzNfDF6DMPubJWzQ6rYRkUXckGoN2+yk24k X-Gm-Message-State: AOJu0YygXue9eQMfI4z5Qaubzz4vt6xS5lCLXRmPI29c9TVC6NlW0d1P kbFHRrQ7rbHMb5TriUw1KxtdvWttPPgVIn2YB4kNStF/3xRmRBP3 X-Google-Smtp-Source: AGHT+IFeYErVc6yaoh0zuETqVIMDVAnlKyg/14lHXoJeixhie9NipP0VkesLGwY4k3xd52LgHMpBcw== X-Received: by 2002:a05:6602:e0d:b0:7eb:2da6:d7c9 with SMTP id ca18e2360f4ac-7eb2da6d939mr217643539f.6.1717534254437; Tue, 04 Jun 2024 13:50:54 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b5837f80f0sm1970068173.104.2024.06.04.13.50.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 13:50:53 -0700 (PDT) Date: Tue, 4 Jun 2024 15:50:51 -0500 From: Nathan Bossart To: Kyotaro Horiguchi Cc: michael@paquier.xyz, postgres@jeltef.nl, smithpb2250@gmail.com, vignesh21@gmail.com, jakub.wartak@enterprisedb.com, stark.cfm@gmail.com, hlinnaka@iki.fi, barwick@gmail.com, jchampion@timescale.com, pryzby@telsasoft.com, tgl@sss.pgh.pa.us, rjuju123@gmail.com, jakub.wartak@tomtom.com, pgsql-hackers@lists.postgresql.org, bharath.rupireddyforpostgres@gmail.com Subject: Re: In-placre persistance change of a relation Message-ID: References: <20240524.160916.2199777355532445323.horikyota.ntt@gmail.com> <20240604.160032.391318120410028809.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240604.160032.391318120410028809.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk +Bharath On Tue, Jun 04, 2024 at 04:00:32PM +0900, Kyotaro Horiguchi wrote: > At Tue, 4 Jun 2024 09:09:12 +0900, Michael Paquier wrote in >> Another point that Nathan has made is that it may be more appealling >> to study how this is better than an integration with the multi-INSERT >> APIs into AMs, so as it is possible to group the inserts in batches >> rather than process them one-at-a-time, see [1]. I am ready to accept >> that what this patch does is more efficient as long as everything is >> block-based in some cases. Still there is a risk-vs-gain argument >> here, and I am not sure whether what we have here is a good tradeoff >> compared to the potential risk of breaking things. The amount of new >> infrastructure is large for this code path. Grouping the inserts in >> large batches may finish by being more efficient than a WAL stream >> full of FPWs, as well, even if toast values are deformed? So perhaps >> there is an argument for making that optional at query level, instead. > > I agree about the uncertainties. With the switching feature mentioned > above, it might be sufficient to use the multi-insert stuff in the > existing path. However, the uncertainties regarding performance would > still remain. Bharath, does the multi-INSERT stuff apply when changing a table to be LOGGED? If so, I think it would be interesting to compare it with the FPI approach being discussed here. -- nathan