Allows to execute multiple statements in parallel.Documentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Syntax
statement1, statement2, statement3, … in parallel with each other. The output of those statements is discarded.
Executing statements in parallel may be faster than just a sequence of the same statements in many cases. For example, statement1 PARALLEL WITH statement2 PARALLEL WITH statement3 is likely to be faster than statement1; statement2; statement3.
Examples
Creates two tables in parallel:Settings
Setting max_threads controls how many threads are spawned.Comparison with UNION
ThePARALLEL WITH clause is a bit similar to UNION, which also executes its operands in parallel. However there are some differences:
PARALLEL WITHdoesn’t return any results from executing its operands, it can only rethrow an exception from them if any;PARALLEL WITHdoesn’t require its operands to have the same set of result columns;PARALLEL WITHcan execute any statements (not justSELECT).