nerdexam
Amazon

DAS-C01 · Question #53

A large ride-sharing company has thousands of drivers globally serving millions of unique customers every day. The company has decided to migrate an existing data mart to Amazon Redshift. The…

The correct answer is C. Use DISTSTYLE KEY (destination) for the trips table and sort by date. The trips table is large and queried by destination (region) and date, so DISTSTYLE KEY on destination collocates rows with the same destination on the same slice, minimizing data movement during regional profitability joins and aggregations. A sort key on date optimizes…

Storage and Data Management

Question

A large ride-sharing company has thousands of drivers globally serving millions of unique customers every day. The company has decided to migrate an existing data mart to Amazon Redshift. The existing schema includes the following tables.

  • A trips fact table for information on completed rides.
  • A drivers dimension table for driver profiles.
  • A customers fact table holding customer profile information.

The company analyzes trip details by date and destination to examine profitability by region. The drivers data rarely changes. The customers data frequently changes. What table design provides optimal query performance?

Options

  • AUse DISTSTYLE KEY (destination) for the trips table and sort by date.
  • BUse DISTSTYLE EVEN for the trips table and sort by date.
  • CUse DISTSTYLE KEY (destination) for the trips table and sort by date.
  • DUse DISTSTYLE EVEN for the drivers table and sort by date.

How the community answered

(39 responses)
  • A
    8% (3)
  • B
    3% (1)
  • C
    74% (29)
  • D
    15% (6)

Explanation

The trips table is large and queried by destination (region) and date, so DISTSTYLE KEY on destination collocates rows with the same destination on the same slice, minimizing data movement during regional profitability joins and aggregations. A sort key on date optimizes range-based date filtering. The drivers table is small and rarely changes, making DISTSTYLE ALL ideal - a full copy on every node eliminates join shuffling. The customers table changes frequently, so DISTSTYLE EVEN distributes rows uniformly to avoid hotspots. This combination (KEY on trips, ALL on drivers, EVEN on customers) is the textbook optimal design for this schema.

Topics

#Redshift#Data Modeling#Performance Optimization#Distribution Strategy

Community Discussion

No community discussion yet for this question.

Full DAS-C01 Practice