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 1p3Yk2-0006x2-FA for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Dec 2022 08:28:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p3Yj2-0004hk-I3 for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Dec 2022 08:27:20 +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 1p3Yj2-0004hZ-7Q for pgsql-hackers@lists.postgresql.org; Fri, 09 Dec 2022 08:27:20 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p3Yiz-00074h-1v for pgsql-hackers@postgresql.org; Fri, 09 Dec 2022 08:27:19 +0000 Received: by mail-pl1-x62b.google.com with SMTP id p24so4188392plw.1 for ; Fri, 09 Dec 2022 00:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=MLQ32E5i0XudVn77/5rlssp4aLQAa1eseAkVn8vyhWM=; b=iSLEFjxZcyiq2LI6i2LhC602269ZTJZkTRQaPTfEyR6um8ldgGnFeX0HMPNa6PKTPS dMw9ubrOoZ6Cv4SMgqw5ZPx4Iln+0LBeWhnXJ0ukmnCma0Thma67DaAb7PrWG9r7neXm glOwEKHRElPNkQXzYbZqvAR7yxuQemIuSK8XECbRxy+n3KIO2OyXmZcvvGG9/KC1KA9T DmspAmXFAFxbm3Fczn7Aqg6hLo3T5A1OKazWSOhnd7c8/wBH1ZL3SQyc7Tb50eqrS9FT hQdVDC+HVkfuVUlBgwgnaBEd/zUvPHFGeaITkhJXtEWGoxJbAJBpX3cMtWC2lB2P5M26 CUMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MLQ32E5i0XudVn77/5rlssp4aLQAa1eseAkVn8vyhWM=; b=4FOF0VLOQpzXpablR6vz8Ry+yzj035ZZIzwQ5t2ysxZTeemZl6rmsKTmCQUQMMcvwl r60IWD9hxcAAwKXPqfc/1dDotAigdXQhDe6graMWWvL1m/gd/NmAgLxJYMfKIIWGawiC YFjWsSF2cvvknFctjHAEWn8Fby2yq5mfTHTPInWvkpk28V+vGbLUYDftWrebset5qjdj RhHcuBZy60zsl9acimDHtC8OV7WLhXFz7gPMOwm4QYznbl+3DhOQReXnbnRU2LjxDBgX CINubGl5diHq0asKHCNOj4phEJzOYBC0PSLtraE/xOgCJVcJZfcgPTqJvyTWP7oYI3EE w2dQ== X-Gm-Message-State: ANoB5plfMfSbQj5tWPCMQDzdMJRsnqlNizSNltwwEOisEe5I5LyZp4Qq NRCv2AEwpIWcb4NTE0D7mE6q3SDsSvYovswZj0c= X-Google-Smtp-Source: AA0mqf4BnzfMw6GeKnYq9wRp25AIekWnRVqSXMkg8MQMCb7auoX4l3D1e2/OTCbVpmc01yaiczsi18RnWFx/GFN3Llo= X-Received: by 2002:a17:902:b68d:b0:189:ab77:d07 with SMTP id c13-20020a170902b68d00b00189ab770d07mr37794265pls.53.1670574435805; Fri, 09 Dec 2022 00:27:15 -0800 (PST) MIME-Version: 1.0 References: <20221206190033.mr5fiucsj4izhc6k@alvherre.pgsql> In-Reply-To: <20221206190033.mr5fiucsj4izhc6k@alvherre.pgsql> From: Amit Langote Date: Fri, 9 Dec 2022 17:26:59 +0900 Message-ID: Subject: Re: generic plans and "initial" pruning To: Alvaro Herrera Cc: Robert Haas , Jacob Champion , David Rowley , 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 Thanks for the review. On Wed, Dec 7, 2022 at 4:00 AM Alvaro Herrera wrote: > I find the API of GetCachedPlans a little weird after this patch. I > think it may be better to have it return a pointer of a new struct -- > one that contains both the CachedPlan pointer and the list of pruning > results. (As I understand, the sole caller that isn't interested in the > pruning results, SPI_plan_get_cached_plan, can be explained by the fact > that it knows there won't be any. So I don't think we need to worry > about this case?) David, in his Apr 7 reply on this thread, also sounded to suggest something similar. Hmm, I was / am not so sure if GetCachedPlan() should return something that is not CachedPlan. An idea I had today was to replace the part_prune_results_list output List parameter with, say, QueryInitPruningResult, or something like that and put the current list into that struct. Was looking at QueryEnvironment to come up with *that* name. Any thoughts? > And I think you should make that struct also be the last argument of > PortalDefineQuery, so you don't need the separate > PortalStorePartitionPruneResults function -- because as far as I can > tell, the callers that pass a non-NULL pointer there are the exactly > same that later call PortalStorePartitionPruneResults. Yes, it would be better to not need PortalStorePartitionPruneResults. -- Thanks, Amit Langote EDB: http://www.enterprisedb.com