Hi, In [1] , it was shown that the partition tuples are needlessly formed and deformed during tuple conversion (do_convert_tuple), when the same operation can be done using tuple slots. This is because the input slot might already have a deformed tuple.
Attached is a patch tup_convert.patch that does the conversion directly using input and output tuple slots. This patch is to be applied on an essential patch posted by Amit Langote in [1] that arranges for dedicated per-partition slots rather than changing tupdesc of a single slot. I have rebased that patch from [1] and attached it here ( Allocate-dedicated-slots-of-partition-tuple_amitlan_rebased.patch). In tup_convert.patch, wherever ConvertPartitionTupleSlot() and do_convert_tuple() are used to convert partition tuples, I have replaced them by a new function ConvertTupleSlot(). ConvertPartitionTupleSlot() is exclusively for conversion of partition-to-parent and vice versa, so I got rid of this. do_convert_tuple() seems to be used for tuples belonging to non-partition tables as well, so I have left such calls untouched. May be we can "slotify" these tuple conversions later as a separate task. [1] https://www.postgresql.org/message-id/e4f9d743-cd4b-efb0-7574-da21d86a7f36%40lab.ntt.co.jp -- Thanks, -Amit Khandekar EnterpriseDB Corporation The Postgres Database Company
tup_convert.patch
Description: Binary data
Allocate-dedicated-slots-of-partition-tuple_amitlan_rebased.patch
Description: Binary data