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 - SQL Tutorial
From the course: Advanced SQL for Query Tuning and Performance Optimization
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
-
-
-
-
-
-
-
-
-
-
(Locked)
Using common table expressions to avoid repetitive computation2m 11s
-
(Locked)
Hints to the Query Optimizer1m 43s
-
(Locked)
Parallel query execution2m 6s
-
(Locked)
Improving cache utilization2m 20s
-
(Locked)
Miscellaneous tips2m 21s
-
(Locked)
Challenge: Design a common table expression24s
-
(Locked)
Solution: Design a common table expression18s
-
(Locked)
-