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 1rpWaB-007ALN-5T for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2024 16:56:59 +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 1rpWa8-00HYba-Ef for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2024 16:56:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rpWa8-00HYbS-5F for pgsql-hackers@lists.postgresql.org; Wed, 27 Mar 2024 16:56:56 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rpWa0-006jg9-A6 for pgsql-hackers@postgresql.org; Wed, 27 Mar 2024 16:56:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 42RGum913320048; Wed, 27 Mar 2024 12:56:48 -0400 From: Tom Lane To: Vallimaharajan G cc: "pgsql-hackers" Subject: Re: Query Regarding frame options initialization in Window aggregate state In-reply-to: <18e7f2a5167.fe36253866818.977923893562469143@zohocorp.com> References: <18e7f2a5167.fe36253866818.977923893562469143@zohocorp.com> Comments: In-reply-to Vallimaharajan G message dated "Wed, 27 Mar 2024 14:37:43 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3320046.1711558608.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 27 Mar 2024 12:56:48 -0400 Message-ID: <3320047.1711558608@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Vallimaharajan G writes: > I am currently referring to the Postgres source code (psql (PostgreSQL) = 14.3) and came across a particular section related to window aggregate ini= tialization that has left me with a question. Specifically, I noticed a co= nditional case in the initialization of per aggregate (initialize_peraggre= gate in nodeWindowAgg.c) where the winstate frameOptions is being checked,= but it appears that frameOptions is not set before this conditional case. You are right, and that's a bug. It's not of major consequence --- it would just cause us to set up for moving-aggregate mode when we won't ever actually move the frame head -- but it's at least a little bit inefficient. While I'm looking at it, there's a pretty obvious typo in the adjacent comment: - * and collect the right set of fields from the pg_attribute entry. + * and collect the right set of fields from the pg_aggregate entry. regards, tom lane