You can specify primary and foreign keys in an Amazon Redshift table to uniquely identify a record in the table.
Amazon Redshift query planner uses the primary and foreign key relationships in the query planner. When you perform an upsert operation, you must define a primary key.