From dfa6b408fea2f39d3403b4d044e558c16b6462c5 Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 26 May 2021 18:22:14 -0700 Subject: [PATCH] Improve comments of iterate_upper_bound (#8331) Summary: ReadOptions.iterate_upper_bound's comment is confusing. Improve it. Pull Request resolved: https://github.com/facebook/rocksdb/pull/8331 Reviewed By: jay-zhuang Differential Revision: D28696635 fbshipit-source-id: 7d9fa6fd1642562572140998c89d434058db8dda --- include/rocksdb/options.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index d8cbc1156..1669997bd 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -1332,9 +1332,18 @@ struct ReadOptions { // "iterate_upper_bound" defines the extent up to which the forward iterator // can returns entries. Once the bound is reached, Valid() will be false. // "iterate_upper_bound" is exclusive ie the bound value is - // not a valid entry. If prefix_extractor is not null, the Seek target - // and iterate_upper_bound need to have the same prefix. - // This is because ordering is not guaranteed outside of prefix domain. + // not a valid entry. If prefix_extractor is not null: + // 1. If options.auto_prefix_mode = true, iterate_upper_bound will be used + // to infer whether prefix iterating (e.g. applying prefix bloom filter) + // can be used within RocksDB. This is done by comparing + // iterate_upper_bound with the seek key. + // 2. If options.auto_prefix_mode = false, iterate_upper_bound only takes + // effect if it shares the same prefix as the seek key. If + // iterate_upper_bound is outside the prefix of the seek key, then keys + // returned outside the prefix range will be undefined, just as if + // iterate_upper_bound = null. + // If iterate_upper_bound is not null, SeekToLast() will position the iterator + // at the first key smaller than iterate_upper_bound. // // Default: nullptr const Slice* iterate_upper_bound; -- GitLab