]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Some further cleanup in WriteBatchWithIndex::MultiGetFromBatchAndDB (#12143)
authorLevi Tamasi <ltamasi@meta.com>
Thu, 14 Dec 2023 01:34:18 +0000 (17:34 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 14 Dec 2023 01:34:18 +0000 (17:34 -0800)
commitcd21e4e69d76ec4ec3b080c8cdae016ac2309cc5
tree85d177b077ef5a63e9dc9423f0e6bb457d961154
parentc74531b1d291985d3c1c6d074a771d81cab48658
Some further cleanup in WriteBatchWithIndex::MultiGetFromBatchAndDB (#12143)

Summary:
Pull Request resolved: https://github.com/facebook/rocksdb/pull/12143

https://github.com/facebook/rocksdb/pull/11982 changed `WriteBatchWithIndex::MultiGetFromBatchDB` to preallocate space in the `autovector`s `key_contexts` and `merges` in order to prevent any reallocations, both as an optimization and in order to prevent pointers into the container from being invalidated during subsequent insertions. On second thought, this preallocation can actually be a pessimization in cases when only a small subset of keys require querying the underlying database. To prevent any memory regressions, the PR reverts this preallocation. In addition, it makes some small code hygiene improvements like incorporating the `PinnableWideColumns` object into `MergeTuple`.

Reviewed By: jaykorean

Differential Revision: D52136513

fbshipit-source-id: 21aa835084433feab27b501d9d1fc5434acea609
utilities/write_batch_with_index/write_batch_with_index.cc