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.96) (envelope-from ) id 1vZtzC-000zBT-1D for pgsql-bugs@arkaria.postgresql.org; Sun, 28 Dec 2025 16:51:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vZtz9-00DlZh-2T for pgsql-bugs@arkaria.postgresql.org; Sun, 28 Dec 2025 16:51:16 +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.96) (envelope-from ) id 1vZtz9-00DlZZ-1b for pgsql-bugs@lists.postgresql.org; Sun, 28 Dec 2025 16:51:16 +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.96) (envelope-from ) id 1vZtz8-0032sH-1p for pgsql-bugs@lists.postgresql.org; Sun, 28 Dec 2025 16:51:15 +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 5BSGp3582509474; Sun, 28 Dec 2025 11:51:03 -0500 From: Tom Lane To: Richard Guo cc: Haowu Ge , pgsql-bugs Subject: Re: GROUP BY ROLLUP queries on views trigger full table scans (index usage not optimized) In-reply-to: References: <62af586c-c270-44f3-9c5e-02c81d537e3d.gehaowu@bitmoe.com> <7543464e-d2c6-4778-add0-31a6d60e58ce.gehaowu@bitmoe.com> <9e659ce0-da20-42ed-ada2-5f585a89677e.gehaowu@bitmoe.com> <0f894411-0d2c-4455-8403-f342642e49bc@bitmoe.com> Comments: In-reply-to Richard Guo message dated "Sun, 28 Dec 2025 13:20:58 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2509472.1766940663.1@sss.pgh.pa.us> Date: Sun, 28 Dec 2025 11:51:03 -0500 Message-ID: <2509473.1766940663@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > I've been back and forth on whether to back-patch these two patches to > v18, given that they can lead to plan changes. Yeah, typically we lean to not back-patching planning changes, for fear of de-optimizing queries that may have been tuned to the old behavior. However, in this case there is a mitigating factor: from the users' point of view v18's behavior is a regression. Affected queries that relied on indexes were fine in prior versions but now they fail to use the indexes. v18 is new enough that it seems unlikely that any applications have been tuned for its behavior; we should worry more about de-optimizing applications that haven't yet been brought forward. So here, I think the don't-break-things rule points towards back-patching. regards, tom lane