Hi,
Both build_simple_rel() and build_join_rel() allocate RelOptInfo using
makeNode(), which returned a zeroed out memory. The functions then
assign values like false, NULL, 0 or NIL which essentially contain
zero valued bytes. This looks like needless work. So, we are spending
some CPU cycles unnecessarily in those assignments. That may not be
much time wasted, but whenever someone adds a field to RelOptInfo,
those functions need to be updated with possibly a zero value
assignment. That looks like an unnecessary maintenance burden. Should
we just drop all those zero value assignments from there? If there's
any reason to have those assignments there, should we move the code to
allocate RelOptInfo and assign zero values to a separate function and
call it from those two functions? fetch_upper_rel() also has those
kinds of assignments, but they are far fewer than build_*_rel().

-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to