将15亿条记录加载到Azure SQL数据仓库中的表中 [英] 1.5 Billion records to load into a table in azure sql data warehouse

查看:67
本文介绍了将15亿条记录加载到Azure SQL数据仓库中的表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

如果我做错了事,请您帮我一下,并纠正我.我是Azure SQL数据仓库的新手.我在一个表中有15亿条记录,我必须加载到另一个表中.每月大约有100 +百万条记录.以下是目的地 我按周创建分区表,并在Partition中添加52个星期日期.以下是我创建表格的方式

Can you please help me out and correct me if i doing anything wrong. I am new to Azure SQL Data Warehouse. I have 1.5 Billion records in a table, i have to load into another table. Per Month there are about 100 + million records. Below is the destination table I created partition by week and add 52 week dates in Partition . below is how i am creating the table 

创建表
(

xx

,xx

谢谢

库马尔

推荐答案

您好,库马克夫,

Hi Kumarkv,

一种非常常见的方法是按日期对表进行分区,该分区是通过 创建的DATE列.

A very common method is to partition the tables by date, where the partition is created via  a DATE column. 

在SQL中对表进行分区数据仓库

请通过提供的链接查看此示例:

Please see this example from the link provided:

创建表[dbo].[FactInternetSales]
(
    [ProductKey]                                     int        非空
,   [OrderDateKey]         int        非空
,   [CustomerKey]                                   int        非空
,   [PromotionKey] int        非空
,   [SalesOrderNumber] nvarchar(20)NOT NULL
,   [OrderQuantity] smallint    非空
,   [单价]钱      非空
,   [SalesAmount]                                   钱      非空
)
WITH
(  集群的COLUMNSTORE索引
,  分布=哈希([ProductKey])
,  分区(   [OrderDateKey]值的权限范围
                    (20000101,20010101,20020101
                    ,20030101,20040101,20050101
                    )
                             )
)
;

CREATE TABLE [dbo].[FactInternetSales]
(
    [ProductKey]            int          NOT NULL
,   [OrderDateKey]          int          NOT NULL
,   [CustomerKey]           int          NOT NULL
,   [PromotionKey]          int          NOT NULL
,   [SalesOrderNumber]      nvarchar(20) NOT NULL
,   [OrderQuantity]         smallint     NOT NULL
,   [UnitPrice]             money        NOT NULL
,   [SalesAmount]           money        NOT NULL
)
WITH
(   CLUSTERED COLUMNSTORE INDEX
,   DISTRIBUTION = HASH([ProductKey])
,   PARTITION   (   [OrderDateKey] RANGE RIGHT FOR VALUES
                    (20000101,20010101,20020101
                    ,20030101,20040101,20050101
                    )
                )
)
;

如果还有其他问题,请告诉我们.

Please let us know if you have any additional questions.


这篇关于将15亿条记录加载到Azure SQL数据仓库中的表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆