Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: xinwen@stu.scu.edu.cn, pgsql-bugs@lists.postgresql.org
Date: 2023-03-17T03:11:39Z
Lists: pgsql-bugs
Attachments
- slightly_neater_qual_is_pushdown_safe.patch (application/octet-stream) patch
On Fri, 17 Mar 2023 at 07:59, Tom Lane <tgl@sss.pgh.pa.us> wrote: > > David Rowley <dgrowleyml@gmail.com> writes: > > OK, patch attached. > > This looks good to me. As a matter of style, I'd capitalize the > enum constant names, but I think it's OK otherwise. Thanks. I had been doing a bit more work on it and it looks very slightly different from when you saw it. Agreed with the capitals in the enum values. I also found had to disallow subqueries in the WindowFunc. That required a subplan check inside find_window_run_conditions(). I kinda also wanted to do the attached so that the logic to push or not to push was more centralised. I just couldn't figure out exactly why we don't push down pseudoconstant quals, therefore, was unable to document that sufficiently in the header comment in qual_is_pushdown_safe(). I thought we might as well talk about that while on the topic as what I've just committed does not really take any measures to explain it. The attached patch is graded for the assistance of discussion only. David
Commits
-
Fix incorrect logic for determining safe WindowAgg run conditions
- 371e3daaa53d 15.3 landed
- eb7d043c9bba 16.0 landed
-
Teach planner and executor about monotonic window funcs
- 9d9c02ccd1ae 15.0 cited