> **ProjectSet**
> <table>
> <tr>
> <td width="25%"><img src="assets/ex_projectset.png"></td>
> <td>Evaluates set-returning functions (SRFs) in the target list, such as <code>generate_series()</code> or <code>unnest()</code>. It emits multiple rows for each input row, effectively 'projecting' a set of values into the execution stream.</td>
> </tr>
> </table>
>
> ```sql
> -- Expanding an array into multiple rows
> EXPLAIN (ANALYZE, COSTS, BUFFERS, VERBOSE)
> SELECT unnest(ARRAY[1,2,3]);
> ```
>
> 
>
> <!-- literal-explain-plan
> Captured EXPLAIN provenance for the adjacent reader-facing visual plan.
> Canonical capture metadata lives in scratch/actual_operation_plans.json.
>
> ProjectSet (cost=0.00..0.03 rows=3 width=4) (actual time=0.002..0.003 rows=3 loops=1)
> Output: unnest('{1,2,3}'::integer[])
> -> Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.001 rows=1 loops=1)
> Planning Time: 0.064 ms
> Execution Time: 0.027 ms
> -->
>
>
> <!--
> Raw-capture provenance — separate run.
> SQL, setup, dataset, settings, and scope: artifacts/chapter4_capture_matrix.json.
> Target: PostgreSQL 18.x companion fixture. Cache state: uncontrolled.
> Boundary: pg_wait_tracer backend execution root; client states are included when the chart shows them.
> Fidelity: exact pg_wait_tracer export. Not the adjacent EXPLAIN run; compare state shape, not durations.
> -->
>
> 
>
> <table>
> <tr>
> <td rowspan="2" width="25%"><img src="assets/ex_projectset.svg"></td>
> <td><b>Performance</b></td><td>High performance; overhead is tied directly to the complexity of the set-returning function.</td>
> </tr>
> <tr><td><b>Cost</b></td><td><code>`function cost + cpu_tuple_cost * number of rows`</code></td></tr>
> </table>