|
|
const idx_t | row_width |
| | Width of tuples.
|
|
const idx_t | sink_capacity |
| | Capacity of HTs during the Sink.
|
|
|
static constexpr idx_t | GROW_STRATEGY_THREAD_THRESHOLD = 2 |
| | If we have this many or less threads, we grow the HT, otherwise we abandon.
|
|
static constexpr double | BLOCK_FILL_FACTOR = 0.5 |
| | If we fill this many blocks per partition, we trigger a repartition.
|
|
static constexpr idx_t | REPARTITION_RADIX_BITS = 2 |
| | By how many bits to repartition if a repartition is triggered.
|
|
|
RadixHTGlobalSinkState & | sink |
| | The global sink state.
|
|
atomic< idx_t > | sink_radix_bits |
| | Current thread-global sink radix bits.
|
|
const idx_t | maximum_sink_radix_bits |
| | Maximum Sink radix bits (set based on number of threads, if not external).
|
|
|
static constexpr idx_t | MAXIMUM_INITIAL_SINK_RADIX_BITS = 4 |
| | Sink radix bits to initialize with.
|
|
static constexpr idx_t | MAXIMUM_FINAL_SINK_RADIX_BITS = 8 |
| | Maximum Sink radix bits (independent of threads).
|
| static constexpr idx_t | ROW_WIDTH_THRESHOLD_ONE = 32 |
|
static constexpr idx_t | ROW_WIDTH_THRESHOLD_TWO = 64 |
◆ RadixHTConfig()
207245}
const idx_t row_width
Width of tuples.
Definition duckdb.cpp:207091
const idx_t sink_capacity
Capacity of HTs during the Sink.
Definition duckdb.cpp:207093
atomic< idx_t > sink_radix_bits
Current thread-global sink radix bits.
Definition duckdb.cpp:207102
RadixHTGlobalSinkState & sink
The global sink state.
Definition duckdb.cpp:207087
const idx_t maximum_sink_radix_bits
Maximum Sink radix bits (set based on number of threads, if not external).
Definition duckdb.cpp:207104
◆ SetRadixBits()
| void duckdb::RadixHTConfig::SetRadixBits |
( |
const idx_t & | radix_bits_p | ) |
|
207247 {
207249 SetRadixBitsInternal(MinValue(radix_bits_p, max_bits), false);
207250}
◆ SetRadixBitsToExternal()
| bool duckdb::RadixHTConfig::SetRadixBitsToExternal |
( |
| ) |
|
207252 {
207253 SetRadixBitsInternal(ExternalRadixBits(true), true);
207254 return sink.external;
207255}
◆ GetRadixBits()
| idx_t duckdb::RadixHTConfig::GetRadixBits |
( |
| ) |
const |
◆ GetMaximumSinkRadixBits()
| idx_t duckdb::RadixHTConfig::GetMaximumSinkRadixBits |
( |
| ) |
const |
◆ SetRadixBitsInternal()
| void duckdb::RadixHTConfig::SetRadixBitsInternal |
( |
idx_t | radix_bits_p, |
|
|
bool | external ) |
|
private |
207265 {
207267 return;
207268 }
207269
207270 auto guard =
sink.Lock();
207272 return;
207273 }
207274
207275 if (external) {
207278 sink.minimum_reservation =
sink.minimum_reservation * partition_multiplier;
207279 sink.external =
true;
207280 }
207281
207283}
static constexpr idx_t NumberOfPartitions(idx_t radix_bits)
The number of partitions for a given number of radix bits.
Definition duckdb.cpp:93425
◆ InitialSinkRadixBits()
| idx_t duckdb::RadixHTConfig::InitialSinkRadixBits |
( |
| ) |
const |
|
private |
207285 {
207288}
static constexpr idx_t MAXIMUM_INITIAL_SINK_RADIX_BITS
Sink radix bits to initialize with.
Definition duckdb.cpp:207097
static idx_t RadixBitsOfPowerOfTwo(idx_t n_partitions)
Inverse of NumberOfPartitions, given a number of partitions, get the number of radix bits.
Definition duckdb.cpp:93435
◆ ExternalRadixBits()
| idx_t duckdb::RadixHTConfig::ExternalRadixBits |
( |
bool | dynamic | ) |
const |
|
private |
207290 {
207291
207292
207293
207294
207295
207296 const auto memory_limit = dynamic ?
sink.temporary_memory_state->GetReservation() :
sink.memory_limit / 2;
207297 const auto max_partitions = memory_limit /
sink.number_of_threads /
sink.block_alloc_size / 4;
207298
207299
207300 const auto bits = MaxValue(RadixPartitioning::RadixBits(max_partitions) - 1, InitialSinkRadixBits());
207301
207302
207303 if (max_partitions == 0 || bits == 0) {
207304 return 1;
207305 }
207306
207307
207309}
static constexpr idx_t MAXIMUM_FINAL_SINK_RADIX_BITS
Maximum Sink radix bits (independent of threads).
Definition duckdb.cpp:207099
◆ MaximumSinkRadixBits()
| idx_t duckdb::RadixHTConfig::MaximumSinkRadixBits |
( |
| ) |
const |
|
private |
207311 {
207313 return InitialSinkRadixBits();
207314 }
207315
207317 if (
row_width >= ROW_WIDTH_THRESHOLD_TWO) {
207321 } else {
207323 }
207324
207325 return MinValue(bits, ExternalRadixBits(false));
207326}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
static constexpr const idx_t INVALID_INDEX
The value used to signify an invalid index entry.
Definition duckdb.hpp:1117
static constexpr idx_t ROW_WIDTH_THRESHOLD_ONE
Definition duckdb.cpp:207108
static constexpr idx_t GROW_STRATEGY_THREAD_THRESHOLD
If we have this many or less threads, we grow the HT, otherwise we abandon.
Definition duckdb.cpp:207113
◆ SinkCapacity()
| idx_t duckdb::RadixHTConfig::SinkCapacity |
( |
| ) |
const |
|
private |
207328 {
207330
207331 return 262144;
207332 }
207333
207334 return 32768;
207335}
◆ ROW_WIDTH_THRESHOLD_ONE
| idx_t duckdb::RadixHTConfig::ROW_WIDTH_THRESHOLD_ONE = 32 |
|
staticconstexprprivate |
Thresholds at which we reduce the sink radix bits This needed to reduce cache misses when we have very wide rows
The documentation for this struct was generated from the following file: