diff options
author | Aleksei Borzenkov <snaury@ydb.tech> | 2024-01-24 14:07:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-24 14:07:05 +0300 |
commit | 8a21d0ef87392fa85e5a188f96ff3aeddf6aa8da (patch) | |
tree | 981d085f9da49426a1b265304be37d33c99a09d4 | |
parent | 57fe79379c99052ac82abe634f114b8e765265a4 (diff) | |
download | ydb-8a21d0ef87392fa85e5a188f96ff3aeddf6aa8da.tar.gz |
Add range read border to key sampler KIKIMR-20859 (#1253)
-rw-r--r-- | ydb/core/tx/datashard/datashard__read_iterator.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ydb/core/tx/datashard/datashard__read_iterator.cpp b/ydb/core/tx/datashard/datashard__read_iterator.cpp index da99bb4cdc..928592a569 100644 --- a/ydb/core/tx/datashard/datashard__read_iterator.cpp +++ b/ydb/core/tx/datashard/datashard__read_iterator.cpp @@ -364,6 +364,16 @@ public: iterRange.MaxInclusive = toInclusive; const bool reverse = State.Reverse; + if (TArrayRef<const TCell> cells = keyFromCells.GetCells()) { + if (!fromInclusive || cells.size() >= TableInfo.KeyColumnTypes.size()) { + Self->GetKeyAccessSampler()->AddSample(TableId, cells); + } else { + TVector<TCell> extended(cells.begin(), cells.end()); + extended.resize(TableInfo.KeyColumnTypes.size()); + Self->GetKeyAccessSampler()->AddSample(TableId, extended); + } + } + EReadStatus result; if (!reverse) { auto iter = txc.DB.IterateRange(TableInfo.LocalTid, iterRange, State.Columns, State.ReadVersion, GetReadTxMap(), GetReadTxObserver()); |