Amazon Redshift
Redshift is AWS's MPP warehouse with real nodes and slices, where distribution and sort keys remain my responsibility rather than the service's. Interviewers use it to test physical-design reasoning that fully managed warehouses hide.
on this pageshowhide
guide
overview
~1 minAmazon Redshift is a columnar, massively parallel data warehouse on AWS. Unlike warehouses that hide the hardware, it leaves physical design in your hands: how rows are spread across the cluster and in what order they sit on disk still decide whether a query reads a handful of blocks locally or ships a whole table across the network. Interviewers use it to test exactly that reasoning — can you read a plan, spot data movement or a lopsided slice, and name the table change that fixes it — and to check that you treat it as an analytical engine, not a transactional database. The hub follows the life of a query. [Cluster architecture and RA3](/topics/db-redshift-architecture) covers the leader node, compute nodes and slices that every later answer refers back to. [Distribution and sort keys](/topics/db-redshift-distribution-sort-keys) is the physical design at the centre of most Redshift rounds. [Loading, UNLOAD and upserts](/topics/db-redshift-loading-transforming) is how data enters and leaves in bulk. [Spectrum and external data](/topics/db-redshift-spectrum-federation) reaches past the cluster to files in S3 and to live operational databases. [WLM and concurrency scaling](/topics/db-redshift-wlm-concurrency) decides who runs when BI, ETL and ad-hoc work share one cluster. Junior rounds check the vocabulary: slices, distribution styles, why `COPY` beats `INSERT`. Senior and principal rounds turn into diagnosis and design — a pegged node, a dashboard that waits rather than runs, a fact table joining several dimensions — where you are expected to name the system view you would check and the trade-off you would accept. Learn slices first, then the two keys; everything else in the hub is tuned against them.
primer
### Parallel by slice A cluster is a leader node that plans and assembles results, plus compute nodes that do the work. Each compute node is split into slices, and every table is spread over all of them. Each query step runs once per slice, so the cluster finishes only when its slowest slice does. Most Redshift performance answers trace back to that sentence. ### Moving data is the expensive part When rows that must meet in a join live on different slices, Redshift has to re-hash or copy one side across the network first. The distribution style decides where each row lands, and it is chosen per table, for the join that matters most. A strong answer says which join gets co-located and which ones pay for movement. ### Columnar blocks and zone maps Each column is stored compressed in fixed-size blocks, and Redshift remembers the smallest and largest value in every block. A sort key orders rows so those ranges stay narrow, letting a filter skip blocks without reading them. Pruning depends on the data staying sorted, which incremental loads slowly erode. ### Bulk in, bulk out The engine is built for set operations over many rows. Data arrives in parallel from files, changes are applied as batches through a staging table, and exports write from every slice at once. Anything row-at-a-time — single inserts, per-row updates — fights both the storage format and the commit path. ### Storage and compute, partly separated On RA3 and Serverless the durable data lives in managed storage while local disks hold hot blocks, so compute is sized for the workload rather than for the data. Spectrum goes a step further and queries files that never enter the cluster. Each step outward gives up control over physical layout in exchange for flexibility and a different bill. ### Concurrency is a budget Memory and execution slots are finite, and workload management decides how they are shared. A slow dashboard may be queueing rather than running slowly — a different problem with a different fix. Extra capacity helps queries that wait; it does nothing for one query that is already running.
- Leader node
- The single node clients connect to. It plans and compiles each query, hands the steps to compute nodes and assembles their partial results into the final answer.
- Slice
- One of the parallel workers inside a compute node, with its own share of memory and disk. Rows are assigned to slices, and query steps run once per slice.
- Distribution style
- The per-table rule that places rows on slices: KEY hashes a column, ALL copies the table to every node, EVEN spreads rows round-robin, AUTO lets Redshift choose.
- DISTKEY
- The column whose hash picks a row's slice under KEY distribution. Two tables distributed on their shared join column can join without moving rows.
- Sort key
- One or more columns that define the on-disk order of a table's rows, so filters on those columns can skip blocks. Compound and interleaved are the two kinds.
- Zone map
- The minimum and maximum value Redshift records for every block, used to skip blocks a filter cannot match.
- Data skew
- Uneven row counts across slices, usually from a DISTKEY with few distinct values, hot values or many NULLs. The fullest slice sets the pace of every query.
- Data redistribution
- Plan steps that re-hash or broadcast rows between nodes so a join or aggregation can proceed. EXPLAIN labels them with DS_ prefixes.
- RA3 managed storage
- The RA3 storage model: durable data lives in S3-backed managed storage and local SSDs hold the working set, so storage grows without adding nodes.
- Redshift Spectrum
- A query layer that reads files in S3 through external tables registered in a data catalog, without loading them into the cluster.
- Workload management (WLM)
- The scheduler that routes queries to queues, controls their concurrency and memory, and applies priorities and query monitoring rules.
- Concurrency scaling
- Transient extra clusters Redshift adds during bursts to run eligible queued queries, then removes once the queue drains.
- VACUUM
- Maintenance that reclaims space left by deleted rows and merges newly loaded, unsorted rows into sort order so block skipping works again.
Follow one table from load to query. A batch lands in S3 as many files; `COPY` splits them across slices, and each slice writes compressed column blocks for the rows its distribution style sends there. New rows are appended unsorted until a vacuum, automatic or manual, folds them into sort order. A dashboard query then connects to the leader node, which plans it against table statistics, and WLM decides whether it runs now, waits in a queue, or is sent to a concurrency-scaling cluster. On the compute nodes each slice scans only the blocks its zone maps cannot rule out, joins locally where tables share a DISTKEY or one side is replicated, and moves rows where they do not. The leader assembles the partial results and returns them. The rest of the hub attaches to that path. Spectrum and federated queries widen the scan step beyond the cluster: Spectrum reads S3 in a separate fleet and hands filtered rows back, where the join happens, so file format and partitioning decide what it reads. UNLOAD runs the path in reverse, and on RA3 managed storage sits under the blocks, filling the local cache on demand. The physical design is declared on the tables themselves, and the load is shaped to match it: ```sql -- two large tables distributed on their join column: the join stays on each slice CREATE TABLE orders (order_id BIGINT, customer_id BIGINT, order_date DATE) DISTKEY (order_id) SORTKEY (order_date); CREATE TABLE order_lines (order_id BIGINT, sku VARCHAR(32), amount DECIMAL(12,2), order_date DATE) DISTKEY (order_id) SORTKEY (order_date); -- small dimension replicated to each node: joins to it never move rows CREATE TABLE customers (customer_id BIGINT, region VARCHAR(32)) DISTSTYLE ALL; -- many files under one prefix, split across slices COPY order_lines FROM 's3://example-bucket/order_lines/2026-09-28/' IAM_ROLE DEFAULT FORMAT AS PARQUET; ``` Every choice here has a price. A query joining `order_lines` to another large table on `sku` would redistribute; a handful of huge orders would skew one slice; and date filters prune well only while new rows keep getting sorted in.
- Cluster Architecture & RA3 →
Leader, compute nodes and slices: the model every tuning answer refers back to, plus RA3 storage and Serverless.
- Distribution & Sort Keys →
The two table-level choices that decide data movement and block skipping, and the most probed part of any Redshift round.
- Loading, UNLOAD & Upserts →
How data gets in and out in bulk, and why upserts go through a staging table instead of row updates.
- WLM & Concurrency Scaling →
Keeping mixed BI and ETL workloads responsive once single queries are fast: queues, priorities, memory and burst capacity.
- Spectrum & External Data →
Querying S3 files and live databases from the cluster, and deciding what stays external versus what gets loaded.
Treating Redshift like an OLTP database: row-by-row inserts and updates pay a commit each and leave blocks half-empty, so batch through
COPYand a staging table.Choosing a DISTKEY for high cardinality alone, without checking that it matches a large, frequent join or that no hot value or NULL piles rows onto one slice.
Promising co-location for every join of a fact table: a table has one DISTKEY, so say which join it serves and how the others are handled.
Assuming primary and foreign keys are enforced: Redshift uses them only as planner hints, so duplicates load silently and a false declaration can produce wrong results.
Offering more nodes or concurrency scaling for one slow query; extra clusters only absorb queued work, and a skewed query stays skewed on a bigger cluster.
Tuning SQL for a slow dashboard before splitting its time into queue wait and execution — see diagnosing queue time.
Pointing Spectrum at a few huge compressed CSV files and expecting cluster size to help — see file layout and splits.
Redshift has no release numbers a candidate is expected to quote; AWS patches it continuously. What interviewers ask about is how recommended practice shifted, because many clusters and older answers predate it. This guide assumes RA3 nodes or Serverless, automatic WLM, and tables created with the current defaults. - **Storage model.** DC2 and earlier node types kept data on local disks, so data volume dictated node count. RA3 moved the durable copy into managed storage, and Serverless removed cluster sizing altogether. - **Workload management.** Hand-tuned manual WLM queues with fixed slots and memory gave way to automatic WLM steered by priorities. - **Physical design.** Tables created without an explicit distribution style or sort key now get AUTO, and Redshift can change them over time; vacuum and analyze also run in the background. Interviewers still test the reasoning AUTO applies. - **Upserts.** The staging-table pattern once ended in `DELETE ... USING` plus `INSERT`; a native `MERGE` statement now does the same in one step. When an answer depends on one of these, say which world you are describing.
Redshift sits in AWS's analytics stack and is usually placed against two kinds of neighbour. Among cloud warehouses it competes with Snowflake, Google BigQuery and Databricks SQL. The separating trade-off is control: Redshift exposes nodes, slices and key choices and rewards teams that tune them, while the others manage physical layout and scale compute with less for you to decide. Serverless narrows that gap without removing the key choices. Inside AWS it is weighed against Amazon Athena, which queries the same S3 files through the same Glue Data Catalog with no cluster at all. Athena fits occasional, ad-hoc exploration of a lake; Spectrum fits when those files must be joined with data already in Redshift. Around the warehouse sit S3 as the lake, Glue for the catalog and ETL, Kinesis and Amazon MSK for streaming ingestion, and tools such as dbt that run SQL models inside the warehouse. Operational data stays in RDS or Aurora, reached through federated queries or replicated in.
explore
- Cluster Architecture & RA36 questions
- Distribution & Sort Keys6 questions
- Spectrum & External Data7 questions
- WLM & Concurrency Scaling6 questions
- Loading, UNLOAD & Upserts6 questions
questions
page 2 of 2How do query monitoring rules work in Amazon Redshift WLM, and what would you use one for?
basics
~20 sA query monitoring rule attaches to a WLM queue and combines up to three predicates on runtime metrics such as execution time or rows scanned. When all of them hold for a running query, Redshift performs the rule's action: log, hop, abort, or change its priority.
showing 31–31 of 31