获取大数据时插入操作暂停

时间:2017-09-18 08:17:25

标签: sql sql-server indexing fetch sql-insert

我不断地将值插入到具有相同结构的表3表中

    Table1 (col1 bigint primary key,col2 bigint,col3 int,col4 datetime,col5 varchar(400),col6 float,
    col7 numeric(18,6),col8 numeric(18,6),col9 float,col10 datetime,col11 int,col12 int,col13 bit,col14 varchar(20),col15 varchar(10))

Table2 (col1 bigint primary key,col2 bigint,col3 int,col4 datetime,col5 varchar(400),col6 float,
col7 numeric(18,6),col8 numeric(18,6),col9 float,col10 datetime,col11 int,col12 int,col13 bit,col14 varchar(20),col15 varchar(10))

Table3 (col1 bigint primary key,col2 bigint,col3 int,col4 datetime,col5 varchar(400),col6 float,
col7 numeric(18,6),col8 numeric(18,6),col9 float,col10 datetime,col11 int,col12 int,col13 bit,col14 varchar(20),col15 varchar(10))

我将Table1中的数据存储在表1中,持续1天,表3中为一周,表3中存储为1个月每天凌晨1点,我从表1中删除昨天的数据,7天前从表2中删除数据

月更改时我更改月表table3(table3_jan,table3_feb等)

我在所有表(列col2和col4)

上设置了非索引

目前我在table3_sept中有30 GB的数据,并且每天都会增加

快速插入上述3个表格

现在,当我从Table3获取15天数据并插入#temp表时。 当查询执行时,所有插入操作都被释放 插入操作获取简历。

select * into #temp from table3 or other table where date between '1 aug 2017' and '17 aug 2017' order by id desc

所以我的问题是如何避免这个暂停过程 他们是否创建了任何错误的表结构 请高度优先帮助我。谢谢

0 个答案:

没有答案