### Append ![[assets/ex_append.png|256]] ### The Explain Trace ```sql -- Combining two targeted lookups with UNION ALL EXPLAIN (ANALYZE, COSTS, BUFFERS, VERBOSE) SELECT * FROM animals WHERE id = 1 UNION ALL SELECT * FROM animals WHERE id = 2; ``` ```text Append (cost=1.29..16.62 rows=2 width=27) (actual time=1.005..1.012 rows=2 loops=1) Buffers: shared hit=6 -> Index Scan using animals_pkey on public.animals (...) -> Index Scan using animals_pkey on public.animals animals_1 (...) ``` --- - **Description**: Concatenates the results of subqueries. - **Performance**: High performance; simply iterates through child nodes sequentially. - **Factors**: Number of subqueries and the combined overhead of their execution. - **Cost**: Sum of subquery costs. - **Operates on**: [[Structures/Result Set]] - **Workloads**: - [[Workloads/IPC/Parallel/AppendReady|IPC: AppendReady]] - [[Workloads/LWLock/Parallel/ParallelAppend|LWLock: ParallelAppend]]