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 1qLnCS-000hQY-5Q for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Jul 2023 16:05:20 +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 1qLnCQ-00AqPu-KU for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Jul 2023 16:05:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLnCQ-00AqPl-BV for pgsql-hackers@lists.postgresql.org; Tue, 18 Jul 2023 16:05:18 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLnCN-0009re-EL for pgsql-hackers@lists.postgresql.org; Tue, 18 Jul 2023 16:05:17 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id F3DEF320093A; Tue, 18 Jul 2023 12:05:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 18 Jul 2023 12:05:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1689696313; x= 1689782713; bh=b9ZsNpZcZT2hQKB4Nj4kOneofuZmOVln/+3HeKPzVJ4=; b=U Hqq3RsaQcfNOSakqSZR/Ap0c+Aad20sQpGKLGtQtUap7SjWZxi63LZoi9PdQofeq xq3kY2hwaAuBmwLtGS+JghlniQgizbupVer6KWCEPZj+TEyGA7PsRcE8beeYPdTO EWfRG0OSRUeBW6irBEmHcytg4x7EBrYruu6Fsi1pprlt/DCEF8hxdLw3TvPD23AV u0MvJVDKfOiCRjXjn5Al+xxjszBP6VYOXF917Yzo/srKwPZiedg0EE0gdK10icTc C90txPFHYH+ZnmrRBxTDSfOTmn4X7D4ExE7+Vui7Y9ZmmL6C08O63kbSSXUFa3Cq iXUo7jc52+V2JxxgVMjvw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeeggdelvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedtudekudetueefvedvueefleetieefieejkeetteekkeev tdduudeiteejgffgteenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmpd hhrghtvghsqdhsohhfthifrghrvgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprd horhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Jul 2023 12:05:13 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D85A29D; Tue, 18 Jul 2023 18:05:11 +0200 (CEST) Date: Tue, 18 Jul 2023 18:05:11 +0200 From: Alvaro Herrera To: Nathan Bossart Cc: Tom Lane , Andrew Dunstan , pgsql-hackers@lists.postgresql.org Subject: Re: Inefficiency in parallel pg_restore with many tables Message-ID: <20230718160511.loirkf5fwjm5ut73@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230718045701.GA1090171@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Jul-17, Nathan Bossart wrote: > @@ -35,7 +42,11 @@ binaryheap_allocate(int capacity, binaryheap_comparator compare, void *arg) > binaryheap *heap; > > sz = offsetof(binaryheap, bh_nodes) + sizeof(Datum) * capacity; > +#ifdef FRONTEND > + heap = (binaryheap *) pg_malloc(sz); > +#else > heap = (binaryheap *) palloc(sz); > +#endif Hmm, as I recall fe_memutils.c provides you with palloc() in the frontend environment, so you don't actually need this one. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "It takes less than 2 seconds to get to 78% complete; that's a good sign. A few seconds later it's at 90%, but it seems to have stuck there. Did somebody make percentages logarithmic while I wasn't looking?" http://smylers.hates-software.com/2005/09/08/1995c749.html