CodeBlanks Logo Icon CodeBlanks

MPP

Learn massively parallel processing.

MPP

MPP (Massively Parallel Processing) splits a large query across many cores or nodes and runs it in parallel. Each node scans its own data; results are merged.

SET max_parallel_workers_per_gather = 4;
EXPLAIN SELECT COUNT(*) FROM events;

MPP splits a query in parallel.

MPP — details

In MPP each node works independently; this calls for scale-out design. A shared-nothing architecture cuts inter-node dependency.

Practice MPP

Set the parallel worker count to 4: SET max_parallel_workers_per_gather = 4.

Starter code

query.sql
-- MPP setting
SET max_parallel_workers_per_gather

Sample solution

query.sql
SET max_parallel_workers_per_gather = 4;

Expected output

SET

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 Parallel setting

Question
SET max_parallel_workers_per_gather = ____;
Answer
SET max_parallel_workers_per_gather = 4;

Explanation: max_parallel_workers_per_gather = 4 lets a query use up to 4 parallel workers.

2 How does MPP run a query?

  • In parallel Correct answer
  • On a single core
  • Sequentially
  • Only on disk

Explanation: MPP runs a query in parallel.

3 MPP: match the terms

Term Meaning
MPP MPP
parallel parallel
node node
gather gather

All lessons in Expert