Your question is Mitigate Data Skew in Joins. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
What is data skew, and what strategies would you use to mitigate it in a large-scale join operation?
Using the provided PostgreSQL tables, demonstrate one SQL-based mitigation by assigning four deterministic salt buckets to fact rows and replicating dimension rows across those buckets. Flag join keys with at least three fact rows.
event_id, customer_id, event_type, segment, salt_bucket, key_event_count, and is_skewed.customer_id and event_id.| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| customer_id | VARCHAR(30) | Customer associated with the event |
| event_type | VARCHAR(20) | Type of customer event |
| event_date | DATE | Date the event occurred |
| Column | Type | Description |
|---|---|---|
| customer_idPK | VARCHAR(30) | Unique customer identifier |
| segment | VARCHAR(20) | Customer segment |
| region | VARCHAR(20) | Customer operating region |