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 1naBHx-0004KZ-4y for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Apr 2022 07:01:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1naBHw-0007uJ-0j for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Apr 2022 07:01:40 +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 1naBHv-0007uA-Nv for pgsql-hackers@lists.postgresql.org; Fri, 01 Apr 2022 07:01:39 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1naBHt-0003yf-9z for pgsql-hackers@postgresql.org; Fri, 01 Apr 2022 07:01:38 +0000 Received: by mail-ej1-x634.google.com with SMTP id dr20so3858090ejc.6 for ; Fri, 01 Apr 2022 00:01:37 -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=4LtxAh6Q9QdvhMAA9mCmJCPCqUW1Jlu9tgYcmnPZDCk=; b=aWtuhLCsFlHtIO/oBKL+Jar2jigukC/qVk83jYORJkj9QOU2nG0UZJkATsJu+gF4yO RSbCLQq+zOfsaBzB8DQRxRGXgdFGBJsnCR19S17qqTrOiUHblVmQ/biqekG0gxU1s7j/ QxvTRlypcvZU+xuxzbALqGNY4T3fm4QMCYaayEpSG9bh7A6i9PEx5OFj1kEh+wwis9KK XANbpzCypksZwbq4DFpPjMIwWvCrVSosPn45GUgFV0IU2b99WBI/W8RSyGYjqGJvwJ2X gvde3K3YIZWQnRIgsX5PA06pWPhLHV3e/EDMYzlJ+xWR8eGniFfWgH8m+tga+hLbrDrg 5IwA== 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=4LtxAh6Q9QdvhMAA9mCmJCPCqUW1Jlu9tgYcmnPZDCk=; b=ukyeLCukEL/3G2pgjC5np7jNt9QPDe5aCsvA6XNjAiRg74XDnNzF9lUEKaepd5LXaR vzWxXag/tNc6UIiyLPIi5ALPdY5VIFzBnDWxKLt07k9KFRjg/39+p37uo/v5oDS+ZKu3 ox6GoybJbawGTaQpVqBO1WSkG8ug4L+pfMl0zT2+S5ye/Df6QGHlQwamt8RT66XHiD/X xsXDT2beTKh5du60cAdDNf2tH7eBDXitjw69KZqMvMoDq4GZVjgHZ2XkOB4n/Yv/JTT6 +mZKol5ZHBaxBLgGgDOkG7YM2Xr3sl3pHRYK1ApXMlbzlsNmx1oi+GM5LQCroHmC+xx2 XpVg== X-Gm-Message-State: AOAM5320G43PIqrCS3uLCp3Z6UG2eisFyz16h3uaNKvVjYbAdcWkOJ87 f4Lxk2GnSAJZYiLZ3BtUvCxqNZSpxgz1W7WR4eQ= X-Google-Smtp-Source: ABdhPJzXmkZY9AI3NcNsYLQN/PGOyXHg2Azapfju3akroUAMBye3L2iadBJCBeHeVtOfKvUCPuFdGIVhJDTPRymXDYI= X-Received: by 2002:a17:907:7f93:b0:6db:7634:f214 with SMTP id qk19-20020a1709077f9300b006db7634f214mr7975716ejc.3.1648796495301; Fri, 01 Apr 2022 00:01:35 -0700 (PDT) MIME-Version: 1.0 References: <215356.1647286703@sss.pgh.pa.us> <922566.1648784745@sss.pgh.pa.us> In-Reply-To: <922566.1648784745@sss.pgh.pa.us> From: Amit Langote Date: Fri, 1 Apr 2022 16:01:18 +0900 Message-ID: Subject: Re: generic plans and "initial" pruning To: Tom Lane Cc: David Rowley , Robert Haas , 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 12:45 PM Tom Lane wrote: > Amit Langote writes: > > On Fri, Apr 1, 2022 at 10:32 AM David Rowley wrote: > >> 1. You've changed the signature of various functions by adding > >> ExecLockRelsInfo *execlockrelsinfo. I'm wondering why you didn't just > >> put the ExecLockRelsInfo as a new field in PlannedStmt? > > > I'm worried about that churn myself and did consider this idea, though > > I couldn't shake the feeling that it's maybe wrong to put something in > > PlannedStmt that the planner itself doesn't produce. > > PlannedStmt is part of the plan tree, which MUST be read-only to > the executor. This is not negotiable. However, there's other > places that this data could be put, such as QueryDesc. > Or for that matter, couldn't the data structure be created by > the planner? (It looks like David is proposing exactly that > further down.) The data structure in question is for storing the results of performing initial partition pruning on a generic plan, which the proposes to do in plancache.c -- inside the body of AcquireExecutorLocks()'s loop over PlannedStmts -- so, it's hard to see it as a product of the planner. :-( -- Amit Langote EDB: http://www.enterprisedb.com