Skip to content

Skip join key null-checks on columns known null-free #597

Description

@vbmithr

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions