Redundant restriction checks in apply_child_basequals - Mailing list pgsql-hackers

From Richard Guo
Subject Redundant restriction checks in apply_child_basequals
Date
Msg-id CAMbWs4-vLmGXaUEZyOMacN0BVfqWCt2tM-eDVWdDfJnOQaauGg@mail.gmail.com
Whole thread Raw
List pgsql-hackers
While working on bug #19412 [1], I noticed $subject.  For each child
qual translated from a parent rel's qual, apply_child_basequals calls
eval_const_expressions to simplify it, and then calls
restriction_is_always_false and restriction_is_always_true immediately
afterward to reduce NullTest expressions.  Since the planner performs
NullTest deduction during constant folding, I think the call to
restriction_is_always_false and restriction_is_always_true is now
redundant and wastes CPU cycles.

Attached is a patch to remove them.

[1] https://postgr.es/m/19412-1d0318089b86859e@postgresql.org

- Richard

Attachment

pgsql-hackers by date:

Previous
From: Kirill Reshke
Date:
Subject: Re: add assertion for palloc in signal handlers
Next
From: Jim Jones
Date:
Subject: Re: WIP - xmlvalidate implementation from TODO list