QuestionQ102

Data Operations and Support

A company operates a data-processing pipeline that runs multiple SQL queries sequentially against an Amazon Redshift cluster. The company merges with another company. The original company changes a query that aggregates sales-revenue data so that it joins sales tables from both companies. The first company’s sales table is named Table S1. The second company’s sales table is named Table S2. Table S1 has 10 billion records. Table S2 has 900 million records.

The query becomes slow after the change. A data engineer must improve query performance.

Which solutions meet these requirements?

Choose two
  • A Use the KEY distribution style for both sales tables. Select a low cardinality column to use for the join.
  • B Use the KEY distribution style for both sales tables. Select a high cardinality column to use for the join.
  • C Use the EVEN distribution style for Table S1. Use the ALL distribution style for Table S2.
  • D Use the Amazon Redshift query optimizer to review and select optimizations to implement.
  • E Use Amazon Redshift Advisor to review and select optimizations to implement.
Explanation

KEY distribution on the common, high-cardinality join column places matching rows from both sales tables on the same node slices, minimizing data redistribution and avoiding skew during the join. Amazon Redshift Advisor analyzes cluster workload and supplies recommendations, including ALTER TABLE statements for beneficial distribution styles and distribution keys. ALL distribution replicates an entire table to every node and increases storage, load, and maintenance costs, so it is not appropriate for a 900-million-record sales table.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!