Re: Some optimizations for COALESCE expressions during constant folding
Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
From: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-25T12:59:07Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Teach expr_is_nonnullable() to handle more expression types
- c8d2f68cc800 19 (unreleased) landed
-
Optimize ROW(...) IS [NOT] NULL using non-nullable fields
- cb7b7ec7a1c6 19 (unreleased) landed
-
Simplify COALESCE expressions using non-nullable arguments
- 10c4fe074a92 19 (unreleased) landed
Richard Guo <guofenglinux@gmail.com> writes:
> + ListCell *lc;
> +
> + foreach(lc, coalesceexpr->args)
> + {
> + Node *coalescearg = (Node *) lfirst(lc);
I have no comment on the rest of the patch, but this could be simplifed
using the foreach_ptr macro:
foreach_ptr(Node, coalescearg, coalesceexpr->args)
{
- ilmari