|
Relational NT
A relational database kernel shaped around NT-style object management.
|
A node in the Volcano operator tree executed by the Tarski (FOL) runtime. More...
#include <VM.h>
Public Attributes | |
| Operation | op |
| PlanNode * | left = nullptr |
| PlanNode * | right = nullptr |
| CursorManager::cursor * | scan_cursor = nullptr |
| SCAN: pre-opened cursor. | |
| std::vector< PathArg > | scan_args |
| SCAN: argument template for parameterized relations. | |
| std::size_t | take_limit = 0 |
| TAKE: maximum number of tuples to emit before returning nullptr. | |
| std::size_t | take_count = 0 |
| Runtime counter; mutable during execution. | |
| std::unordered_set< std::string > | project_attrs |
| PROJECT: unordered set of attribute names to keep. | |
| std::optional< Tuple > | project_buffer |
| Tuple * | join_left = nullptr |
| JOIN runtime state. | |
| std::optional< Tuple > | join_buffer |
| std::unordered_set< std::string > | join_attrs |
| std::vector< Tuple > | mat_buffer |
| MATERIALIZE runtime state. | |
| std::size_t | mat_pos = 0 |
| bool | mat_done = false |
| PlanNode * | upstream = nullptr |
| RENAME runtime state. | |
| std::unordered_map< std::string, std::string > | attrs |
| std::vector< PlanNode * > | nodes |
| UNION runtime state. | |
| std::vector< PlanNode * >::iterator | current_node |
A node in the Volcano operator tree executed by the Tarski (FOL) runtime.
Each node represents one relational algebra operator. The tree is demand-driven: VM::Next() propagates pull requests from root to leaves.
Supported operators:
| Tuple* nt::PlanNode::join_left = nullptr |
JOIN runtime state.
join_left holds the current outer tuple while probing the inner (right) side. The pointer is stable for the lifetime of one outer iteration because Next(left) is only called when join_left is reset to nullptr, which happens only after the inner side is exhausted.
join_buffer holds the merged output tuple and is overwritten on each successful join. Callers must consume the returned pointer before calling Next() again — same contract as a cursor page pointer.
| std::vector<Tuple> nt::PlanNode::mat_buffer |
MATERIALIZE runtime state.
mat_buffer holds owned copies of the child's tuples, filled on the first scan. mat_done marks the cache complete (child exhausted). mat_pos is the replay cursor, reset to 0 by Rewind on each later scan.
| std::vector<PathArg> nt::PlanNode::scan_args |
SCAN: argument template for parameterized relations.
Var entries are resolved from the outer JOIN tuple; Const entries are used as-is. The resolved values are written into scan_cursor->args by the JOIN before it calls Next() on this node.
| CursorManager::cursor* nt::PlanNode::scan_cursor = nullptr |
SCAN: pre-opened cursor.
For ephemeral relations the JOIN resets it (args, offset, exhausted flag) with resolved args before each probe, overwriting whatever standalone-scan state it opened with.