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 1sj3tv-00DjSK-5k for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Aug 2024 21:38:55 +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 1sj3tr-00D3c0-G3 for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Aug 2024 21:38:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sj3to-00D3bM-47 for pgsql-hackers@lists.postgresql.org; Tue, 27 Aug 2024 21:38:51 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sj3sZ-001ooB-1Y for pgsql-hackers@postgresql.org; Tue, 27 Aug 2024 21:37:37 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-201f7fb09f6so51525145ad.2 for ; Tue, 27 Aug 2024 14:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1724794650; x=1725399450; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=sul/51a5omDJ6NdLdgsq3HW0szJ2dxRm4nvVqKZI6u8=; b=rKRhRbvb3XurNbKR2B6jO7WD5POFkUZUrpguVhB4vzb/t4A41YSIlgYBf9GP5xN8eg imjPN9dR9XGK4Bo7w6e1BMt/sjY71+SE3KW8di4/+4zWw0mrrv/UFMqgz7Em++Upv4Mu GihN0wHskD6Nl9lPpJgDAfxslGnFHrWIOYqEGyhlDIrS7Yn+1MzLQzLCJRjYsxIuMgeQ MGTCLKPTYhegIbQ+NuDaVO67HQIUb/eYFpYhrNgUy7NdqswR9MWq1OOiyPvXdgPZ0MKD k9gP8fcIpOZ/GRoWrWyaWKe8E7g6RoNKel5z825dY/EDauQFuy6Rqx0m251815lZG1q8 8cFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724794650; x=1725399450; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=sul/51a5omDJ6NdLdgsq3HW0szJ2dxRm4nvVqKZI6u8=; b=N+KPrFzdBA7nAlQ3tyj5YllsZLqIoS+RtzqDKNyUjeCwiV6T1GQw7ZYRXZ3WRu8v6c w/LsK8Mh+37DA5W5fw3/ETdKClOO2jI9AwrGjpeO0oxzMIAQn0FDEeXG+nCeE+U7edCz fjuJeGfeLOFTVxmGd7pnPQ705Ji8hyBIBIvcwSStCbuDGZRCEu1Jul8rCxJ4lRXKz4i2 Yb8vUgKFvt+inRcXfrriFey1KbqtjMhZTMPZsqRBVXxZbG70iacaF3Lb6XKgVtip+UOb 00NSaIV2+M1bTEUltsZ2QkCm2oIoOMHeq3gOP1JKqvMvtXrrNR5Cj+rhxEcecOiPLfmj P1ng== X-Forwarded-Encrypted: i=1; AJvYcCVBeQ49FHQG0ptkocvPMErygeAOY9QWVp11Uoj48pQR6Gq1Q6zx6dALz8cckW7vHEbouushFBT81gwwmlI9@postgresql.org X-Gm-Message-State: AOJu0YzCpsavx0Uhnir5BnTK1vu/XcPcEl6RPQPF5OzWKKleizApBRN/ Zh4Ou/5lpqa7qtbh3RWcv5SJHbla/iVGfaNtTt73dLeXJpN3w4jVb1BFMR+Vug== X-Google-Smtp-Source: AGHT+IGdNVaReCB5anmNTl3nSj5PiKOTiR/2YvVsclgOSwimjQj1w6LmCuwc39sJE51UeHd0pc4zuQ== X-Received: by 2002:a17:902:d507:b0:1fd:ae10:722b with SMTP id d9443c01a7336-2039e55cf2amr153904615ad.63.1724794649406; Tue, 27 Aug 2024 14:37:29 -0700 (PDT) Received: from jeff-laptop.lan (c-76-102-242-158.hsd1.ca.comcast.net. [76.102.242.158]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2038560dc81sm87073295ad.190.2024.08.27.14.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 14:37:28 -0700 (PDT) Message-ID: Subject: Re: Introduce new multi insert Table AM and improve performance of various SQL commands with it for Heap AM From: Jeff Davis To: Bharath Rupireddy Cc: Masahiko Sawada , PostgreSQL-development , Andres Freund , Dilip Kumar , Luc Vlaming , Justin Pryzby , Michael Paquier , Matthias van de Meent , Alexander Korotkov Date: Tue, 27 Aug 2024 14:37:27 -0700 In-Reply-To: References: <20230603223824.o7iyochli2dwwi7k@alap3.anarazel.de> <6be6f58815dc0844fbe058edf56b4e735a6efc1c.camel@j-davis.com> <2280bf7241119bb88cbe0fe5eb36490cbd04c0c0.camel@j-davis.com> <12f1a2d8dd3b6305c0354f1c701f44b7be5e54eb.camel@j-davis.com> <8633171cb034aafc260fdf37df04b6c779aa1e2f.camel@j-davis.com> <229c4f7219ed164088dadc935df21e1cf125e191.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2024-08-26 at 11:09 +0530, Bharath Rupireddy wrote: > On Wed, Jun 5, 2024 at 12:42=E2=80=AFPM Bharath Rupireddy > wrote: > >=20 > > Please find the v22 patches with the above changes. >=20 > Please find the v23 patches after rebasing 0005 and adapting 0004 for > 9758174e2e. In patches 0002-0004, they must avoid the multi insert path when there are before-row triggers, instead-of-row triggers, or volatile functions used (see copyfrom.c:917-1006). Also, until we decide on the RETURNING clause, we should block the multi-insert path for that, as well, or implement it by using the callback to copy tuples into the caller's context. In 0003, why do you need the global insert_modify_buffer_flush_context? 0004 is the only place that calls table_modify_buffer_flush(). Is that really necessary, or is automatic flushing enough? Regards, Jeff Davis