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 1l0ucP-0004yP-W4 for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Jan 2021 23:04:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l0ucO-0000kN-GG for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Jan 2021 23:04:28 +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 1l0ucO-0000kF-4z for pgsql-hackers@lists.postgresql.org; Sat, 16 Jan 2021 23:04:28 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l0ucH-0000Pf-EO for pgsql-hackers@postgresql.org; Sat, 16 Jan 2021 23:04:27 +0000 Received: by mail-pj1-x102d.google.com with SMTP id md11so7109042pjb.0 for ; Sat, 16 Jan 2021 15:04:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=/Qc+uWbCO3h+7YuT2D7wAoI/G/GpKzbWHMKkLS52oaE=; b=aBaDAbfXSX0E9+Q1/m6VjWg5tlv+0nimJx9jNaHyZyvyvToybN/GEe1fETycGPCR+W NmIDHKuTdbUFvsqdvwTA1g4SsWUT1AqVIRYvQI2PbDRujRVhTVCz+bXjidOJIpsetSLG 7Flp3L7+scWXgLd6PeUjkWebTDrRqzYmSDPNnNWeveuGOyA99HV8KexsXCzk0M1qB/ZR nxlKS8J//0QcsIdhRn4uQJvxHqS5Xj6frCXlkaucFK+6qR1uKgfFONOJEMszs5VOP5L3 CselE3sFdcuuK8bIXMxrosxhyXA65+1wJTCdJzg8txmUD5vK3hZia273ru3A4gJvKgtZ lrnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=/Qc+uWbCO3h+7YuT2D7wAoI/G/GpKzbWHMKkLS52oaE=; b=KHAk5V865Affl/dpb3FPlK12DGx1Nlf8Y3jXwFpfWmPE3+gmzJWolt0nbgEixPC4e6 AHJIFG0hEorC3al5CGq3fqu6kAdPl7hHaYSzkRZaX41NlVOAHlCXuwAeVuBXLOe/9ZE7 z6TSV9wDRtjdPmjxogIOJq9JgrNcBSKa7pCnM69Y1KjT8D6OOF/ZG2PXflGBnPBAB/co zl/Bnd25dXLDc9QcWPfgJ7DG+oCO3qeNEAhUwspakDVEuywZyf6Py5WfhHtIGeESjsjW HnKkrWkX2I/MP0NwPbhYZPMlC9L9C7BT+pukQjqI97/mKKdiMtYBG5VK+Sy1eBuG04Zv Fgrw== X-Gm-Message-State: AOAM532QLrJx+oDWi/jylflLvmiVkdR6Od1EVpehplzNBJrHSy+TbQAn qjEy3cmNvwh1wo71m2RDYg5uCg== X-Google-Smtp-Source: ABdhPJxcuJSfugB5JVZMy0rJ7SuW2YP53tRbZKBDhUHLLDyDAL1E7NH434xLMZsr0F7WNUOQ4njQmQ== X-Received: by 2002:a17:90a:1c09:: with SMTP id s9mr17709206pjs.83.1610838259487; Sat, 16 Jan 2021 15:04:19 -0800 (PST) Received: from jdavis.lan (c-73-231-146-4.hsd1.ca.comcast.net. [73.231.146.4]) by smtp.gmail.com with ESMTPSA id n12sm2215602pff.29.2021.01.16.15.04.17 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Jan 2021 15:04:18 -0800 (PST) Message-ID: Subject: Re: New Table Access Methods for Multi and Single Inserts From: Jeff Davis To: Bharath Rupireddy , Luc Vlaming Cc: Justin Pryzby , PostgreSQL-development , Andres Freund , Paul Guo Date: Sat, 16 Jan 2021 15:04:16 -0800 In-Reply-To: References: <20201217050522.GU30237@telsasoft.com> <20201217204442.GX30237@telsasoft.com> <20201218175439.GA30237@telsasoft.com> <20201221074725.GF30237@telsasoft.com> <20201225023958.GW30237@telsasoft.com> <96eaa813-4ad6-e80a-04a4-cc8082d356dd@swarm64.com> <508af801-6356-d36b-1867-011ac6df8f55@swarm64.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > If we agree on removing heap_multi_insert_v2 API and embed that logic > inside heap_insert_v2, then we can do this - pass the required > information and the functions ExecInsertIndexTuples and > ExecARInsertTriggers as callbacks so that, whether or not > heap_insert_v2 choses single or multi inserts, it can callback these > functions with the required information passed after the flush. We > can > add the callback and required information into TableInsertState. But, > I'm not quite sure, we would make ExecInsertIndexTuples and > ExecARInsertTriggers. How should the API interact with INSERT INTO ... SELECT? Right now it doesn't appear to be integrated at all, but that seems like a fairly important path for bulk inserts. Regards, Jeff Davis