Rahul Gupta
Rahul Gupta

Reputation: 1802

Redshift join with varchar(40) and 2.3 billions rows

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

Answers (1)

opax
opax

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

Related Questions