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 1kDqZq-0008Ah-4H for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Sep 2020 14:51:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDqZp-0001zC-2J for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Sep 2020 14:51:01 +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 1kDqZo-0001z5-Lq for pgsql-hackers@lists.postgresql.org; Thu, 03 Sep 2020 14:51:00 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kDqZh-0007s3-8y for pgsql-hackers@lists.postgresql.org; Thu, 03 Sep 2020 14:50:59 +0000 Received: by mail-qt1-x843.google.com with SMTP id e5so2087886qth.5 for ; Thu, 03 Sep 2020 07:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=eniZ0jRY/rjceMhJc98vLPwPVxlNH68bPUH401o+VH8=; b=fE78BrpgxpKKcVmpXup5bisDYWNqMWG/TuygxbpfKRXgAoaT+FgmdRjc4v5t2z4BCb BptM+J0vrtmJFSDDli+dG1o3cWnj7czwWwlNJW6RiFNBSqfpvnZK/3mXTWzcJWaQuWxb K9aCG0Q3WgvJuS4YM06MZUMmmM6Ch8N0/HEviqF24Fb8YdBtt4VRQSDfDl6IYq5oGjwQ MeaJWgsVPElhVjPsEQAsfN2m2VLXXKQhkgfeNjBk+W2Ms8wTJ8CjYMGJ3c5JDQ6SvwjG PZ2NmwaynpRuWB9YEkBtEDFnrH2GzCOIrOAK1qxjvdMrVeL7yzt+i3M51nRTECfDNMNF lUDg== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=eniZ0jRY/rjceMhJc98vLPwPVxlNH68bPUH401o+VH8=; b=oobwup5sXa4XxKQVufEi+3SBJuaX40/EbK7w+PfMzRRAAawdBNtro0Pi0/M0LgZaub yE0znCApoiX2ZVSbdC+Hnbxg7z7lJI8z3LLLURnlKrzlQ47l+wy5lcLOAI+24Pu8HQ0p LPM2RQAzG9lfz5c+hcapA2GMynzSkiBmbUvgAsCbzp6f0NqfV1aNJTxyjpsqTl6YXpo2 FhmY7+trvfP5ZLKgciFJqzgOny5qKRMi+zfPq42RQUT2uUslHHYmY7ncdH53JuiLiqEh sGiPjBjpkoDOgTC/EIGABsYyH20BU2i/N1iwm30vNKK+Cx0X1DFh5TLJ18XF9xIQmHE/ PhYw== X-Gm-Message-State: AOAM531PkgjWJgkD42+ctWG/dijUBJDpzXv9rjmQGdoDb7GmBoejbLnO s8MnDTb/NDy8wwBZFs9xgx6p4Q== X-Google-Smtp-Source: ABdhPJx5ZXgZxucXKxXIK1En4czhdxY3+XIDNIm2JPkPThF7Z2JXnf10xygiCd0mLljDUJLRVbnbuw== X-Received: by 2002:ac8:568f:: with SMTP id h15mr3920332qta.232.1599144651317; Thu, 03 Sep 2020 07:50:51 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.47]) by smtp.gmail.com with ESMTPSA id s17sm2213208qte.50.2020.09.03.07.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 07:50:50 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 29C322A154F; Thu, 3 Sep 2020 10:50:49 -0400 (-04) Date: Thu, 3 Sep 2020 10:50:49 -0400 From: Alvaro Herrera To: Michael Paquier Cc: Daniel Gustafsson , Robert Haas , Andres Freund , Postgres hackers Subject: Re: Switch to multi-inserts for pg_depend Message-ID: <20200903145049.GA14188@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200903053506.GC14963@paquier.xyz> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I agree, this version looks much better, thanks. Two very minor things: On 2020-Sep-03, Michael Paquier wrote: > @@ -76,11 +77,23 @@ recordMultipleDependencies(const ObjectAddress *depender, > > dependDesc = table_open(DependRelationId, RowExclusiveLock); > > + /* > + * Allocate the slots to use, but delay initialization until we know that > + * they will be used. The slot initialization is the costly part, and the > + * exact number of dependencies inserted cannot be known in advance as it > + * depends on what is pinned by the system. > + */ I'm not sure you need the second sentence in this comment; keeping the "delay initialization until ..." part seems sufficient. If you really want to highlight that initialization is costly, maybe just say "delay costly initialization". > + /* > + * Record the Dependency. Note we don't bother to check for duplicate > + * dependencies; there's no harm in them. > + */ No need to uppercase "dependency". (I know this is carried forward from prior comment, but it was equally unnecessary there.) > /* > * Allocate the slots to use, but delay initialization until we know that > - * they will be used. > + * they will be used. A full scan of pg_shdepend is done to find all the > + * dependencies from the template database to copy. Their number is not > + * known in advance and the slot initialization is the costly part. > */ As above, this change is not needed. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services