Speedup metabase search #1685
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1685
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After moving to the new metabase, container search by unindexed attributes scales linearly with the number of objects. While we cannot change the asymptotics, we can significantly reduce the constant factor. The work was already started in #1683. Other things to explore:
selectFastFilter
is called like this:So, for each filter we fetch every object. The number of matched filters is then used to check whether all filters have matched. We might reorder the loops: iterate over objects and then over filters. It enables 3 further optimizations: (1) accumulate in
mAddr
only objects that match, (2) read each object exactly once, IO is expensive and (3) do not usemAddr
at all, process each object immediately.Cache buckets. I have explored this idea once, but for
Get
the complexity it has introduced wasn't justifiable. ForSelect
the situation is better,tx.Bucket
can be clearly seen in profile. The idea is to cache buckets that are accessed frequently, such as allobjectStatus()
buckets:primary
,graveyard
etc. Then all functions retrieve these buckets from cache. The lifetime of this cache is contained in the lifetime of the transaction.To filter attributes, we do not need to unmarshal object. Just use https://github.com/VictoriaMetrics/easyproto to traverse byte slice without allocations and only unmarshal object on filter match.