forked from ydb-platform/ydb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bloom ngramms speed up (ydb-platform#12982)
- Loading branch information
1 parent
24d1f57
commit 2f62452
Showing
28 changed files
with
345 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
ydb/core/tx/columnshard/engines/storage/indexes/bloom_ngramm/const.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "const.h" | ||
|
||
#include <util/string/builder.h> | ||
|
||
namespace NKikimr::NOlap::NIndexes::NBloomNGramm { | ||
|
||
TString TConstants::GetHashesCountIntervalString() { | ||
return TStringBuilder() << "[" << MinHashesCount << ", " << MaxHashesCount << "]"; | ||
} | ||
|
||
TString TConstants::GetFilterSizeBytesIntervalString() { | ||
return TStringBuilder() << "[" << MinFilterSizeBytes << ", " << MaxFilterSizeBytes << "]"; | ||
} | ||
|
||
TString TConstants::GetNGrammSizeIntervalString() { | ||
return TStringBuilder() << "[" << MinNGrammSize << ", " << MaxNGrammSize << "]"; | ||
} | ||
|
||
} // namespace NKikimr::NOlap::NIndexes::NBloomNGramm |
31 changes: 31 additions & 0 deletions
31
ydb/core/tx/columnshard/engines/storage/indexes/bloom_ngramm/const.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
#include <ydb/core/tx/columnshard/engines/scheme/indexes/abstract/constructor.h> | ||
namespace NKikimr::NOlap::NIndexes::NBloomNGramm { | ||
|
||
class TConstants { | ||
public: | ||
static constexpr ui32 MinNGrammSize = 3; | ||
static constexpr ui32 MaxNGrammSize = 8; | ||
static constexpr ui32 MinHashesCount = 1; | ||
static constexpr ui32 MaxHashesCount = 8; | ||
static constexpr ui32 MinFilterSizeBytes = 128; | ||
static constexpr ui32 MaxFilterSizeBytes = 1 << 20; | ||
|
||
static bool CheckNGrammSize(const ui32 value) { | ||
return MinNGrammSize <= value && value <= MaxNGrammSize; | ||
} | ||
|
||
static bool CheckHashesCount(const ui32 value) { | ||
return MinHashesCount <= value && value <= MaxHashesCount; | ||
} | ||
|
||
static bool CheckFilterSizeBytes(const ui32 value) { | ||
return MinFilterSizeBytes <= value && value <= MaxFilterSizeBytes; | ||
} | ||
|
||
static TString GetHashesCountIntervalString(); | ||
static TString GetFilterSizeBytesIntervalString(); | ||
static TString GetNGrammSizeIntervalString(); | ||
}; | ||
|
||
} // namespace NKikimr::NOlap::NIndexes::NBloomNGramm |
Oops, something went wrong.