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 1naCVq-0000sv-E3 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Apr 2022 08:20:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1naCVo-0007Cv-E6 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Apr 2022 08:20:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1naCVo-0007Cm-2o for pgsql-hackers@lists.postgresql.org; Fri, 01 Apr 2022 08:20:04 +0000 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1naCVl-0004gh-W8 for pgsql-hackers@postgresql.org; Fri, 01 Apr 2022 08:20:03 +0000 Received: by mail-oi1-x22e.google.com with SMTP id b188so2057063oia.13 for ; Fri, 01 Apr 2022 01:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kclJoyshYkkZaMSz6UkQ796/CpDpiaU9jpm66bJ17Zc=; b=g3U7TRnDIMgFfMEyek0i7LMJzBYT+FHp9mM6wKDokWY2irC7oZ2OeH6fQ69rcE62kb lb7TFiV/ggGwMrgAqJgCjtni+tTsMdA6moAut1X2oo0l34VB/QjCi0APaAgnvGY9Lucn HuJExsz0oiqTaivS969womMEPbQn4DzsLd81IwyMHRcvYQX0f9DILkR4LMIiklmk+kIF szgUpU1FlEgI9IRJkZ5yq9E53A4WH1MxJM0/a5pL+Z73PKAdyx6IqwJjiCm6ROQYZ1Xj k8vuV0dBYI3ZEzY9spWzDU4kxkH5tYKU7+BdAhvtYkMr+5dzMcmn/dA6tMqJGvyFkVZL UjkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kclJoyshYkkZaMSz6UkQ796/CpDpiaU9jpm66bJ17Zc=; b=Pw0kiCRl/TX2f2rtHC8u1Q9E972A6h9VfiepWp+Vh0iZUnVe5pypVLMWX/CZzeOkRD Jy9ebbzhoKciUjwZgWiE+yPUqXwUloJcnsIcHPVrT1uaOOvX5y7tTqCAY3akqm9rBcu4 NEe1dvzF0EKburQhvXroEs0iJyBQQNx/5eZVy0wFjrC/zb8ZFGTBtRgqpjAUAlzeGDTC nFnRLOxPn8b3iMvlhYnwDZc4xMTQdKZlXCa1bluZTV8GE502ZNaqby9FeUzMbiG+K3wZ vERKXKkPksr8JVbRNwH0sWrtMiZ6Kr5neEqJElFxPtoitWLRy4fbSGU8FdUnuc5i5WkN PE7g== X-Gm-Message-State: AOAM532dbVCo/1GRN+KjUFbnGBoztXLx8G4ZOMYUEt+8LzM7WWMzuasG NDL5wi6TwS+Lmxf988xOhUDT4by7ugp1L2GjR7w9Asf0 X-Google-Smtp-Source: ABdhPJyPIIET9VA2J9JLhUUA9CiIReO1EGYUrAW2/jWrRPH3JKhHhbhlnDDicLnpk+UGph9zpYcjIQ+43noDe8AaYys= X-Received: by 2002:a05:6808:199c:b0:2da:854a:204d with SMTP id bj28-20020a056808199c00b002da854a204dmr4407492oib.184.1648801201498; Fri, 01 Apr 2022 01:20:01 -0700 (PDT) MIME-Version: 1.0 References: <215356.1647286703@sss.pgh.pa.us> In-Reply-To: From: David Rowley Date: Fri, 1 Apr 2022 21:19:49 +1300 Message-ID: Subject: Re: generic plans and "initial" pruning To: Amit Langote Cc: Robert Haas , Tom Lane , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 1 Apr 2022 at 19:58, Amit Langote wrote: > Yes, the ExecLockRelsInfo node in the current patch, that first gets > added to the QueryDesc and subsequently to the EState of the query, > serves as that stashing place. Not sure if you've looked at > ExecLockRelInfo in detail in your review of the patch so far, but it > carries the initial pruning result in what are called > PlanInitPruningOutput nodes, which are stored in a list in > ExecLockRelsInfo and their offsets in the list are in turn stored in > an adjacent array that contains an element for every plan node in the > tree. If we go with a PlannedStmt.partpruneinfos list, then maybe we > don't need to have that array, because the Append/MergeAppend nodes > would be carrying those offsets by themselves. I saw it, just not in great detail. I saw that you had an array that was indexed by the plan node's ID. I thought that wouldn't be so good with large complex plans that we often get with partitioning workloads. That's why I mentioned using another index that you store in Append/MergeAppend that starts at 0 and increments by 1 for each node that has a PartitionPruneInfo made for it during create_plan. > Maybe a different name for ExecLockRelsInfo would be better? > > Also, given Tom's apparent dislike for carrying that in PlannedStmt, > maybe the way I have it now is fine? I think if you change how it's indexed and the other stuff then we can have another look. I think the patch will be much easier to review once the ParitionPruneInfos are moved into PlannedStmt. David