Reputation: 1802
I am new to Amazon Redshift. Trying to figure out best way to join two tables in redshift.
I have 1 table with 2.3 billion records and the id column has datatype varchar(40) with sort key and dist key.
Doing left join with other table having 23 million records on same column id - sort key and dist key.
The query takes hours to execute. Is there anything I am doing wrong here?
Upvotes: 1
Views: 1002
Reputation: 139
See if you have alerts on STL_ALERT_EVENT_LOG table, you can also use 'EXPLAIN' on your query and check does your query is using typically the fastest join(Merge Join). You should also identifying tables with data skew or unsorted rows(see Redshift documentation)
Upvotes: 1