Greenplum
Greenplum is an MPP warehouse built from many PostgreSQL instances. Every node runs each query at the same time, and every node has its own disk. In Russian companies you meet it as Greenplum itself, its forks Arenadata DB and Greengage DB, or Apache Cloudberry. They share the mechanics, so this topic is not tied to a version and says nothing about licences.
The general idea of MPP, the distribution key, and a Redistribute Motion in a plan are covered in "Databases for Data Engineers". This topic covers what an interviewer asks a candidate who has worked with Greenplum: how a segment failure hits a load, how to choose a key and find skew, which storage to pick for a table, what to read in EXPLAIN ANALYZE, and how to load data in parallel.
Coordinator, segments, and mirrors
The coordinator accepts connections, holds the system catalog, plans the query, and gathers the result. It holds no user data. Segments are PostgreSQL instances, and each holds its share of every table. A server usually runs several segments. Data moves between segments over the cluster network, called the interconnect.
Every primary segment has a mirror on another server. In Greenplum 6 and later the mirror receives the primary's WAL through streaming replication; Greenplum 5 replicated files instead. The FTS process on the coordinator probes the primaries. When a segment stops answering, FTS marks it down in gp_segment_configuration, and its mirror takes over as primary. Transactions running at the moment of the failure roll back and have to be started again. For a pipeline this means a load must be idempotent and able to rerun as a whole.
After a failover the cluster works, but unevenly. With the default layout all mirrors of one server sit on one other server, and after the first fails, the backing server runs twice as many active segments. gprecoverseg brings the failed segment back as a mirror, and gprecoverseg -r restores the original roles and cancels running queries while doing so. If a primary and its mirror both fail, the database is unavailable. The coordinator can have a standby too, but it is activated by hand with gpactivatestandby.
Where Greenplum sits next to ClickHouse and a lakehouse
| Greenplum | ClickHouse | Lakehouse (Iceberg + Spark/Trino) | |
|---|---|---|---|
| Foundation | PostgreSQL, transactions and MVCC | Its own columnar engine, MergeTree | Parquet files on object storage plus a table format |
| Storage and compute | On the same nodes | On the same nodes | Separate: several engines can share the data |
| Strength | Complex SQL with large joins, UPDATE and DELETE, PostgreSQL compatibility | Fast aggregations over wide event tables | Cheap storage, open formats, independent scaling |
| Cost | Growing the cluster means redistributing tables | Joins and point changes cost more than in a classic DBMS | Small files and snapshots need looking after |
In Greenplum, gpexpand adds segments, and the existing tables are then redistributed onto them. A warehouse that separates storage and compute just starts more nodes.
Topic map
- Distribution and skew — choosing a distribution key, data skew and processing skew, the
gp_toolkitviews, changing the key withALTER TABLE. - Table storage — heap and append-optimized, row and column orientation, compression, partitions, and the file count on a segment.
- Plans and motions — slices,
Gather,Redistribute, andBroadcast Motion, readingEXPLAIN ANALYZE, ORCA and the PostgreSQL planner, spill files and resource groups. - Loading and maintenance —
COPYversus external tables with gpfdist and PXF, isolating bad rows, ANALYZE and VACUUM after loads.
Common traps
| Mistake | Consequence |
|---|---|
Omitting DISTRIBUTED BY and relying on the default | The server picks the key, and it often does not match the join key |
Distributing by a date or by a WHERE column | A day's load and queries land on one segment |
| Splitting a columnar table into daily partitions over many years | Segments × columns × partitions add up to millions of files |
| Updating an append-optimized table row by row | The share of hidden rows grows, and the table bloats until VACUUM |
Loading large volumes through COPY | The whole stream goes through one process on the coordinator |
| Skipping ANALYZE after loading into an already populated table | Statistics go stale, and ORCA may broadcast a large table to every segment |
| Looking at the average time across segments | Skew on one segment stays hidden, and that segment sets the query time |
Interview relevance
A Greenplum interview checks whether a candidate can explain a slow query or a broken load through how the cluster works. A strong answer names the mechanism: "the query hangs because after the join on customer_id one customer gives 30% of the rows. The Redistribute Motion sent them all to one segment, and that segment went to spill files."
Typical checks:
- What the coordinator, segments, and mirrors do, and what happens when a segment fails.
- How to choose a distribution key, and when to replicate a table.
- Data skew versus processing skew, and how to find each.
- Heap, append-optimized row, and append-optimized column: which for which table.
- Why a columnar table with thousands of partitions hurts.
- Motion types and slices in a plan, ORCA versus the PostgreSQL planner.
- Parallel loading through gpfdist or PXF, and why not
COPY. - ANALYZE and VACUUM after a load.
Common wrong answer: "The tables are distributed evenly, so there is no skew." Even storage only protects against data skew. Processing skew appears during the query: a join or a GROUP BY on a column with a hot value redistributes rows by that column, and they pile up on one segment. You find it through the plan and the spill files, not through the table's row counts.