I think that alignment is not the goal here, because the tuples themselves
are not aligned, as there is no padding at their end - e.g. if tuple's
size is 17 byte, all kind the first tuple will start at offset 0, the next
at 17 ...
a comment about the lack of padding:
https://github.com/apache/imp
I think it made more sense when we tried to pad the tuple so that slots
were aligned, since it reduced the amount of padding. But now we don't add
any padding the order of slots doesn't affect the tuple size. On amd64 I
don't think we've tended to see any real penalty from unaligned accesses -
it's
Though we don't require tuples to have any memory alignment based on the
comment in
https://github.com/apache/impala/blob/81d5377c27f1940235db332e43f1d0f073cf3d2f/be/src/runtime/tuple.h#L61-L63
, but I do believe we sort slots to get a packed and aligned memory layout
for the tuples in most cases.
why tuple memory need to be sorted by slot size? is has any optimize?