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 1kqJxo-0007C5-Gs for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Dec 2020 17:54:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kqJxl-0003dz-QD for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Dec 2020 17:54:45 +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 1kqJxl-0003dr-J0 for pgsql-hackers@lists.postgresql.org; Fri, 18 Dec 2020 17:54:45 +0000 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kqJxj-0000rR-6D for pgsql-hackers@postgresql.org; Fri, 18 Dec 2020 17:54:44 +0000 Received: by mail-ot1-x331.google.com with SMTP id q25so2660429otn.10 for ; Fri, 18 Dec 2020 09:54:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9k2c1CpRQHfHnXMYu5sqviKm2p8+wldLsQjwk1+2f10=; b=nNJaBCA9JaoEUhWXU1QanF807dyZwDtSb4Pzqm/tQcv32QMqr3ClIE6WVTitxyRpaH rhEtAXa0ekfnrn7McnlOVj3py9vOADycNoRq7BUD22PKkTgpF0TTtPRYjCsopSmtX/7F m/s710mVSvHg6BkkQoHrFE8I31/Z5hHXSMPNtgYyRkpSRUVzq0k1DvGMHEV92JqaXX/Y Cfp+rldVRPl3+VZIQz9xDfV4iPEpQ1FfrAkClspAtZHMcpm/ir4T8rZBPprSTcvj5Zmg 8R8kfqLYiTNxYBdflVoP5V0cTvgh1EpJvOaDxMXkyJQ/fQEdIQZPGGNYzhp6U1GFcpu7 m/hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9k2c1CpRQHfHnXMYu5sqviKm2p8+wldLsQjwk1+2f10=; b=tuCbE45CK0I4azOr8VuIsfg4W6wJHXFyP8OBQcsNhmmuo85U0VuPqd9xKzGlVfnrXj M0Ji7WjKnHglksP/0PdQzhHOtUptJ/4+jZ+fRNMJstujaaFk40EsFmhRv+5h8insl1ET djpxPlRsLSo5M2w9WwgKiJH2D7xyI5DaG7wP5OTj53VPg7qkxUJ/nOI4nVtN9LbKnP8z KaBLbonQ1LxWrYQqc4uefoNxvv13LoeMaebGNCHpVSChidtNd7ZtlyD8FGA2HYqdkoAp odmkQ6ClbK1MAA2qmBwblWEpxcUSZAuU4WII77ls6ch908JcMPpheyBQ0IxnLG1dosTG lNPQ== X-Gm-Message-State: AOAM532KE1cVjFeLbMv24ozNp5hOgw69j6XOcV2zcQOFe36GInpNFcVE XIASrOBNP6dWJ2flbYQfpfPK/w== X-Google-Smtp-Source: ABdhPJzoSUTh2GyR4J/LF1FtQLK9yaus2m3ZULrnXvkwUCTuu9Mkafo+uUkkBCNtpaS1h/NPllUbfQ== X-Received: by 2002:a9d:32f:: with SMTP id 44mr3614571otv.239.1608314082092; Fri, 18 Dec 2020 09:54:42 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id g200sm1893923oib.19.2020.12.18.09.54.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Dec 2020 09:54:41 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id C1C8780092E; Fri, 18 Dec 2020 11:54:39 -0600 (CST) Date: Fri, 18 Dec 2020 11:54:39 -0600 From: Justin Pryzby To: Bharath Rupireddy Cc: PostgreSQL-development , Andres Freund , Luc Vlaming , Paul Guo Subject: Re: New Table Access Methods for Multi and Single Inserts Message-ID: <20201218175439.GA30237@telsasoft.com> References: <20201217050522.GU30237@telsasoft.com> <20201217204442.GX30237@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Dec 18, 2020 at 07:39:14AM +0530, Bharath Rupireddy wrote: > On Fri, Dec 18, 2020 at 2:14 AM Justin Pryzby wrote: > > Are you thinking that TableInsertState would eventually have additional > > attributes which would apply to other tableams, but not to heap ? Is > > heap_insert_begin() really specific to heap ? It's allocating and populating a > > structure based on its arguments, but those same arguments would be passed to > > every other AM's insert_begin routine, too. Do you need a more flexible data > > structure, something that would also accomodate extensions? I'm thinking of > > reloptions as a loose analogy. > > I could not think of other tableam attributes now. But +1 to have that > kind of flexible structure for TableInsertState. So, it can have > tableam type and attributes within the union for each type. Right now you have heap_insert_begin(), and I asked if it was really heap-specific. Right now, it populates a struct based on a static list of arguments, which are what heap uses. If you were to implement a burp_insert_begin(), how would it differ from heap's? With the current API, they'd (have to) be the same, which means either that it should apply to all AMs (or have a "default" implementation that can be overridden by an AM), or that this API assumes that other AMs will want to do exactly what heap does, and fails to allow other AMs to implement optimizations for bulk inserts as claimed. I don't think using a "union" solves the problem, since it can only accommodate core AMs, and not extensions, so I suggested something like reloptions, which have a "namespace" prefix (and core has toast.*, like ALTER TABLE t SET toast.autovacuum_enabled). -- Justin