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 1qNM1T-004l2S-Vb for pgsql-hackers@arkaria.postgresql.org; Sat, 22 Jul 2023 23:28:27 +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 1qNM1S-000RlU-4B for pgsql-hackers@arkaria.postgresql.org; Sat, 22 Jul 2023 23:28:26 +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 1qNM1R-000RlM-R5 for pgsql-hackers@lists.postgresql.org; Sat, 22 Jul 2023 23:28:25 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qNM1L-000vux-0W for pgsql-hackers@lists.postgresql.org; Sat, 22 Jul 2023 23:28:24 +0000 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1b9c5e07c1bso23786195ad.2 for ; Sat, 22 Jul 2023 16:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690068498; x=1690673298; 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=CHTkJTozDLpy5T9uhrJZhx7PgQ1Y3J0uhZla258E8QE=; b=g9t1axTwmAHndoBt8xUK5jYwH5qe2KnL/efCL+zLo5Zw84q+XFfR1csXj+p2tdfjUG THsRkQnaNDMA9aA6F+KiHdBNf5dUrfXMkStLHoIe/3ITImrGBHTUTr8PYrXa9wzSnCa3 66/CpLViAmDxAFDYzQIn0OUlqYLV/GqlTbZZroEFP5wEGJV2azGnZNoCAvZYqy8HatCj 2ubbIJ+HqhMQky0ZZFo3hCb3b74YET4C+Zt8+1Q8yaLqCj7mknxIMU2K1ECfwsKCQu7N obhkZd2dLrihRLZexv8txPnU0eEOPZrmahV65+Zs7/zhdcZuCDFg9MLj1XabqPWi6TC4 oYRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690068498; x=1690673298; 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=CHTkJTozDLpy5T9uhrJZhx7PgQ1Y3J0uhZla258E8QE=; b=WL4CrsuWVG8k1yp82UL01ChCviOcszOS+2L2I73BMZF3q5E8Zozk6VlKs1Dn/cdkHG 18OOmOpeamxfSEal7Lk7eDhUQ38O8UD86y4htnAxxkYI9va7TEkHReQXMkRMslki7vYt 8zni8Dpslf5HRqIay1sbLFmnb9z0c1dwgH1EB0/YAcllNwy1+bV0pxKPqf/rp10jMGxH Et6WLYfva+as4qn0tpR9kOlJkGkmoAmCF98fQ3HNJuJvxQWk4pVhnA/OvuSNqgH3vT0n lzurBq8jS0w1c6AsL6ecbuLBQxK+c9uGV8QqugzMSecad3c5YYFTsDQlmuJo+Shv/5yl rAbQ== X-Gm-Message-State: ABy/qLaTGjjEAS5kHwK+B80wp0stqT2JIzf/i1ps4xKFQGQ62tPWp+4g btm480b35ZQyjST2lzpen4c= X-Google-Smtp-Source: APBJJlHNXkd2iLBTsPd3pJeolnFnBHN8TvbD5ES0YHhlguK1jYANYiT5jDJoT3+aYWrzlYIBxJBDAw== X-Received: by 2002:a17:903:2304:b0:1bb:4861:d39e with SMTP id d4-20020a170903230400b001bb4861d39emr6189101plh.12.1690068497826; Sat, 22 Jul 2023 16:28:17 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id z15-20020a170903018f00b001b9df8f2907sm5861746plg.264.2023.07.22.16.28.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jul 2023 16:28:17 -0700 (PDT) Date: Sat, 22 Jul 2023 16:28:15 -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: <20230722232815.GB2020225@nathanxps13> References: <20230718045701.GA1090171@nathanxps13> <20230718160511.loirkf5fwjm5ut73@alvherre.pgsql> <20230718160713.GA1139177@nathanxps13> <20230720190644.GA1724613@nathanxps13> <20230722231941.GA2020225@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230722231941.GA2020225@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Jul 22, 2023 at 04:19:41PM -0700, Nathan Bossart wrote: > In v3, I moved the Datum definitions to c.h. I first tried modifying > binaryheap to use "int" or "void *" instead, but that ended up requiring > some rather invasive changes in backend code, not to mention any extensions > that happen to be using it. I also looked into moving the definitions to a > separate datumdefs.h header that postgres.h would include, but that felt > awkward because 1) postgres.h clearly states that it is intended for things > "that never escape the backend" and 2) the definitions seem relatively > inexpensive. However, I think the latter option is still viable, so I'm > fine with switching to it if folks think that is a better approach. BTW we might be able to replace the open-coded heap in pg_dump_sort.c (added by 79273cc) with a binaryheap, too. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com