Configure vectorized execution
By default, vectorized execution is enabled in CockroachDB. You can configure vectorized execution with thevectorize . The following options are supported:
| Option | Description |
|---|---|
on | Turns on vectorized execution for all queries. Default: vectorize=on |
off | Turns off vectorized execution for all queries. |
How vectorized execution works
When you issue a query, the gateway node (i.e., the node from which you issue the query) for execution on each node that receives the plan. If vectorized execution is enabled, the physical plan is sent to each node to be executed by the vectorized execution engine. To see a detailed view of the vectorized execution plan for a query, run the statement on the query. For information about vectorized execution in the context of the CockroachDB architecture, see . For detailed examples of vectorized query execution for hash and merge joins, see the blog posts 40x faster hash joiner with vectorized execution and Vectorizing the merge joiner in CockroachDB.Disk-spilling operations
The following disk-spilling operations require memory buffering during execution. If there is not enough memory allocated for a disk-spilling operation, CockroachDB will spill the intermediate execution results to disk.- Global
- on non-unique columns. Merge joins on columns that are guaranteed to have one row per value, also known as “key columns”, can execute entirely in-memory.
- .
64MiB. This limit applies to a single operation within a single query, and is configured with the sql.distsql.temp_storage.workmem .
To increase the limit, change the cluster setting:
Operations that do not support disk spilling ignore the
sql.distsql.temp_storage.workmem limit.--max-sql-memory, see .
Known limitations
Unsupported queries
The vectorized engine does not support queries containing:- A join filtered with an .

