Assorted style changes with a tiny improvement

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Assorted style changes with a tiny improvement
Date: 2024-07-02 17:39:20
Message-ID: CAEudQAqup0agbSzMjSLSTn=OANyCzxENF1+HrSYnr3WyZib7=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

This is a series of patches to change styles, in assorted sources.
IMO, this improves a tiny bit and is worth trying.

1. Avoid dereference iss_SortSupport if it has nulls.
2. Avoid dereference plan_node_id if no dsm area.
3. Avoid dereference spill partitions if zero ntuples.
4. Avoid possible useless palloc call with zero size.
5. Avoid redundant variable initialization in foreign.
6. Check the cheap test first in ExecMain.
7. Check the cheap test first in pathkeys.
8. Delay possible expensive bms_is_empty call in sub_select.
9. Reduce some scope in execPartition.
10. Reduce some scope for TupleDescAttr array dereference.
11. Remove useless duplicate test in ruleutils.
This is already checked at line 4566.

12. Remove useless duplicate test in string_utils.
This is already checked at line 982.

best regards,
Ranier Vilela

Attachment Content-Type Size
avoid-dereference-iss_SortSupport-array-if-has-nulls.patch application/octet-stream 754 bytes
avoid-dereference-plan_node_id-if-no-dsm-area.patch application/octet-stream 908 bytes
avoid-dereference-spill-partitions-if-zero-ntuples.patch application/octet-stream 727 bytes
avoid-possible-useless-palloc-call-with-zero-size-execGrouping.patch application/octet-stream 659 bytes
avoid-redundant-variable-initialization-foreign.patch application/octet-stream 500 bytes
check-cheap-test-first-execMain.patch application/octet-stream 660 bytes
check-cheap-test-first-pathkeys.patch application/octet-stream 763 bytes
delay-possible-expensive-bms_is_empty_call.patch application/octet-stream 948 bytes
reduce-some-scope-execPartition.patch application/octet-stream 800 bytes
reduce-some-scope-for-tupleDescAttr.patch application/octet-stream 2.8 KB
remove-useless-duplicate-test-ruleutils.patch application/octet-stream 589 bytes
remove-useless-duplicate-test-string_utils.patch application/octet-stream 565 bytes

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-07-02 17:40:38 Re: On disable_cost
Previous Message Hannu Krosing 2024-07-02 17:37:35 Re: What is a typical precision of gettimeofday()?