【发布时间】:2018-11-05 08:57:54
【问题描述】:
我们计划将 OLTP 关系表导入 AWS Redshift。 CustomerTransaction 表连接到多个查找表。我只包括了 3 个,但我们还有更多。
客户交易表上的排序键应该是什么?在常规 SQL 服务器中,我们在 CustomerTransaction 表中的外键上有非聚集索引。 对于 AWS Redshift,我应该对 CustomerTransaction 中的外键列使用复合排序键还是交错排序?此表设计的最佳索引策略是什么。 谢谢,
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)
.....
}
【问题讨论】:
标签: sql performance amazon-web-services amazon-redshift