Re: GROUP BY ROLLUP queries on views trigger full table scans (index usage not optimized) - Mailing list pgsql-bugs

From Richard Guo
Subject Re: GROUP BY ROLLUP queries on views trigger full table scans (index usage not optimized)
Date
Msg-id CAMbWs4-jteRUuZ63p3yyHG6=ggV9a3cNj_vMuYBrURhyXdMg_w@mail.gmail.com
Whole thread Raw
In response to Re: GROUP BY ROLLUP queries on views trigger full table scans (index usage not optimized)  (Richard Guo <guofenglinux@gmail.com>)
Responses Re: GROUP BY ROLLUP queries on views trigger full table scans (index usage not optimized)
List pgsql-bugs
On Mon, Dec 8, 2025 at 3:10 PM Richard Guo <guofenglinux@gmail.com> wrote:
> As a viable alternative, maybe we can use a lightweight, read-only
> expression walker on the operand tree first to detect the presence of
> any PHVs.  We only trigger the expensive deep mutation if this
> preliminary check confirms that it is actually necessary.

Here is an updated patch along these lines.

Haowu, could you please verify if it fixes your query?

- Richard

Attachment

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #19095: Test if function exit() is used fail when linked static
Next
From: "Haowu Ge"
Date:
Subject: Re: GROUP BY ROLLUP queries on views trigger full table scans (index usage not optimized)