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 1qLnEP-000hTU-Sr for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Jul 2023 16:07:21 +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 1qLnEO-00AtTm-6U for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Jul 2023 16:07:20 +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 1qLnEN-00AtTX-UC for pgsql-hackers@lists.postgresql.org; Tue, 18 Jul 2023 16:07:19 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qLnEL-0009sI-Fd for pgsql-hackers@lists.postgresql.org; Tue, 18 Jul 2023 16:07:18 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1b8b4749013so46023215ad.2 for ; Tue, 18 Jul 2023 09:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689696436; x=1692288436; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MsQTHcrBfppZ/pE2VPr3jTQWJ4gJEkscG8+R7ODcO1k=; b=griFSu2tkEEaM8CK9b9qiWXpW2VmQ4VZJ1ie9+vVTCmghYIvL52GUTUE0zVKH/wGie VecfoS3iY21IOv2b6PrlnPzrfR831vFOIDEmLmIG1G6S6zHVKoExHxn5Rkrbd9zqWFcE uOJT7F6VCKrJRnpyJQa4w/v69K4dM0Jvi42PXQ3/92zuEIUv2jNwIG5XM/jtduP9seRG mKDKfD10TSqg4/+ibT4QHetupzYtHzM9G53qNta+nR12sIqWmMsaTcw3QWWbwhZRfJ9F rl4IRLU+NyiDOEDa9kyowMx6mH6ZDM7LyMI6bOAdfNwVI6CeTt91Bi+icDG99XCorwo1 PHlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689696436; x=1692288436; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MsQTHcrBfppZ/pE2VPr3jTQWJ4gJEkscG8+R7ODcO1k=; b=K3vjdAnSVrGQxA7/sXEfzFxpwqVU4Rp8y6rx0jYXzwnCHyqiaZm4Zf3cuP5JeWbTRU RiB/+mmTFetF/Zs/Lj3FzT//4S1/EpeyGRwvKW6FeMjui+P1eG9Vqu7oJqPafLa21tHm t94E6NzgUUoenFENK9Zqo6V3nSpHBVSg4OjyZEhdgj2lXJ1JAewXOAw0a6VRtJjHfbVG q3EyFstn97yEiilKH9WLaRiQPZg0EsOhiRLbzH2AHTqHeCugtA0dsVsFi+01CNdtFlnr t/4uLFk1a4Tt+T2/Ct4+3lrD5KlLB4bmGOcY51k7B/IN194M0M55Tw9zo1uCV6iIWOXl IZiQ== X-Gm-Message-State: ABy/qLbWPhtXJ1tCi/UvFNeTkRs5TeeGYH50DQkuKH0B/AQ6MWw2v9ls eY+kM+dSdYXazmug2SA4698= X-Google-Smtp-Source: APBJJlFByvvjf9W3JBo1E+AtLJg+t80BS4I0WH9jwa/Fxp3HizkzupxjO8QPSexmeXY+gDL33/tRgw== X-Received: by 2002:a17:902:7e84:b0:1b5:25f8:2160 with SMTP id z4-20020a1709027e8400b001b525f82160mr12703991pla.30.1689696436127; Tue, 18 Jul 2023 09:07:16 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id u13-20020a170902e80d00b001b9de67285dsm2064950plg.156.2023.07.18.09.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 09:07:15 -0700 (PDT) Date: Tue, 18 Jul 2023 09:07:13 -0700 From: Nathan Bossart To: Alvaro Herrera Cc: Tom Lane , Andrew Dunstan , pgsql-hackers@lists.postgresql.org Subject: Re: Inefficiency in parallel pg_restore with many tables Message-ID: <20230718160713.GA1139177@nathanxps13> References: <20230718045701.GA1090171@nathanxps13> <20230718160511.loirkf5fwjm5ut73@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230718160511.loirkf5fwjm5ut73@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jul 18, 2023 at 06:05:11PM +0200, Alvaro Herrera wrote: > 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. Ah, yes it does. Thanks for the pointer. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com