From the course: Advanced SQL for Query Tuning and Performance Optimization

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Parallel query execution

Parallel query execution

- [Instructor] Another way to make queries execute faster is to execute steps in parallel. Sometimes the execution plan builder will find that it can run some steps in parallel. In that case, it will try to execute parts of the plan in parallel and then combine or gather the results. You can tell your execution plan is using parallel queries if there is a gather or gather, merge in the query plan. Steps below that are executed in parallel. How many parallel processes the execution plan will use is based on a couple of parameters; the max parallel workers and max worker process parameters. These are Postgres specific parameters, but if your database supports parallel queries, it's likely they have similar parameters. Now, in order to execute some steps in parallel we need to have the max parallel workers per gatherer parameter set to a value greater than zero. The dynamic shared memory type parameter must not be set to none,…

Contents