Skip to content

Measure namespace overflow costs near the 16-bit limit before choosing wider ids or better overflow handling #2135

Done

Description

@bplatz

Summary

Under the default MostGranular split, BSBM 100M produces 5.7M distinct namespace prefixes. The 16-bit namespace table fills early in the import. After that, new prefixes go to the overflow namespace (0xFFFE), whose subjects carry their full IRI as the name:

  • 95.6% of imported subjects end up there.
  • So do 92% of the subjects created by later updates.

We have not measured what this costs. Lookup, indexing and query cost should be measured across the boundary before deciding whether to widen namespace ids or to improve overflow handling. Widening graph ids, which feat/pooled-named-graphs does, is a separate change and does not settle this question.

Observed (BSBM 100M, 26 GB N-Triples)

Distinct prefixes in the data: 5,709,283.

  • 5,691,957 are offer webpage IRIs (…/instances/dataFromVendorN/OfferN/, the value of bsbm:offerWebpage). Each ends in /, so the split makes the whole IRI the prefix with an empty local name: one namespace per offer. These IRIs only ever appear as objects.
  • The rest:
    • 8,514 host roots, such as http://www.ProducerN.com/.
    • 5,618 producer prefixes.
    • 2,896 vendor prefixes.
    • 289 rating-site prefixes.

Namespace table after import (every import): 65,534 codes, the highest 65,533. Of the 65,521 user codes:

  • about 54,200–54,300 went to offer webpage prefixes;
  • about 5,600 to producers;
  • about 5,500–5,600 to producer homepages;
  • 26–28 to vendors;
  • none to rating sites.

Subjects in OVERFLOW: 8.63M of 9.03M distinct subjects (95.6%). That covers every review and reviewer, and the offers of more than 2,860 vendors.

Updates: each 100-commit incremental build of the BSBM update stream adds 1,328 subjects. Of these, 1,223 (92%) land in namespace 65534, which has 80 forward packs.

Query cost (no baseline yet): with pending writes, explore Q10 spends about 80% of its time in novelty translation, mostly reverse dictionary lookups. Overflow subjects carry their full IRI, so overflow may be where the cost shows. This has not been measured against data that stays under the limit.

Proposed measurement

Run the same data below and above the boundary:

  • Controls: the same data imported with a coarser split mode that does not saturate the table, or synthetic data whose prefix count spans about 65K.
  • Costs to measure:
    • IRI → Sid and Sid → IRI lookups, for persisted data and for novelty.
    • Dictionary sizes.
    • Import time.
    • Incremental build time, broken down into dictionary updates and forward packs.
    • Query time, with and without pending writes.

Then choose between the options:

  • wider namespace ids;
  • better overflow handling, for example a partitioned overflow namespace;
  • a split rule for IRIs ending in a delimiter;
  • frequency-ordered allocation at import.

Related

Activity

  1. added
    P2
    area:storage
    performance
    on Oct 18, 2026
  2. bplatz commented on Nov 20, 2026

    @bplatz
    ContributorAuthor

    #2422 (merged into next 2026-11-19) splits new ledgers under NamedLocal: an IRI ending in a delimiter goes under the namespace before it. On BSBM 100M that removes the ~54,200 namespaces taken by offer-webpage IRIs, one each. Without them the dataset has about 17,300 prefixes, which fit in the table.

    Remaining:

    • measure a BSBM 100M import under NamedLocal against MostGranular;
    • decide whether to widen namespace ids. That's a format change, so it happens in v5 or waits for a later format bump.
  3. added this to the 5.0.0 milestone on Nov 20, 2026
  4. bplatz commented on Nov 23, 2026

    @bplatz
    ContributorAuthor

    BSBM 100M fits in the namespace table under NamedLocal (#2422), across many runs since it merged.

    We're not widening namespace ids. No workload we know of still fills the table. Overflow remains the fallback for the shapes NamedLocal doesn't cover: IRIs whose last segment is unique (urn:…:rev:<hash>), data with many distinct hosts, and write-heavy ledgers, which get no import preflight.

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

    P2area:storageperformance

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions