We plan to import OLTP Relational tables into AWS Redshift. The CustomerTransaction table joins to multiple lookup tables. I only included 3, but we have more.
What should Sort Key be on Customer Transaction Table? In regular SQL server, we have nonclustered indexes on the foreign keys in CustomerTransaction table. For AWS Redshift, Should I use compound sort keys or interleaved sort on foreign key columns in CustomerTransaction? What is the best indexing strategy for this table design. Thanks,
create table.dbo CustomerTransaction
{
CustomerTransactionId bigint primary key identity(1,1),
ProductTypeId bigint, -- foreign keys to Product Type Table
StatusTypeID bigint -- Foreign keys to StatusTypeTable
DateOfPurchase date,
PurchaseAmount float,
....
}
create table dbo.ProductType
{
CustomerTransactionId bigint primary key identity(1,1),
ProductName varchar(255),
ProductDescription varchar(255)
.....
}
create table dbo.StatusType
{
StatusTypeId bigint primary key identity(1,1),
StatusTypeName varchar(255),
StatusDescription varchar(255)
.....
}