(try to) avoid (expensive) var-heap re-creation with MATproject:
(try to) avoid (expensive) var-heap re-creation with MATproject:

Mitosis-pieces are usually slices (views) of a base table/BAT.
For variable-size atoms, this means that the vheap's of all pieces are
likely to be identical (full) views of the same original base-BAT vheap.
If so, the result of MATproject can also simply be a view of that very
original base-BAT vheap (rather than a new view with all value (re-)inserted),
i.e., we only need to build the result's tail BUN heap by copying the
pointers (references) into the vheap from the input BATs (pieces).

This can speed up any projection to, e.g., str columns considerably,
and likewise reduce the memory/storage footprint.

(Sorry, no rhyme, but still a Sinterklaas present ...;-))
(This is one of the benefits of using MonetDB for the Sinterklaas challenge ...)

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb