zhangh43 / vectorize_engine

Other
30 stars 6 forks source link

Using native type instead of datum to represent values in vtype #5

Open zhangh43 opened 4 years ago

zhangh43 commented 4 years ago

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:

  1. accelerate scan for column store.
  2. 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.