Incorrect "total" value in search in nested index
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 131
- Forks
- 16
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 11
Description
We have deduplication for list of IDS
if total == 0 || lastID != id { // lids increase monotonically, it's enough to compare current id with the last one
ids = append(ids, seq.IDSource{ID: id})
}
lastID = id
But we didn't have it for total calculation. To use deduplication logic, we need to convert LID to seq.ID, this requires reading MIDs and RIDs blocks from disk, which slows down the query.
An additional problem is that in the context of performing a search, we have no information that a nested index is involved in the search, and we cannot decide to take the more expensive branch for the "total".
See iterateEvalTree() function in frac/processor/search.go
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with iterateEvalTree() in frac/processor/search.go and trace how total is calculated versus the existing deduplication of IDs. Done means nested-index searches report a deduplicated total while accounting for the additional disk reads required to convert LIDs to seq.IDs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- databases, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100