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 1naCmR-0001mK-7g for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Apr 2022 08:37:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1naCmP-0003EG-Vb for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Apr 2022 08:37:13 +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 1naCmP-0003E6-Kx for pgsql-hackers@lists.postgresql.org; Fri, 01 Apr 2022 08:37:13 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1naCmK-0004oe-9c for pgsql-hackers@postgresql.org; Fri, 01 Apr 2022 08:37:12 +0000 Received: by mail-ej1-x62e.google.com with SMTP id c10so4243097ejs.13 for ; Fri, 01 Apr 2022 01:37:08 -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=f3PRs9DDW/H3JaNBLoohCJ0BPAfLDNW6N4Zie6XqQiI=; b=cY9qwPR0oKXQFNupRu2PdOVbcVdSHnJU1VPu4204QQuvN9qbFkz2c0aNDTX5nsUeaQ DgGECRs1d3TkqaCKWlw3XKaeslI/dXo2zL+s9J8xHepktFN3HFnmOvr98qG/Rp0nTNR0 uo1pAQmBe6pB7hjvBDEplo+yhNWUv2XvstW/Bo2eAyFM90wzLvu0BSaNh8mglPXwAhYd //17B9xap9LqOteZfiORxx+P2ZavylTFwxiYI7Ibd/YUxHh/JdaT9jy/93DU7WvW10IB gNuTcgy3QUjP7QwLnzpAQF+w2ePAyu9HxnD5rRjudp+5ltJ1oF89iOjCX89SlxfJLWof 0ndA== 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=f3PRs9DDW/H3JaNBLoohCJ0BPAfLDNW6N4Zie6XqQiI=; b=nQf7s47yvq19oGRi738uybk3IUKysFBKzQPj85FMWF4M0/5jmAliQoqmUj3IFtWAaN 4STTTJHc4UL4Dh6aMyzt4rOht8X1ilsi5LhVabvaZnUXl8TDm+l8SadSvmuv+xpN5zME 41OXzuklNY3NCG2mw59Jl22eSfQH5vHhGryBV+9YqpyXtUaaHWCiC2YwuYnhWIYUg//g 1v5MADilp0VpvCLotzzmHIYJxCwp+y8LdYYyh9t5oMtK3yDmXLu8uMc/ALvQfiLDG4vr gfl2q9Kz+NedCREIv2yg+p39ODqyTBqI39IUC2A1btm5odjxrtxSzaz70lO0RaQ9mDox BpAA== X-Gm-Message-State: AOAM531YZhJaKP7joEDzcqZd+JUsv262QWaE6wjPH9xmCegJ8SOfbd3D whcduzzQ5mMAa2iW/895ynrqBvjeyDbVa4Q0jos= X-Google-Smtp-Source: ABdhPJxUFM9x62o3UJ7Tvz9vuVxZe0/0pfcpWlaPMW2ccA7FOsIWTQfYQ9vNrJZ3YrQ8leHu1TtYGynRNEaCC/GQdBE= X-Received: by 2002:a17:906:4785:b0:6df:6784:a7f8 with SMTP id cw5-20020a170906478500b006df6784a7f8mr8777607ejc.301.1648802225673; Fri, 01 Apr 2022 01:37:05 -0700 (PDT) MIME-Version: 1.0 References: <215356.1647286703@sss.pgh.pa.us> In-Reply-To: From: Amit Langote Date: Fri, 1 Apr 2022 17:36:49 +0900 Message-ID: Subject: Re: generic plans and "initial" pruning To: David Rowley 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, Apr 1, 2022 at 5:20 PM David Rowley wrote: > 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. Will do, thanks. -- Amit Langote EDB: http://www.enterprisedb.com