0

我有一张tbl_ECR_ProductData近 92356143 行的表。每周将 100000 行导入此表。

该表有 16 列,其中 2 列构成主键,其余列的类型为varchar.

我的问题是当我根据剩余的列值搜索表格时.. 它需要很长时间,将近 10 分钟。

我怎样才能最大限度地减少时间?请在这方面帮助我..感谢您的帮助...提前致谢!表结构如下

CREATE TABLE [tbl_ECR_ProductData]( [Serial Number] [varchar](255) NOT NULL, [Act Number] [varchar](255) NULL, [Act Date] [datetime] NULL, [Act Location] [varchar](255) NOT NULL, [Manufacturer] [varchar](255) NULL, [ManufacturerPN] [varchar](255) NULL, [Act Description] [varchar](255) NULL, [Act PtNumber] [varchar](255) NULL, [Act Code] [varchar](255) NULL, [Act DateCode] [varchar](255) NULL, [Pmrl] [varchar](255) NULL, [Act ReceiveDate] [datetime] NULL, [Act Channel] [varchar](255) NULL, [Act Supplier] [varchar](255) NULL, [ImportDate] [datetime] NULL
CONSTRAINT [PK_tbl_ECR_ProductData] PRIMARY KEY CLUSTERED ( [Serial Number] ASC, [Act Location] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY] )

4

1 回答 1

4

不看代码很难说如何将时间最小化。但是,这些下面的链接应该可以帮助您找出问题所在并可能解决它们。我觉得这些很有帮助。

http://www.simple-talk.com/sql/performance/finding-the-causes-of-poor-performance-in-sql-server,-part-1/

http://www.simple-talk.com/sql/performance/finding-the-causes-of-poor-performance-in-sql-server,-part-2/

于 2012-04-10T11:45:01.923 回答