Datum is general, but not optimized for performance.
In vectorized engine, vtype is a column batch which contain values of the same type(int2, float4 etc.). If we store it as native type, it could:
- accelerate scan for column store.
- remove XXXGetDatum and DatumGetXXX cost.
Konstantin wrote:
Will it be more efficient to use native arrays in vtype instead of array of Datum? I think it will allow compiler to generate more efficient code for operations with float4 and int32 types.