|
|
unsafe_unique_array< BitmaskTableEntry > | bitmask_table |
| uint16_t | one_count = 0 |
| | Analyze phase.
|
|
uint16_t | zero_count = 0 |
| | The amount of unset bits found.
|
|
uint16_t | run_count = 0 |
| | The amount of runs (of 0's) so far.
|
|
bool | last_bit_set |
| | Whether the last bit was set or not.
|
|
uint16_t | count = 0 |
| | The total amount of bits covered (one_count + zero_count).
|
| idx_t | data_size = 0 |
| | Flushed analyze data.
|
|
idx_t | metadata_size = 0 |
|
idx_t | segment_count = 0 |
| | The total amount of segments to write.
|
|
idx_t | current_count = 0 |
| | The amount of values in the current segment;.
|
|
idx_t | total_count = 0 |
| | The total amount of data to serialize.
|
|
idx_t | total_size = 0 |
| | The total amount of bytes used to compress the whole segment.
|
|
ContainerMetadataCollection | metadata_collection |
| | The container metadata, determining the type of each container to use during compression.
|
|
vector< ContainerMetadata > | container_metadata |
|
CompressionInfo | info |
◆ RoaringAnalyzeState()
| duckdb::roaring::RoaringAnalyzeState::RoaringAnalyzeState |
( |
const CompressionInfo & | info | ) |
|
|
explicit |
403981 : AnalyzeState(info), bitmask_table(CreateBitmaskTable()) {
403982}
◆ HandleByte()
| void duckdb::roaring::RoaringAnalyzeState::HandleByte |
( |
RoaringAnalyzeState & | state, |
|
|
uint8_t | array_index ) |
|
static |
403984 {
403985 auto bit_info = state.bitmask_table[
static_cast<uint8_t>(array_index)];
403986
403987 state.run_count +=
403988 bit_info.run_count + (bit_info.first_bit_set == false && (!state.count || state.last_bit_set == true));
403989 state.one_count += bit_info.valid_count;
403990 D_ASSERT(bit_info.valid_count <= 8);
403991 state.zero_count += 8 - bit_info.valid_count;
403992 state.last_bit_set = bit_info.last_bit_set;
403993 state.count += 8;
403994}
◆ HandleRaggedByte()
| void duckdb::roaring::RoaringAnalyzeState::HandleRaggedByte |
( |
RoaringAnalyzeState & | state, |
|
|
uint8_t | array_index, |
|
|
idx_t | relevant_bits ) |
|
static |
404006 {
404007 D_ASSERT(relevant_bits <= 8);
404008 for (
idx_t i = 0; i < relevant_bits; i++) {
404009 const bool bit_set = array_index & (1 << i);
404010 HandleBit(state, bit_set);
404011 }
404012}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
◆ HandleAllValid()
| void duckdb::roaring::RoaringAnalyzeState::HandleAllValid |
( |
RoaringAnalyzeState & | state, |
|
|
idx_t | amount ) |
|
static |
404014 {
404015 state.one_count += amount;
404016 state.last_bit_set = true;
404017 state.count += amount;
404018}
◆ HandleNoneValid()
| void duckdb::roaring::RoaringAnalyzeState::HandleNoneValid |
( |
RoaringAnalyzeState & | state, |
|
|
idx_t | amount ) |
|
static |
404020 {
404021 if (!state.count || (state.last_bit_set != false)) {
404022 state.run_count++;
404023 }
404024 state.zero_count += amount;
404025 state.last_bit_set = false;
404026 state.count += amount;
404027}
◆ Count()
| idx_t duckdb::roaring::RoaringAnalyzeState::Count |
( |
RoaringAnalyzeState & | state | ) |
|
|
static |
404029 {
404030 return state.count;
404031}
◆ Flush()
| void duckdb::roaring::RoaringAnalyzeState::Flush |
( |
RoaringAnalyzeState & | state | ) |
|
|
static |
404033 {
404034 state.FlushContainer();
404035}
◆ GetResult()
404061 {
404063}
uint16_t run_count
The amount of runs (of 0's) so far.
Definition duckdb.cpp:403330
uint16_t one_count
Analyze phase.
Definition duckdb.cpp:403326
uint16_t count
The total amount of bits covered (one_count + zero_count).
Definition duckdb.cpp:403334
uint16_t zero_count
The amount of unset bits found.
Definition duckdb.cpp:403328
◆ HasEnoughSpaceInSegment()
| bool duckdb::roaring::RoaringAnalyzeState::HasEnoughSpaceInSegment |
( |
idx_t | required_space | ) |
|
404037 {
404038 auto space_used =
data_size + metadata_size;
404039 D_ASSERT(space_used <= info.GetBlockSize());
404040 idx_t remaining_space = info.GetBlockSize() - space_used;
404041 if (required_space > remaining_space) {
404042 return false;
404043 }
404044 return true;
404045}
idx_t data_size
Flushed analyze data.
Definition duckdb.cpp:403339
◆ FlushSegment()
| void duckdb::roaring::RoaringAnalyzeState::FlushSegment |
( |
| ) |
|
404047 {
404048 auto space_used =
data_size + metadata_size;
404050 D_ASSERT(!space_used);
404051 return;
404052 }
404056 metadata_size = 0;
404059}
idx_t segment_count
The total amount of segments to write.
Definition duckdb.cpp:403343
idx_t current_count
The amount of values in the current segment;.
Definition duckdb.cpp:403345
idx_t total_size
The total amount of bytes used to compress the whole segment.
Definition duckdb.cpp:403350
ContainerMetadataCollection metadata_collection
The container metadata, determining the type of each container to use during compression.
Definition duckdb.cpp:403352
◆ FlushContainer()
| void duckdb::roaring::RoaringAnalyzeState::FlushContainer |
( |
| ) |
|
404065 {
404067 return;
404068 }
404069 auto metadata = GetResult();
404072
404073 if (metadata.IsRun()) {
404074 runs_count++;
404075 } else {
404076 arrays_count++;
404077 }
404078
404079 metadata_size =
metadata_collection.GetMetadataSize(runs_count + arrays_count, runs_count, arrays_count);
404080
404082 if (!HasEnoughSpaceInSegment(metadata_size +
data_size)) {
404083 FlushSegment();
404084 }
404085 container_metadata.push_back(metadata);
404088
404089
404095}
bool last_bit_set
Whether the last bit was set or not.
Definition duckdb.cpp:403332
◆ Analyze()
| void duckdb::roaring::RoaringAnalyzeState::Analyze |
( |
Vector & | input, |
|
|
idx_t | count ) |
|
inline |
403315 {
403316 static_assert(AlwaysFalse<std::integral_constant<PhysicalType, TYPE>>::VALUE,
403317 "No specialization exists for this type");
403318 }
◆ one_count
| uint16_t duckdb::roaring::RoaringAnalyzeState::one_count = 0 |
Analyze phase.
The amount of set bits found
◆ data_size
| idx_t duckdb::roaring::RoaringAnalyzeState::data_size = 0 |
Flushed analyze data.
The space used by the current segment
The documentation for this struct was generated from the following file: