Tuple conversion naming

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Tuple conversion naming
Date: 2018-10-02 06:11:56
Message-ID: 20181002061156.rujqtw73jnskq2qx@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

The naming around partition related tuple conversions is imo worthy of
improvement.

For building tuple conversion maps we have:
- convert_tuples_by_name
- convert_tuples_by_name_map
- convert_tuples_by_position
- ExecSetupChildParentMapForLeaf
- TupConvMapForLeaf
- free_conversion_map

I've a bunch of problems with this:
1) convert_tuples_by_name etc sound like they actually perform tuple
conversion, rather than just prepare for it
2) convert_tuples_by_name_map returns not TupleConversionMap, but an
array. But convert_tuples_by_name does return TupleConversionMap.
3) The naming is pretty inconsistent. free_conversion_map
vs. convert_tuples_by_name, but both deal with TupleConversionMap?

For executing them we have:
- do_convert_tuple
- ConvertPartitionTupleSlot

which is two randomly differing spellings of related functionality,
without the name indicating that they, for reasons, don't both use
TupleConversionMap. I'm also not particularly happy about
"do_convert_tuple", which is a pretty generic name.

A lot of this probably made sense at some time, but we got to clean this
up. We'll grow more partitioning related code, and this IMO makes
reading the code harder - and given the change rate, that's something I
frequently have to do.

Greetings,

Andres Freund

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2018-10-02 06:25:17 Re: [HACKERS] Transactions involving multiple postgres foreign servers, take 2
Previous Message Michael Paquier 2018-10-02 06:10:44 Re: [HACKERS] Transactions involving multiple postgres foreign servers, take 2