Skip to content

Incorrect "total" value in search in nested index #215

@eguguchkin

Description

@eguguchkin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions