> [!NOTE] Function Scan
> <table>
> <tr>
> <td width="25%"><img src="assets/ex_functionscan.png"></td>
> <td>A scan node that executes a set-returning function. The engine materializes the entire result set of the function before scanning it, which can be a memory bottleneck if the function returns a massive volume of data.</td>
> </tr>
> </table>
>
> ```sql
> -- Scanning the output of generate_series
> EXPLAIN (ANALYZE, COSTS, BUFFERS, VERBOSE)
> SELECT * FROM generate_series(1,5);
> ```
>
> 
>
> ```text
> Function Scan on pg_catalog.generate_series (cost=0.00..0.05 rows=5 width=4) (actual time=0.004..0.004 rows=5 loops=1)
> Output: generate_series
> Function Call: generate_series(1, 5)
> Planning Time: 0.032 ms
> Execution Time: 0.018 ms
> ```
>
> 
>
> <table>
> <tr>
> <td rowspan="2" width="25%"><img src="assets/ex_result.svg"></td>
> <td><b>Performance</b></td><td>High performance for simple built-ins; performance is entirely dependent on the execution time of the underlying function.</td>
> </tr>
> <tr><td><b>Cost</b></td><td><code>function cost + cpu_tuple_cost * number of tuples</code></td></tr>
> </table>