AWS Data Engineer DEA-C01 · Data Store Management · medium

In Amazon Redshift, a 4-billion-row fact_orders table is frequently joined with a 600-million-row fact_shipments table on the order_id column. Both tables are too large to copy in full onto every compute node. Which Redshift Distribution Style should you configure on both tables to co-locate matching order_id rows on the same compute node slices and eliminate network broadcast/redistribution traffic during joins?

Published · Last updated · checked before publication — how we verify questions

Options

  • ADISTSTYLE ALL on both the 4B-row and 600M-row fact tables
  • BDISTSTYLE KEY with DISTKEY (order_id) on both tablesCorrect answer
  • CDISTSTYLE EVEN with no sort keys on either fact table
  • DS3 Glacier Deep Archive storage class on the join key

Answer: B. DISTSTYLE KEY with DISTKEY (order_id) on both tables

DISTSTYLE KEY with DISTKEY (order_id) on both tables is correct. Redshift hashes the distribution key value and sends each row to a slice based on that hash, so rows from fact_orders and fact_shipments that share an order_id land on the same slice. The join can then run locally on each node, a collocated join, with no broadcast or redistribution of rows over the network. The rule is that when two large tables are joined often, you distribute both on the join column, and the column should have high cardinality and even spread so no slice becomes a hotspot. The common trap is choosing ALL because it also avoids network movement. ALL copies the full table to every node, which only suits small, slowly changing dimension tables. Another trap is choosing EVEN, which balances storage but ignores join patterns. Always confirm the plan shows DS_DIST_NONE rather than DS_DIST_BOTH or DS_BCAST_INNER.

Why the other options are wrong

  • A. DISTSTYLE ALL on both the 4B-row and 600M-row fact tables — DISTSTYLE ALL stores a full copy of the table on every node. That multiplies storage and slows loads for a 4-billion-row table, and the question rules it out by saying the tables are too large to copy to every node. It is meant for small dimension tables.
  • C. DISTSTYLE EVEN with no sort keys on either fact table — DISTSTYLE EVEN spreads rows round-robin across slices without looking at column values. Matching order_id rows end up on different slices, so each join must redistribute or broadcast data, which shows up as DS_DIST_BOTH or similar steps. Sort keys are a separate feature and do not affect where rows are placed.
  • D. S3 Glacier Deep Archive storage class on the join key — S3 Glacier Deep Archive is an archival storage class for rarely accessed S3 objects with retrieval delays measured in hours. It is not a Redshift distribution style and cannot co-locate join keys on compute nodes.

All Data Store Management questions and the topic overview →

AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.