![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
SQL function provsql.simplified_circuit_subgraph(). More...
#include "postgres.h"#include "fmgr.h"#include "catalog/pg_type.h"#include "utils/jsonb.h"#include "utils/fmgrprotos.h"#include "utils/uuid.h"#include "provsql_utils.h"#include "CircuitFromMMap.h"#include "GenericCircuit.h"#include "HybridEvaluator.h"#include "provsql_utils_cpp.h"#include <queue>#include <sstream>#include <string>#include <unordered_map>#include <vector>
Go to the source code of this file.
Functions | |
| Datum | simplified_circuit_subgraph (PG_FUNCTION_ARGS) |
SQL function provsql.simplified_circuit_subgraph().
Returns a BFS subgraph of the IN-MEMORY GenericCircuit rooted at a given UUID, so consumers see the result of simplify_on_load / RangeCheck / AnalyticEvaluator passes rather than the persisted mmap DAG.
Output: jsonb array of objects, each {node, parent, child_pos, gate_type, info1, info2, extra, depth}. Same row shape as the recursive-CTE circuit_subgraph, with the extra column inlined so the caller doesn't have to round-trip through get_extra (which would hit the persisted DAG and miss extras introduced by the simplifier).
Returning jsonb (rather than SETOF record) keeps the C++ side free of SRF / FuncCallContext mechanics; a single PG round-trip is the same cost as the recursive CTE in the persisted-DAG path.
Definition in file SimplifiedSubgraph.cpp.
| Datum simplified_circuit_subgraph | ( | PG_FUNCTION_ARGS | ) |