Skip to content

MB-70410: [BP] Simplify CoalesceQueue in hierarchical nested search#2284

Merged
CascadingRadium merged 1 commit into8.0.x-couchbasefrom
cq_bp
Feb 3, 2026
Merged

MB-70410: [BP] Simplify CoalesceQueue in hierarchical nested search#2284
CascadingRadium merged 1 commit into8.0.x-couchbasefrom
cq_bp

Conversation

@CascadingRadium
Copy link
Member

  • Simplifies the CoalesceQueue used in nested conjunction search by moving coalescing from enqueue to dequeue. This removes the separate map and reduces memory use while keeping behavior the same.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies the CoalesceQueue implementation used in nested conjunction search by refactoring when duplicate document matches are coalesced. Instead of maintaining a separate map and coalescing at enqueue time, the new implementation defers coalescing to dequeue time after sorting, reducing memory usage while preserving the same behavior.

Changes:

  • Removed the items map from CoalesceQueue structure to reduce memory overhead
  • Simplified Enqueue to just append items without checking for duplicates
  • Updated Dequeue to merge consecutive duplicates after sorting
  • Removed error handling from Enqueue and Dequeue methods as it's no longer needed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@CascadingRadium CascadingRadium merged commit 9a207fc into 8.0.x-couchbase Feb 3, 2026
15 checks passed
@CascadingRadium CascadingRadium deleted the cq_bp branch February 3, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments