|
|
const idx_t | num_threads |
| | Total number of threads.
|
|
unique_ptr< TemporaryMemoryState > | temporary_memory_state |
| | Temporary memory state for managing this sort's memory usage.
|
|
vector< unique_ptr< SortedRun > > | sorted_runs |
| | Runs that have been sorted locally before being appended to this global state.
|
|
atomic< idx_t > | sorted_tuples |
| | Sorted tuple count (for progress).
|
|
bool | external |
| | Whether this is an external sort.
|
|
bool | any_combined |
| | Whether any thread has called Combine yet.
|
|
idx_t | total_count |
| | Total count (for the source phase).
|
|
idx_t | partition_size |
| | Partition size (for the source phase).
|
|
SinkFinalizeType | state |
◆ SortGlobalSinkState()
| duckdb::SortGlobalSinkState::SortGlobalSinkState |
( |
ClientContext & | context | ) |
|
|
inlineexplicit |
103264 :
num_threads(NumericCast<idx_t>(TaskScheduler::GetScheduler(context).NumberOfThreads())),
103268 }
bool external
Whether this is an external sort.
Definition duckdb.cpp:103327
unique_ptr< TemporaryMemoryState > temporary_memory_state
Temporary memory state for managing this sort's memory usage.
Definition duckdb.cpp:103320
const idx_t num_threads
Total number of threads.
Definition duckdb.cpp:103318
idx_t total_count
Total count (for the source phase).
Definition duckdb.cpp:103332
bool any_combined
Whether any thread has called Combine yet.
Definition duckdb.cpp:103329
atomic< idx_t > sorted_tuples
Sorted tuple count (for progress).
Definition duckdb.cpp:103324
idx_t partition_size
Partition size (for the source phase).
Definition duckdb.cpp:103334
static TemporaryMemoryManager & Get(ClientContext &context)
Get the TemporaryMemoryManager.
Definition duckdb.cpp:443547
◆ UpdateLocalState()
◆ TryIncreaseReservation()
| void duckdb::SortGlobalSinkState::TryIncreaseReservation |
( |
ClientContext & | context, |
|
|
SortLocalSinkState & | lstate, |
|
|
bool | is_index_sort, |
|
|
const unique_lock< mutex > & | guard ) |
|
inline |
103277 {
103278 VerifyLock(guard);
103280
103281
103285 }
103286 return;
103287 }
103288
103289
103290 auto required =
num_threads * lstate.sorted_run->SizeInBytes();
103291 if (is_index_sort) {
103292 required *= 4;
103293 }
103295 while (request < required) {
103296 request *= 2;
103297 }
103298
103299
103301
103302
103306 }
103307 }
103308 }
◆ AddSortedRun()
103310 {
103311 auto guard = Lock();
103312 sorted_runs.push_back(std::move(lstate.sorted_run));
103314 }
vector< unique_ptr< SortedRun > > sorted_runs
Runs that have been sorted locally before being appended to this global state.
Definition duckdb.cpp:103322
The documentation for this class was generated from the following file: