Skip to content

Commit

Permalink
dont create delete flag column in indexation
Browse files Browse the repository at this point in the history
if it is not necessary
  • Loading branch information
ivanmorozov333 committed Jul 25, 2024
1 parent 0662944 commit c94e8b1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ydb/core/tx/columnshard/engines/changes/indexation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ TConclusionStatus TInsertColumnEngineChanges::DoConstructBlobs(TConstructionCont
auto blobSchema = context.SchemaVersions.GetSchemaVerified(inserted.GetSchemaVersion());
std::vector<ui32> filteredIds = inserted.GetMeta().GetSchemaSubset().Apply(blobSchema->GetIndexInfo().GetColumnIds(true));
usageColumnIds.insert(filteredIds.begin(), filteredIds.end());
if (inserted.GetMeta().GetModificationType() == NEvWrite::EModificationType::Delete) {
usageColumnIds.emplace((ui32)IIndexInfo::ESpecialColumn::DELETE_FLAG);
}
if (usageColumnIds.size() == resultSchema->GetIndexInfo().GetColumnIds(true).size()) {
break;
}
Expand All @@ -179,8 +182,10 @@ TConclusionStatus TInsertColumnEngineChanges::DoConstructBlobs(TConstructionCont
}

IIndexInfo::AddSnapshotColumns(*batch, inserted.GetSnapshot());
IIndexInfo::AddDeleteFlagsColumn(*batch, inserted.GetMeta().GetModificationType() == NEvWrite::EModificationType::Delete);
usageColumnIds.insert(IIndexInfo::GetSystemColumnIds().begin(), IIndexInfo::GetSystemColumnIds().end());
if (usageColumnIds.contains((ui32)IIndexInfo::ESpecialColumn::DELETE_FLAG)) {
IIndexInfo::AddDeleteFlagsColumn(*batch, inserted.GetMeta().GetModificationType() == NEvWrite::EModificationType::Delete);
}
usageColumnIds.insert(IIndexInfo::GetSnapshotColumnIds().begin(), IIndexInfo::GetSnapshotColumnIds().end());

batch = resultSchema->NormalizeBatch(*blobSchema, batch, usageColumnIds).DetachResult();
pathBatches.Add(inserted, shardingFilterCommit, batch);
Expand Down

0 comments on commit c94e8b1

Please sign in to comment.