Templated scan implementation. Output policy defines how results are emitted. Returns COMPLETED if scan finished, PAUSED if stopped due to output capacity.
153983 {
153984 bool has_next;
153985 do {
153986
153987 if (!upper_bound.Empty()) {
153990 return ARTScanResult::COMPLETED;
153991 }
153992 }
153993 }
153994
153995
153999
154001 case NType::LEAF_INLINED: {
154002 if (output.IsFull()) {
154003 return ARTScanResult::PAUSED;
154004 }
154006 break;
154007 }
154008 case NType::LEAF: {
154010 if (!resume_state.has_cached_row_ids) {
154011 resume_state.cached_row_ids.clear();
154013 resume_state.cached_row_ids_it = resume_state.cached_row_ids.begin();
154014 resume_state.has_cached_row_ids = true;
154015 }
154016
154017 while (resume_state.cached_row_ids_it != resume_state.cached_row_ids.end()) {
154018 if (output.IsFull()) {
154019
154020 return ARTScanResult::PAUSED;
154021 }
154022 output.Add(*resume_state.cached_row_ids_it);
154023 ++resume_state.cached_row_ids_it;
154024 }
154025 resume_state.has_cached_row_ids = false;
154026 break;
154027 }
154028 case NType::NODE_7_LEAF:
154029 case NType::NODE_15_LEAF:
154030 case NType::NODE_256_LEAF: {
154031
154032
154033 if (!resume_state.nested_started) {
154034 resume_state.nested_byte = 0;
154035 resume_state.nested_started = true;
154036 }
154037
154038 while (
last_leaf.GetNextByte(
art, resume_state.nested_byte)) {
154039 if (output.IsFull()) {
154040
154041 return ARTScanResult::PAUSED;
154042 }
154043 row_id[ROW_ID_SIZE - 1] = resume_state.nested_byte;
154044 ARTKey rid_key(&
row_id[0], ROW_ID_SIZE);
154045 output.Add(rid_key.GetRowId());
154046
154047 if (resume_state.nested_byte == NumericLimits<uint8_t>::Maximum()) {
154048 break;
154049 }
154050 resume_state.nested_byte++;
154051 }
154052 resume_state.nested_started = false;
154053 break;
154054 }
154055 default:
154056 throw InternalException("Invalid leaf type for index scan.");
154057 }
154058
154060 has_next =
Next();
154061 } while (has_next);
154062 return ARTScanResult::COMPLETED;
154063}
uint8_t nested_depth
Depth in a nested leaf.
Definition duckdb.cpp:59128
Node last_leaf
Last visited leaf node.
Definition duckdb.cpp:59122
bool entered_nested_leaf
True, if we entered a nested leaf to retrieve the next node.
Definition duckdb.cpp:59130
bool Next()
Definition duckdb.cpp:154201
uint8_t row_id[ROW_ID_SIZE]
Holds the row ID of nested leaves.
Definition duckdb.cpp:59124
IteratorKey current_key
Holds the current key leading down to the top node on the stack.
Definition duckdb.cpp:59097
static bool DeprecatedGetRowIds(ART &art, const Node &node, set< row_t > &row_ids, const idx_t max_count)
Definition duckdb.cpp:154431