File tree 3 files changed +15
-17
lines changed
ydb/core/tx/columnshard/engines/reader/common_reader/iterator
3 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,15 @@ class TColumnsSetIds {
85
85
}
86
86
return result;
87
87
}
88
+
89
+ TColumnsSetIds& operator +=(const TColumnsSetIds& external) {
90
+ return (*this = *this + external);
91
+ }
92
+
93
+ TColumnsSetIds& operator -=(const TColumnsSetIds& external) {
94
+ return (*this = *this - external);
95
+ }
96
+
88
97
bool IsEmpty () const {
89
98
return ColumnIds.empty ();
90
99
}
Original file line number Diff line number Diff line change @@ -75,10 +75,10 @@ void TAllocateMemoryStep::TFetchingStepAllocation::DoOnAllocationImpossible(cons
75
75
76
76
TConclusion<bool > TAllocateMemoryStep::DoExecuteInplace (const std::shared_ptr<IDataSource>& source, const TFetchingScriptCursor& step) const {
77
77
ui64 size = PredefinedSize.value_or (0 );
78
- for (auto && i : Packs ) {
79
- ui32 sizeLocal = source->GetColumnsVolume (i. GetColumns (). GetColumnIds (), i. GetMemType ( ));
80
- if (source->GetStageData ().GetUseFilter () && i. GetMemType ( ) != EMemType::Blob && source-> GetContext ()-> GetReadMetadata ()-> HasLimit () &&
81
- (HasAppData () && !AppDataVerified ().ColumnShardConfig .GetUseSlicesFilter ())) {
78
+ for (auto && [memType, columns] : ColumnsByMemType ) {
79
+ ui32 sizeLocal = source->GetColumnsVolume (columns. GetColumnIds (), static_cast <EMemType>(memType ));
80
+ if (source->GetStageData ().GetUseFilter () && static_cast <EMemType>(memType ) != EMemType::Blob &&
81
+ source-> GetContext ()-> GetReadMetadata ()-> HasLimit () && (HasAppData () && !AppDataVerified ().ColumnShardConfig .GetUseSlicesFilter ())) {
82
82
const ui32 filtered =
83
83
source->GetStageData ().GetFilteredCount (source->GetRecordsCount (), source->GetContext ()->GetReadMetadata ()->GetLimitRobust ());
84
84
if (filtered < source->GetRecordsCount ()) {
Original file line number Diff line number Diff line change @@ -8,18 +8,7 @@ namespace NKikimr::NOlap::NReader::NCommon {
8
8
class TAllocateMemoryStep : public IFetchingStep {
9
9
private:
10
10
using TBase = IFetchingStep;
11
- class TColumnsPack {
12
- private:
13
- YDB_READONLY_DEF (TColumnsSetIds, Columns);
14
- YDB_READONLY (EMemType, MemType, EMemType::Blob);
15
-
16
- public:
17
- TColumnsPack (const TColumnsSetIds& columns, const EMemType memType)
18
- : Columns(columns)
19
- , MemType(memType) {
20
- }
21
- };
22
- std::vector<TColumnsPack> Packs;
11
+ THashMap<ui32, TColumnsSetIds> ColumnsByMemType;
23
12
const EStageFeaturesIndexes StageIndex;
24
13
const std::optional<ui64> PredefinedSize;
25
14
@@ -50,7 +39,7 @@ class TAllocateMemoryStep: public IFetchingStep {
50
39
if (!ids.GetColumnsCount ()) {
51
40
return ;
52
41
}
53
- Packs. emplace_back (ids, memType) ;
42
+ ColumnsByMemType[(ui32)memType] += ids ;
54
43
}
55
44
EStageFeaturesIndexes GetStage () const {
56
45
return StageIndex;
You can’t perform that action at this time.
0 commit comments