You are here: Re: Speeding up inserts « MsSQL Server « IT news, forums, messages
Re: Speeding up inserts

Posted by Erland Sommarskog on 10/01/63 11:18

Matik (marzec@sauron.xo.pl) writes:
> Just short question:
> I have tables, which are only log tables (very less used for selects),
> but there is a lotof writing.
> I would like to have as much speed as possible by writing data into
> this tables.
>
> create table [tbl] (
> [IDX] [numeric](18, 0) IDENTITY (1, 1) NOT NULL ,
> [Time_Stamp] [datetime] NOT NULL ,
> [Source] [varchar] (64) COLLATE Latin1_General_CI_AS NULL ,
> [Type] [varchar] (16) COLLATE Latin1_General_CI_AS NULL ,
> [MsgText] [varchar] (512) COLLATE Latin1_General_CI_AS NULL ,
> CONSTRAINT [tbl] PRIMARY KEY NONCLUSTERED
> (
> [IDX]
> ) ON [PRIMARY]
> ) ON [PRIMARY]
> GO
> Question:
> Is it better for inserts,, to remove PK but leave identity insert?
> How to make this table optimized for writing?
> If I will set fill level of the table with 0%, will I winn much?

I would make the primary key clustered, to insert all rows at the
end. Now you have a heap, and rows will be inserted at the end
too, but when you remove rows, there could be some problems.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация