db: avoid loading later files for a level in SeekPrefixGE
sumeerbhola opened this issue · comments
In levelIter.SeekPrefixGE
we do loadFileIndicator := l.loadFile(l.findFileGE(key, flags), +1)
which does not care about the prefix (in CockroachDB, these MVCCGet
iterators don't have bounds set), so can load an arbitrarily later file in the level. This is something we should optimize, since there could be gaps in levels which are causing us to unnecessarily load files. This is likely to be true for CockroachDB local keys, including locks and intents which we always try to read, since that part of the key space is very sparse.
(noticed due to cockroachdb/cockroach#123313 where we had a failed read of an AbortSpanKey due to slow shared storage file read, even though the AbortSpanKey is a replicated range-id local key, so will never be in a shared storage file)