Remove redundant if-else in EXPLAIN by using ExplainPropertyText
Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
From: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
David Rowley <dgrowleyml@gmail.com>
Date: 2025-03-20T20:24:14Z
Lists: pgsql-hackers
Attachments
- v1-0001-Remove-redundant-if-else-in-EXPLAIN.patch (text/x-patch) patch v1-0001
Hi hackers, Thanks to David [0], we found that the if and else branches contained equivalent code. Since ExplainPropertyText already handles non-text formats, the extra condition is unnecessary. I reviewed other files related to EXPLAIN where similar patterns might exist, but this was the only instance I found. I’m attaching a patch with the fix. If anyone spots a similar case elsewhere, please let me know. [0]: https://www.postgresql.org/message-id/CAApHDvpq2gOt3gnzkd4Ud%3DwrT7YRGrF3zb29jgWzDsYEhETrOA%40mail.gmail.com -- Best regards, Ilia Evdokimov, Tantor Labs LLC.
Commits
-
Simplify EXPLAIN code for Memoize
- 00b52c3db66c 18.0 landed