diff --git a/ydb/core/tx/columnshard/engines/reader/plain_reader/columns_set.h b/ydb/core/tx/columnshard/engines/reader/plain_reader/columns_set.h index 97fef7f317eb..0bca398204e2 100644 --- a/ydb/core/tx/columnshard/engines/reader/plain_reader/columns_set.h +++ b/ydb/core/tx/columnshard/engines/reader/plain_reader/columns_set.h @@ -106,6 +106,15 @@ class TColumnsSet { return true; } + bool Cross(const TColumnsSet& columnsSet) const { + for (auto&& i : columnsSet.ColumnIds) { + if (ColumnIds.contains(i)) { + return true; + } + } + return false; + } + bool IsEqual(const TColumnsSet& columnsSet) const { if (columnsSet.GetColumnIds().size() != ColumnIds.size()) { return false; diff --git a/ydb/core/tx/columnshard/engines/reader/plain_reader/context.cpp b/ydb/core/tx/columnshard/engines/reader/plain_reader/context.cpp index 8c42a191d6aa..930e91ad544d 100644 --- a/ydb/core/tx/columnshard/engines/reader/plain_reader/context.cpp +++ b/ydb/core/tx/columnshard/engines/reader/plain_reader/context.cpp @@ -51,7 +51,7 @@ std::shared_ptr TSpecialReadContext } } else if (exclusiveSource) { TColumnsSet columnsFetch = *EFColumns; - if (needSnapshots || FFColumns->Contains(SpecColumns)) { + if (needSnapshots || FFColumns->Cross(*SpecColumns)) { columnsFetch = columnsFetch + *SpecColumns; } if (partialUsageByPredicate) { @@ -60,7 +60,7 @@ std::shared_ptr TSpecialReadContext AFL_VERIFY(columnsFetch.GetColumnsCount()); current = current->AttachNext(std::make_shared(std::make_shared(columnsFetch), "ef")); - if (needSnapshots || FFColumns->Contains(SpecColumns)) { + if (needSnapshots || FFColumns->Cross(*SpecColumns)) { current = current->AttachNext(std::make_shared(SpecColumns)); current = current->AttachNext(std::make_shared()); columnsFetch = columnsFetch - *SpecColumns; diff --git a/ydb/core/tx/columnshard/engines/reader/plain_reader/context.h b/ydb/core/tx/columnshard/engines/reader/plain_reader/context.h index 17d52413e39c..ff6f17216642 100644 --- a/ydb/core/tx/columnshard/engines/reader/plain_reader/context.h +++ b/ydb/core/tx/columnshard/engines/reader/plain_reader/context.h @@ -23,9 +23,6 @@ class TSpecialReadContext { NIndexes::TIndexCheckerContainer IndexChecker; TReadMetadata::TConstPtr ReadMetadata; std::shared_ptr EmptyColumns = std::make_shared(); - std::shared_ptr PKFFColumns; - std::shared_ptr EFPKColumns; - std::shared_ptr FFMinusEFColumns; std::shared_ptr BuildColumnsFetchingPlan(const bool needSnapshotsFilter, const bool exclusiveSource, const bool partialUsageByPredicate) const; std::array, 2>, 2>, 2> CacheFetchingScripts; public: