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 1qcB8Z-00E9LN-CW for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Sep 2023 20:53:03 +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 1qcB8X-00HRpZ-4x for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Sep 2023 20:53:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qcB8W-00HRpN-RC for pgsql-hackers@lists.postgresql.org; Fri, 01 Sep 2023 20:53:00 +0000 Received: from mail-yw1-x112d.google.com ([2607:f8b0:4864:20::112d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qcB8O-002PjM-Sd for pgsql-hackers@lists.postgresql.org; Fri, 01 Sep 2023 20:53:00 +0000 Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-592976e5b6dso24988657b3.2 for ; Fri, 01 Sep 2023 13:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693601571; x=1694206371; darn=lists.postgresql.org; 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=HCTHWCwggzY7VEm+2IQqNUigF1u46TIoPCaVN8wFnG8=; b=No48vg5HlHjbG8bQe0z0ohE5HLm88VdCMfH/OHHUJJTwhSjpg1/NeaZoewR6feoDFs C6sOSIG5EUQ1EOxpGG56KD6huiaMIA4xz6a18KHBDV8DFzResupyI0TS1xwYKjm57QLa uqoO7LQdt2Crekl5oXZQyGWRfrtcuwAmx6k+Y8yKFqS6eMi1tIvo94ekQtNj/UYq4ld4 rUknCJ54+qpfs1fSsV6rK/wG687QrrDHTo1/OUxUhQ8oG28SMtjj2Vv5RhE/1wjOjMCp G7WI7yr3vLcqAB59Waz03txnQj1yPMxAJwehcieQKqykf5z6xpINr7vdtmhqijaHyhb2 XOCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693601571; x=1694206371; 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=HCTHWCwggzY7VEm+2IQqNUigF1u46TIoPCaVN8wFnG8=; b=GTnWoKZS62m3UAZCvZYQ62YJqnC8rXDf4MOwt/1aHYThZs/sIZxApxm0o0pJuG6Vaf LoDgs0tfxSMvuK6OIY55pDI9N9SLXWvg/CWNw2hrhpDhbzYSmSTMCQ6nuzaqWcj5QrTy qmSOHZZuEev/iZsjh8Bfc9hFATzPynOQvw+dnGMIpQpEG6jYBh+PJN1tsC62emgQbIkq Ez/zUoTL481uPeHeFwMxPrCAnp1N/VMisZFMsi+WzPUhfnVLP9phijKRP7tU0L5Qw8n0 n6ZjDb7LDA6C6cAzxG7jHCLPTrLsqytmMJ5CHmLBeV5/ps5zUEXeR33zxjIA/vVmr04b cW8Q== X-Gm-Message-State: AOJu0Yw0NYKWV8z0hctyAU6Bg4pL15LbpouSGx4TrGe9MLBuAz7H493u OH75dUqJAeqULngrgSdveeo= X-Google-Smtp-Source: AGHT+IEVGdnyR2iPYBv+VJ7VxwlbGwzMTEStoFZi3vLFTKRwvEuj9X17nJsvxVWO539VP4vJuvRq7Q== X-Received: by 2002:a0d:e2d0:0:b0:58b:cea5:947a with SMTP id l199-20020a0de2d0000000b0058bcea5947amr4047791ywe.40.1693601570878; Fri, 01 Sep 2023 13:52:50 -0700 (PDT) Received: from nathanxps13 ([2600:1700:48f8:340f:bace:b08:60a6:7267]) by smtp.gmail.com with ESMTPSA id z19-20020a81a253000000b0054f50f71834sm1246340ywg.124.2023.09.01.13.52.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Sep 2023 13:52:50 -0700 (PDT) Date: Fri, 1 Sep 2023 13:52:48 -0700 From: Nathan Bossart To: Robert Haas Cc: Tom Lane , Alvaro Herrera , Andrew Dunstan , pgsql-hackers@lists.postgresql.org Subject: Re: Inefficiency in parallel pg_restore with many tables Message-ID: <20230901205248.GA3184752@nathanxps13> References: <20230718045701.GA1090171@nathanxps13> <20230718160511.loirkf5fwjm5ut73@alvherre.pgsql> <20230718160713.GA1139177@nathanxps13> <20230720190644.GA1724613@nathanxps13> <20230722231941.GA2020225@nathanxps13> <1225141.1690069670@sss.pgh.pa.us> <20230723055703.GA2421212@nathanxps13> <20230724190015.GA2528613@nathanxps13> <20230725185336.GA2911441@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Sep 01, 2023 at 04:00:44PM -0400, Robert Haas wrote: > In hindsight, I think that making binaryheap depend on Datum was a bad > idea. I think that was my idea, and I think it wasn't very smart. > Considering that people have coded to that decision up until now, it > might not be too easy to change at this point. But in principle I > guess you'd want to be able to make a heap out of any C data type, > rather than just Datum, or just Datum in the backend and just void * > in the frontend. Yeah, something similar to simplehash for binary heaps could be nice. That being said, I don't know if there's a strong reason to specialize the implementation for a given C data type in most cases. I suspect many callers are just fine with dealing with pointers (e.g., I wouldn't store an entire TocEntry in the array), and smaller types like integers are already stored directly in the array thanks to the use of Datum. However, it _would_ allow us to abandon this frontend/backend void */Datum kludge, which is something. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com