Pro ยท Lesson 6 of 9

Table design

Start with AUTO distribution, sort, and encoding. Override them when you can name the join, the filter, and the skew.

Sign in to save your place.

Picture it this way

Distribution is which waiter holds which orders. If two waiters must trade every plate to answer a question, dinner is slow. A sort key is the order of plates on one waiter's arm, so they can skip the ones that are obviously wrong. AUTO means you let Redshift watch the real questions and adjust those choices.

AUTO first, then a reason to override

New tables should start with automatic table optimization: DISTSTYLE AUTO, SORTKEY AUTO, and ENCODE AUTO. Redshift can change distribution and sort as it sees queries. That is the 2026 default, not a hint you add after a crisis. Override it when you already know the join key and the filter, and you have looked at skew.

CREATE TABLE analytics.orders (
    order_id BIGINT,
    customer_id BIGINT,
    ordered_at DATE,
    amount NUMERIC(12, 2)
)
DISTSTYLE AUTO
SORTKEY AUTO
ENCODE AUTO;
StyleRows goUse when
AUTORedshift chooses, and can changeYou are not sure yet
KEYRows with the same key share a sliceLarge tables join on that key
EVENRows are spread round-robinThere is no good join key
ALLA full copy on every nodeA small dimension that everyone joins

Interleaved sort keys are a legacy option. Prefer a compound sort on the columns you filter in order, or leave sort on AUTO. A sort key helps a WHERE on a prefix of that key. It does not help a function wrapped around the column.

Skew and encodings

Key distribution on a column that is almost always the same value parks the rows on one slice. That slice works while the others wait. Check skew before you congratulate yourself on a key. ALL is only for tables small enough to copy everywhere. A fact table marked ALL will waste storage and load time.

Encoding compresses columns. AUTO picks encodings. Do not hand-tune encodings on day one. Vacuum and analyze are largely automatic on current RA3 and Serverless warehouses. You still need to know the words, because an old cluster or a deleted-row heavy table can need a manual vacuum. Design the table so the load does not depend on a weekly rescue.

Three choices on a table

Where rows live, what order they are stored in, and how they are compressed.

  1. DistributionWhich slice holds each row
  2. Sort keyOrder of rows on disk
  3. EncodingHow columns are compressed

Step 1 of 3A DISTKEY on a join column puts matching rows on the same slice. DISTSTYLE ALL copies a small table everywhere. AUTO lets Redshift choose.

CREATE TABLE sales (...) DISTKEY(customer_id);

Practice

Create one table with AUTO for distribution, sort, and encoding. Write one sentence that says which column you would switch to KEY if the automatic choice proved wrong, and why that column is not a constant.

Knowledge check

What should a new table use when you are unsure?

When is KEY distribution a mistake?

What is ALL distribution for?

Official sources

Checked against vendor documentation in October 2026. Screens and plan names still change, so confirm the control in your own instance.