Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ydb/core/tx/columnshard/counters/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ TScanCounters::TScanCounters(const TString& module)
, LinearScanIntervals(TBase::GetDeriviative("LinearScanIntervals"))
, LogScanRecords(TBase::GetDeriviative("LogScanRecords"))
, LogScanIntervals(TBase::GetDeriviative("LogScanIntervals"))
, NotIndexBlobs(TBase::GetDeriviative("Indexes/NoData/Count"))
, RecordsAcceptedByIndex(TBase::GetDeriviative("Indexes/Accepted/Records"))
, RecordsDeniedByIndex(TBase::GetDeriviative("Indexes/Denied/Records"))

, PortionBytes(TBase::GetDeriviative("PortionBytes"))
, FilterBytes(TBase::GetDeriviative("FilterBytes"))
Expand Down
16 changes: 16 additions & 0 deletions ydb/core/tx/columnshard/counters/scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,23 @@ class TScanCounters: public TCommonCountersOwner {
NMonitoring::THistogramPtr HistogramIntervalMemoryRequiredOnFail;
NMonitoring::THistogramPtr HistogramIntervalMemoryReduceSize;
NMonitoring::THistogramPtr HistogramIntervalMemoryRequiredAfterReduce;
NMonitoring::TDynamicCounters::TCounterPtr NotIndexBlobs;
NMonitoring::TDynamicCounters::TCounterPtr RecordsAcceptedByIndex;
NMonitoring::TDynamicCounters::TCounterPtr RecordsDeniedByIndex;

public:
void OnNotIndexBlobs() const {
NotIndexBlobs->Add(1);
}
void OnAcceptedByIndex(const ui32 recordsCount) const {
RecordsAcceptedByIndex->Add(recordsCount);
}
void OnDeniedByIndex(const ui32 recordsCount) const {
RecordsDeniedByIndex->Add(recordsCount);
}
NMonitoring::TDynamicCounters::TCounterPtr AcceptedByIndex;
NMonitoring::TDynamicCounters::TCounterPtr DeniedByIndex;


TScanIntervalStateGuard CreateIntervalStateGuard() const {
return TScanIntervalStateGuard(ScanIntervalState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ TConclusion<bool> TAllocateMemoryStep::DoExecuteInplace(const std::shared_ptr<ID
ui64 size = PredefinedSize.value_or(0);
for (auto&& i : Packs) {
ui32 sizeLocal = source->GetColumnsVolume(i.GetColumns().GetColumnIds(), i.GetMemType());
if (source->GetStageData().GetUseFilter() && i.GetMemType() != EMemType::Blob && source->GetContext()->GetReadMetadata()->HasLimit()) {
if (source->GetStageData().GetUseFilter() && i.GetMemType() != EMemType::Blob && source->GetContext()->GetReadMetadata()->HasLimit() &&
(HasAppData() && !AppDataVerified().ColumnShardConfig.GetUseSlicesFilter())) {
const ui32 filtered =
source->GetStageData().GetFilteredCount(source->GetRecordsCount(), source->GetContext()->GetReadMetadata()->GetLimitRobust());
if (filtered < source->GetRecordsCount()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class TFilterProgramStep: public IFetchingStep {
public:
virtual TConclusion<bool> DoExecuteInplace(const std::shared_ptr<IDataSource>& source, const TFetchingScriptCursor& step) const override;
TFilterProgramStep(const std::shared_ptr<NSsa::TProgramStep>& step)
: TBase("PROGRAM")
: TBase("EARLY_FILTER_STEP")
, Step(step) {
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void TPortionDataSource::DoAbort() {
void TPortionDataSource::DoApplyIndex(const NIndexes::TIndexCheckerContainer& indexChecker) {
THashMap<ui32, std::vector<TString>> indexBlobs;
std::set<ui32> indexIds = indexChecker->GetIndexIds();
// NActors::TLogContextGuard gLog = NActors::TLogContextBuilder::Build()("records_count", GetRecordsCount())("portion_id", Portion->GetAddress().DebugString());
// NActors::TLogContextGuard gLog = NActors::TLogContextBuilder::Build()("records_count", GetRecordsCount())("portion_id", Portion->GetPortionId());
std::vector<TPortionDataAccessor::TPage> pages = GetStageData().GetPortionAccessor().BuildPages();
NArrow::TColumnFilter constructor = NArrow::TColumnFilter::BuildAllowFilter();
for (auto&& p : pages) {
Expand All @@ -187,15 +187,18 @@ void TPortionDataSource::DoApplyIndex(const NIndexes::TIndexCheckerContainer& in
}
for (auto&& i : indexIds) {
if (!indexBlobs.contains(i)) {
GetContext()->GetCommonContext()->GetCounters().OnNotIndexBlobs();
return;
}
}
if (indexChecker->Check(indexBlobs)) {
NYDBTest::TControllers::GetColumnShardController()->OnIndexSelectProcessed(true);
constructor.Add(true, p.GetRecordsCount());
GetContext()->GetCommonContext()->GetCounters().OnAcceptedByIndex(p.GetRecordsCount());
} else {
NYDBTest::TControllers::GetColumnShardController()->OnIndexSelectProcessed(false);
constructor.Add(false, p.GetRecordsCount());
GetContext()->GetCommonContext()->GetCounters().OnDeniedByIndex(p.GetRecordsCount());
}
}
AFL_VERIFY(constructor.GetRecordsCountVerified() == Portion->GetRecordsCount());
Expand Down
Loading