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 1kwtt5-00016m-T5 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Jan 2021 21:29:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kwtt4-0002hl-QV for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Jan 2021 21:29:06 +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 1kwtt4-0002he-Ge for pgsql-hackers@lists.postgresql.org; Tue, 05 Jan 2021 21:29:06 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kwtt2-0000Gg-AW for pgsql-hackers@postgresql.org; Tue, 05 Jan 2021 21:29:05 +0000 Received: by mail-pf1-x434.google.com with SMTP id a188so475185pfa.11 for ; Tue, 05 Jan 2021 13:29:04 -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=SNDMvKGlACM4PFUQtvXGqEZqS2XEv9zK7nnuZhNOaXw=; b=s19baoIRr/OQkig4wGCdEcjcI2EDmNEpg5tr7AmTDsB0WXCn8kz7Rg3BN5r2JHRijJ cWF1acvz6O1GMOCKsicRwe24fglsh7A0MFAmhWRwv8J/3CxXZgobj6xCvH9JfQkwCu4P 6wrIJsHlHUhhRK+WDOsi3dYEM+GBSB5CHPcOv2BNR2kQeGX9abTm4XOkR+tD+oZIh3im 9aziM6G0EPc5G3XIHBpi47Ijz82t5TT3KHaGDpGoGO2pJwJ6Zca5BLRtPu1ZFrM6TtLt xCk4/KrLw5ob8CJmFrDAlvqNh4uNjUBB1GuYFNDmuFdZlhhdvOWs6JMyX36Os9D2ndHO YyJg== 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=SNDMvKGlACM4PFUQtvXGqEZqS2XEv9zK7nnuZhNOaXw=; b=Co2Nt8MnnF3J9jwgF+/wmBmYppC2snm4nQrt6ezcw5Tsx/0V+3/jYYgQt7rppEVvET HjpyiDgkTdUFFplwLG4t0gq8WvIg3n98sn13/5g79ll5I0wc9u6JsR64row87lc4Fpyz /YeL80iGsmvMkjomsrtxTmQYwpZaufUY6AGGLel9h8uOX84tIHI9DPArFfIhL+jHEb96 cm/Tan891Qi1SPeuRstSst0jjRJdoEEB4xL/zNbXVexoAukXjoD3lqZmpnLv8SfE/2W1 3gbFoOTMqQ4e7Lhs4cWlv8E0V6qFeX+v9l+m3ZiHHlwInYxqhd6e/XTXVpb/xD2zvfws ei9Q== X-Gm-Message-State: AOAM532cgKOemNON94IpF08/dErTPoHrArOILQfKflXYnOxoReNx5xWl 1vGgV/IF1CzzxuCzCtXzDBvsHQ== X-Google-Smtp-Source: ABdhPJw311FdHbI0pzcIzx80lYZ+7l/v/sXOpZBe5kSp5y30ZOkZPACvPsRr6XMs6dyu2jkQ8+eDZA== X-Received: by 2002:a63:4504:: with SMTP id s4mr1130821pga.284.1609882143324; Tue, 05 Jan 2021 13:29:03 -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 c10sm293920pfj.54.2021.01.05.13.29.01 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jan 2021 13:29:02 -0800 (PST) Message-ID: Subject: Re: New Table Access Methods for Multi and Single Inserts From: Jeff Davis To: Luc Vlaming , Bharath Rupireddy , Justin Pryzby Cc: PostgreSQL-development , Andres Freund , Paul Guo Date: Tue, 05 Jan 2021 13:28:59 -0800 In-Reply-To: <96eaa813-4ad6-e80a-04a4-cc8082d356dd@swarm64.com> 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> 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 On Mon, 2021-01-04 at 08:59 +0100, Luc Vlaming wrote: > Reason I'm asking is that I quite liked the heap_insert_begin > parameter > is_multi, which could even be turned into a "expected_rowcount" of > the > amount of rows expected to be commited in the transaction (e.g. > single, > several, thousands/stream). Do you mean "written by the statement" instead of "committed in the transaction"? It doesn't look like the TableInsertState state will survive across statement boundaries. Though that is an important question to consider. If the premise is that a given custom AM may be much more efficient at bulk inserts than retail inserts (which is reasonable), then it makes sense to handle the case of a transaction with many single-tuple inserts. But keeping insert state across statement boundaries also raises a few potential problems. Regards, Jeff Davis