Timeout expired. The timeout period elapsed prior to completion of the operation or the server...
来源:互联网 发布:海岛奇兵科技升级数据 编辑:程序博客网 时间:2024/06/06 20:26
问题:
最近程序总会抛出如下异常:
An exception of type'System.Data.SqlClient.SqlException' occurred and was caught.
----------------------------------------------------------------------------------
Type :System.Data.SqlClient.SqlException, System.Data, Version=4.0.0.0,Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Timeoutexpired. The timeout period elapsedprior to completion of the operation or the server is not responding.
Source : .Net SqlClient Data Provider......
......Database.ExecuteReader(DbCommandcommand)......
读取数据超时。
然后就去看了下DataBase里对应的tables,发现table的结构简单,但是数据量很大,有几十万上百万条。再看一下有没有建Indexes/Keys,发现没有,恍然大悟。
解决方法:
根据表的结构,建立了Indexes/Keys下的 Unique key,类似如下:
ALTER TABLE [dbo].[ZData] add CONSTRAINT [IX_ZData] UNIQUE NONCLUSTERED ([Pid] ASC,[EntryID] ASC,[Date] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]GO测试,发现速度快很多,减小了timeout的风险。
0 0
- Timeout expired , The timeout period elapsed prior to completion of the operation or the server
- Timeout expired , The timeout period elapsed prior to completion of the operation or the server
- Timeout expired , The timeout period elapsed prior to completion of the operation or the server
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server...
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
- Error: timeout expired. the timeout period elapsed prior to completion of the operation or the server is not responding (Microso
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is n
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is no
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is no
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server is no
- .Net 连接池的配置Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.”
- mysql Timeout expired. The timeout period elapsed prior to completio
- Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This ma
- Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool.
- timeout expired.then timeout period elapsed prior to obtaining a connection from the pool.……
- error code 121:The semaphore timeout period has expired.
- 在Win7下安装ubuntukylin-14.04.2-desktop-amd64
- Tika基本使用
- Java内存泄露的理解与解决
- 域名同一文件路径,不同的域名指向不同的robots文件
- 第3周项目1-三角形类的构造函数(1、带参数的构造函数)
- Timeout expired. The timeout period elapsed prior to completion of the operation or the server...
- 【深入浅出IOS开发】IOS绘图基础
- mysql数据库千万级别数据的查询优化和分页测试
- Java基础-14
- Java web项目利用POI导出excel
- 14 css(已解决)图片垂直居中 父元素为relative且height未知(chrome)
- 面向对象中的注意点
- hdu2177取(2堆)石子游戏
- 【深入浅出IOS开发】绘制图片