spiraldb / vortex

An extensible, state-of-the-art columnar file format
https://vortex.dev
Apache License 2.0
989 stars 27 forks source link

Experiment with always computing is_constant #1411

Open gatesn opened 1 day ago

gatesn commented 1 day ago

We optimize for this fast-path so much, that it's probably worth computing is_constant with a short-circuiting statistics accumulator, i.e. bail as soon as we know it to be false.

We can then change ArrayData::is_constant and ArrayData::as_constant to always compute.

We may well want to lazily proxy ArrayView stats through a mutable object, although worth checking the cache hits on this one since ArrayView children are always constructed every time they are accessed.