]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Avoid per-key linear scan over snapshots in compaction (#4495)
authorAndrew Kryczka <andrewkr@fb.com>
Mon, 15 Oct 2018 23:18:55 +0000 (16:18 -0700)
committerAndrew Kryczka <andrewkr@fb.com>
Tue, 16 Oct 2018 17:33:02 +0000 (10:33 -0700)
commitab21dc6323cc7b41e3c495ae61e69752e9b233de
tree1e7f2c4a6f0d6da14547ff4d2935e13497355dce
parentfa37825fce7be9928ab31e12c1ef64fdd737f155
Avoid per-key linear scan over snapshots in compaction (#4495)

Summary:
`CompactionIterator::snapshots_` is ordered by ascending seqnum, just like `DBImpl`'s linked list of snapshots from which it was copied. This PR exploits this ordering to make `findEarliestVisibleSnapshot` do binary search rather than linear scan. This can make flush/compaction significantly faster when many snapshots exist since that function is called on every single key.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4495

Differential Revision: D10386470

Pulled By: ajkr

fbshipit-source-id: 29734991631227b6b7b677e156ac567690118a8b
HISTORY.md
db/compaction_iterator.cc