Summary
ray_vec_is_null is 13.28% of samples in a profile of our service, called
from the join build and probe paths (join_count_fn, join_fill_fn) — every
key column of every row is tested for null on every join.
The engine already tracks whether a column has nulls: the index routing table
disqualifies .idx.hash on HAS_NULLS columns and falls back to a scan, so
the flag is consulted elsewhere. The join path appears not to consult it.
What we are asking for
When a join key column's HAS_NULLS flag is clear, skip the per-element null
test in the join's build and probe loops. No new API, no new attribute — the
information is already there, and 13% of our CPU is spent rediscovering it one
element at a time.
If the flag is not maintained precisely enough to be trusted at that site, the
alternative is an explicit column attribute (.attr.set 'not-null) that a
caller can assert, with the usual fallback contract.
Context
Our join keys are venue and instrument symbol columns on a market-data
book table. They are structurally never null — a row without an instrument
could not have been ingested — but there is no way to say so, and no way to
stop paying for the check.
This is the cheapest of the three requests we are opening; the other two are
the join sites in the index routing table, and a join form that returns a row
selection instead of a materialised table.
Measured on rayforce 2.6.2 (the build carrying bc350ddc).
Summary
ray_vec_is_nullis 13.28% of samples in a profile of our service, calledfrom the join build and probe paths (
join_count_fn,join_fill_fn) — everykey column of every row is tested for null on every join.
The engine already tracks whether a column has nulls: the index routing table
disqualifies
.idx.hashonHAS_NULLScolumns and falls back to a scan, sothe flag is consulted elsewhere. The join path appears not to consult it.
What we are asking for
When a join key column's
HAS_NULLSflag is clear, skip the per-element nulltest in the join's build and probe loops. No new API, no new attribute — the
information is already there, and 13% of our CPU is spent rediscovering it one
element at a time.
If the flag is not maintained precisely enough to be trusted at that site, the
alternative is an explicit column attribute (
.attr.set 'not-null) that acaller can assert, with the usual fallback contract.
Context
Our join keys are
venueandinstrumentsymbol columns on a market-databook table. They are structurally never null — a row without an instrument
could not have been ingested — but there is no way to say so, and no way to
stop paying for the check.
This is the cheapest of the three requests we are opening; the other two are
the join sites in the index routing table, and a join form that returns a row
selection instead of a materialised table.
Measured on
rayforce2.6.2 (the build carryingbc350ddc).