### ProjectSet ![[assets/ex_projectset.png|256]] ### The Explain Trace ```sql -- Expanding an array into multiple rows EXPLAIN (ANALYZE, COSTS, BUFFERS, VERBOSE) SELECT unnest(ARRAY[1,2,3]); ``` ```text ProjectSet (cost=1.00..1.03 rows=3 width=4) (actual time=1.001..1.002 rows=3 loops=1) Output: unnest('{1,2,3}'::integer[]) -> Result (cost=1.00..1.01 rows=1 width=0) (actual time=1.000..1.000 rows=1 loops=1) ``` --- - **Description**: Projects sets of rows from functions. - **Performance**: High performance; overhead is tied directly to the complexity of the set-returning function. - **Factors**: Function complexity and the total number of rows generated. - **Cost**: `function cost + cpu_tuple_cost * number of rows` - **Operates on**: [[Structures/Result Set]] - **Workloads**: - [[Workloads/LWLock/Buffers/BufferContent|LWLock: BufferContent]]