Amazon Redshift
Learn Redshift MPP architecture, distribution and sort choices, query plans, workload management, ingestion, cost, and recovery.
What is Amazon Redshift?
Amazon Redshift is a managed analytical database for running SQL across large datasets. It stores values by column, divides query work across compute slices, and coordinates those slices as a massively parallel processing (MPP) system.
That design fits scans, joins, and aggregations over many rows. It does not turn Redshift into an operational database for high-frequency single-row transactions.
Parallelism helps only when rows, memory, and query work are distributed well enough that one slice, queue, or data movement step does not dominate the result.
Leader and optimizer
Parses SQL, builds a plan, coordinates compute work, and returns the combined result.
Compute slices
Own table blocks and execute parallel scan, join, sort, and aggregation stages.
Columnar blocks
Keep values from the same column together so projections, encodings, and block metadata can reduce I/O.
Managed storage
RA3 clusters separate much of the storage lifecycle from local compute, while Serverless manages the workgroup capacity boundary.
Follow one analytical query through the warehouse
The SQL text is only the beginning. A query becomes a distributed plan whose elapsed time depends on the bytes read, rows moved, memory used, and slowest required slice.
One Redshift query path
Identity, queue, priority
SQL and workload class
The request enters one named workload boundary.
Columns, blocks, join order
Plan and prune
The optimizer chooses the distributed stages and candidate block ranges.
Scan, join, aggregate
Parallel slice work
Compute slices execute their assigned portions of each required stage.
Rows plus system evidence
Merge and return
The leader combines results while system views retain query evidence.
Read an EXPLAIN plan before guessing at a fix. A large redistribution, broadcast, spill, or scan may matter more than node count. The current data-distribution guidance describes two goals: keep slice work balanced and minimize runtime data movement.
Make table layout serve the dominant query
Distribution answers where rows live. Sort design influences which blocks a predicate can skip. They solve different problems and should be evaluated separately.
DISTSTYLE AUTOlets automatic table optimization choose and evolve a layout from observed workloads.EVENspreads rows without trying to collocate a join.KEYplaces equal key values together, which can reduce one important join but can also create skew.ALLcopies a full table to every compute node, exchanging storage and load work for local joins.- A leading sort column helps only when common predicates constrain that column enough for block ranges to prune data.
Use the lab to compare the costs instead of treating one style as universally best.
The model uses fixed percentages to make the mechanism visible. Production evidence comes from representative data, query plans, system views, statistics, and observed automatic-optimization actions.
Redshift documents AUTO, EVEN, KEY, and ALL in its current distribution-style reference. Automatic table optimization can change eligible AUTO tables in the background; inspect those actions rather than assuming AUTO means “no ownership.”
Protect short queries from long-running work
Workload Management (WLM) controls how queries are classified, prioritized, admitted, and queued under contention. Automatic WLM adjusts concurrency and memory from query needs. Separate queues, query priorities, short-query acceleration, query-monitoring rules, and concurrency scaling are related controls, not interchangeable labels.
Three signals must stay distinct:
Admission delay
Queue time
Time spent waiting before execution starts.
Active work
Execution time
Time spent running after admission.
Useful output
Completed work
Success, cancellation, abort, or failure by workload class.
Change the arrivals, ETL concurrency, and policy below. The slot arithmetic is deliberately simple; it demonstrates isolation and pressure, not Redshift's internal automatic-WLM algorithm.
The official automatic WLM documentation explains queue priorities and eligible concurrency scaling. Scaling can move eligible queries out of a busy queue, but it does not repair a poor plan, unbounded workload, or missing ownership.
Observe the plan before changing capacity
Use system evidence to connect a user-visible symptom to a constrained stage:
- Separate queue delay from execution delay.
- Find the query class, priority, status, and repeated plan shape.
- Measure scanned bytes, returned rows, spill, redistribution, skew, and blocked work.
- Compare the same query against representative table statistics and data volume.
- Change one layout, query, or workload policy at a time, then rerun the evidence.
SYS_QUERY_HISTORY provides one row per user query with accumulated fields for running and completed work. Automatic table actions are visible separately.
Primary-key and foreign-key declarations are informational to the Redshift optimizer; Redshift does not enforce them. Do not declare a relationship unless the data pipeline preserves it.
Load and transform data in bounded stages
Large analytical systems need explicit ownership from source to serving table.
1 Register
Land immutable input
Write source files with a stable batch identity, schema contract, and retention policy.
2 Ingest
Load in parallel
Use
COPYfrom supported object storage formats instead of many row-by-row inserts.3 Reconcile
Validate before publish
Reconcile row counts, rejected records, keys, nulls, and business totals in a staging boundary.
4 Release
Promote one version
Make the accepted table or partition visible and retain enough lineage to replay or roll back.
Materialized views can persist expensive results, and Spectrum can query external data in S3. Neither choice removes freshness, ownership, authorization, or cost decisions. Define who refreshes a view, how stale it may be, and whether an external table is authoritative or a serving copy.
Operate Redshift as a production data system
Use controls that expose failure instead of hiding it:
- Data correctness
- make loads idempotent by batch or object identity;
- reconcile source and target totals before promotion;
- keep schema changes backward compatible across producers and consumers.
- Performance
- inspect plans and query history before resizing;
- monitor skew, unsorted data, stale statistics, spill, queue time, and concurrency-scaling usage;
- test automatic and explicit designs against the same representative workload.
- Security
- separate database roles by workload and data domain;
- use narrowly scoped IAM roles for
COPY,UNLOAD, and external access; - audit query and data-access paths, not only console administration.
- Recovery
- define snapshot or recovery-point objectives for the selected deployment mode;
- rehearse restoring data and dependent grants into an isolated environment;
- preserve source objects and transformation lineage long enough to replay critical datasets.
When a dashboard slows down, ask four questions in order: did it wait, did it scan more, did it move more, or did one slice do more? Each answer points to different evidence and a different control.