Skip to content

Performance: all-buckets checkpoint reads use inefficient negative filter (BucketId != :rb) #75

@AGiorgetti

Description

@AGiorgetti

Summary

The all-buckets checkpoint scan excludes the recycle bin via BucketId != :rb. Negative inequality filters are less index-friendly than positive inclusion filters and may bypass the primary checkpoint index, causing a measurable gap vs bucket-qualified reads.

Why this matters

  • Negative filters (!=) are less index-friendly than positive inclusion.
  • Bucket-qualified reads use the primary checkpoint index; all-buckets reads may bypass it.
  • The performance gap is already visible in benchmarks: ~3× slower than bucket-qualified reads.

Baseline (net10, 2026-05-20)

Benchmark Mean
ReadFromBucketCheckpoint(CommitsPerBucket=1000, ExtraBuckets=3) 22.142 ms
ReadFromAllBucketsCheckpoint(CommitsPerBucket=1000, ExtraBuckets=3) 67.011 ms

Ratio: all-buckets is ~3× slower than bucket-qualified.

Proposed investigation

  • Run MongoDB explain() on both queries and compare index usage.
  • Determine whether the gap is from the negative filter, a missing index, or COLLSCAN.
  • Evaluate replacing the negative filter with an explicit bucket-inclusion strategy or a dedicated index.

Reference

See docs/Performance-Investigation.md → Finding #3 for full context.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions