Skip to content

Bound-object prefilters skip NumBig arena resolution for decimal/bigint constants #1328

Open

Description

@bplatz

Context

value_to_otype_okey (fluree-db-query/src/binary_scan.rs) resolves big numerics against the per-(graph, predicate) NumBig arena when given a numbig_ctx: Option<(GraphId, u32)>. The overlay-translation caller passes the context; the two bound-object prefilter callers pass None:

  • the bound-object scan prefilter (encode_bound_object_prefilter)
  • the batched-join bound-object encode path

So a query constant like ?s ex:budget 19.99 (typed xsd:decimal) cannot prefilter-encode to its (NUM_BIG_OVERFLOW, handle) key and falls back to post-decode equality checks, even though the predicate and graph are known at those call sites.

Proposal

Thread (g_id, p_id) through the prefilter call sites so bound decimal/overflow-integer constants resolve via find_numbig_handle. An arena miss means the constant matches no base row — which is itself a useful prefilter outcome (empty base scan, overlay-only check).

Low priority: post-decode equality is correct today; this is a scan-narrowing optimization for equality lookups on arena-keyed numerics.

Activity

  1. added
    enhancement
    on Jun 12, 2026
  2. added
    P3
    area:query
    on Aug 25, 2026
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

    P3area:queryenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions