Showing posts with label nvarchar. Show all posts
Showing posts with label nvarchar. Show all posts

Wednesday, March 28, 2012

Insert/Update too slow

Hi,

I have a table with 110 nvarchar (255) columns in the database. I receive the data from the server (array) and them loop through it to insert the data into the database. The problem is it takes more than 3 minutes to insert (or update) (in memory) the 310 records it got from the array. I am reusing the Statement (with parameters). How could I improve the performance?

It's really a small quantity of data, the CPU in the device is 520Mhz... it should be alright!

Can aynone help me please?

Thanks

You can read some performance improvement topics here:

SQL Compact Edition Insert Performance

Tuning SQL Compact Edition Insert Performance

I hope these help you get the performance you want.

|||I've recently found a great article about SQL Server CE insert performance:
http://www.pocketpcdn.com/articles/articles.php?&atb.set(a_id)=11003&atb.set(c_id)=74&atb.perform(details)=&

In brief: OLE DB is the fastest method. When you want to stick to managed code try SqlCeResultSet

|||Thanks Guys!

I'll try that!

Cheers
|||I made the changes and the improvement was about 10X... amazing!!

Also the code is much clear now.

I am using this approach (ResultSet) for Updating and Seeking records as well.

I am happy now!

Insert/Update too slow

Hi,

I have a table with 110 nvarchar (255) columns in the database. I receive the data from the server (array) and them loop through it to insert the data into the database. The problem is it takes more than 3 minutes to insert (or update) (in memory) the 310 records it got from the array. I am reusing the Statement (with parameters). How could I improve the performance?

It's really a small quantity of data, the CPU in the device is 520Mhz... it should be alright!

Can aynone help me please?

Thanks

You can read some performance improvement topics here:

SQL Compact Edition Insert Performance

Tuning SQL Compact Edition Insert Performance

I hope these help you get the performance you want.

|||I've recently found a great article about SQL Server CE insert performance:
http://www.pocketpcdn.com/articles/articles.php?&atb.set(a_id)=11003&atb.set(c_id)=74&atb.perform(details)=&

In brief: OLE DB is the fastest method. When you want to stick to managed code try SqlCeResultSet

|||Thanks Guys!

I'll try that!

Cheers
|||I made the changes and the improvement was about 10X... amazing!!

Also the code is much clear now.

I am using this approach (ResultSet) for Updating and Seeking records as well.

I am happy now!

Wednesday, March 21, 2012

INSERT TIMEOUT

I got a completely independent log table, which I mean
there is no relationship with other tables. its columns
look like
nvarchar(16), nvarchar(16), nvarchar(16), int, tinyint,
tinyint, varchar(3),smalldatetime.
it works fine before the amount of its records reaches 10
millions around. afterwards, the insertion of one record
in ASP may return an ODBC Timeout Error. when this
happens, the only way to insert a record which I can
imagine is to run the same stored procedure in Query
Analyzer, Guess how long it took? 70 seconds!
the strangest thing is, after the 70 seconds insertion,
the next insertion only takes 1 second or less, at that
time, ASP page works again.
My SQL server is SQL2000+sp3
I noticed the same problem was reported in this newsgroup
two years ago, somebody suggested using aba_lockinfo to
figure it out, I will try it when the problem happens
again. In the meantime, I wonder if anybody got a better
solution, or knew what was the main reason of this problem.
Thanks,
Mingfa MaSounds like you may have page splitting going on and a really slow disk
subsystem. What is the actual DDL including indexes for the table and a
sample of the inserted row? You could also have blocking issues which can
be found with sp_who2.
--
Andrew J. Kelly
SQL Server MVP
"Mingfa Ma" <mingfa@.commonname.com> wrote in message
news:03e701c34b8d$d8c13b00$a001280a@.phx.gbl...
> I got a completely independent log table, which I mean
> there is no relationship with other tables. its columns
> look like
> nvarchar(16), nvarchar(16), nvarchar(16), int, tinyint,
> tinyint, varchar(3),smalldatetime.
> it works fine before the amount of its records reaches 10
> millions around. afterwards, the insertion of one record
> in ASP may return an ODBC Timeout Error. when this
> happens, the only way to insert a record which I can
> imagine is to run the same stored procedure in Query
> Analyzer, Guess how long it took? 70 seconds!
> the strangest thing is, after the 70 seconds insertion,
> the next insertion only takes 1 second or less, at that
> time, ASP page works again.
> My SQL server is SQL2000+sp3
> I noticed the same problem was reported in this newsgroup
> two years ago, somebody suggested using aba_lockinfo to
> figure it out, I will try it when the problem happens
> again. In the meantime, I wonder if anybody got a better
> solution, or knew what was the main reason of this problem.
> Thanks,
> Mingfa Ma
>|||Thanks, Andrew,
but what do you mean "the actual DDL"? how to get it?
here is the sample of the inserted row,
626995265,1052399332,Dering Harbor,0,20,100,US,2003-07-15
02:23:00
Mingfa Ma
>--Original Message--
>Sounds like you may have page splitting going on and a
really slow disk
>subsystem. What is the actual DDL including indexes for
the table and a
>sample of the inserted row? You could also have
blocking issues which can
>be found with sp_who2.
>--
>Andrew J. Kelly
>SQL Server MVP
>
>"Mingfa Ma" <mingfa@.commonname.com> wrote in message
>news:03e701c34b8d$d8c13b00$a001280a@.phx.gbl...
>> I got a completely independent log table, which I mean
>> there is no relationship with other tables. its columns
>> look like
>> nvarchar(16), nvarchar(16), nvarchar(16), int, tinyint,
>> tinyint, varchar(3),smalldatetime.
>> it works fine before the amount of its records reaches
10
>> millions around. afterwards, the insertion of one record
>> in ASP may return an ODBC Timeout Error. when this
>> happens, the only way to insert a record which I can
>> imagine is to run the same stored procedure in Query
>> Analyzer, Guess how long it took? 70 seconds!
>> the strangest thing is, after the 70 seconds insertion,
>> the next insertion only takes 1 second or less, at that
>> time, ASP page works again.
>> My SQL server is SQL2000+sp3
>> I noticed the same problem was reported in this
newsgroup
>> two years ago, somebody suggested using aba_lockinfo to
>> figure it out, I will try it when the problem happens
>> again. In the meantime, I wonder if anybody got a better
>> solution, or knew what was the main reason of this
problem.
>> Thanks,
>> Mingfa Ma
>>
>
>.
>|||That is the definition of the table, indexes, etc. You can get this by
right clicking on the table in EM and choosing "All Tasks - Generate Sql
Script" and make sure you include the indexes, triggers etc.
--
Andrew J. Kelly
SQL Server MVP
"Mingfa Ma" <mingfa@.commonname.com> wrote in message
news:04ff01c34b9e$9ea475c0$a001280a@.phx.gbl...
> Thanks, Andrew,
> but what do you mean "the actual DDL"? how to get it?
> here is the sample of the inserted row,
> 626995265,1052399332,Dering Harbor,0,20,100,US,2003-07-15
> 02:23:00
>
> Mingfa Ma
>
> >--Original Message--
> >Sounds like you may have page splitting going on and a
> really slow disk
> >subsystem. What is the actual DDL including indexes for
> the table and a
> >sample of the inserted row? You could also have
> blocking issues which can
> >be found with sp_who2.
> >
> >--
> >
> >Andrew J. Kelly
> >SQL Server MVP
> >
> >
> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
> >news:03e701c34b8d$d8c13b00$a001280a@.phx.gbl...
> >> I got a completely independent log table, which I mean
> >> there is no relationship with other tables. its columns
> >> look like
> >>
> >> nvarchar(16), nvarchar(16), nvarchar(16), int, tinyint,
> >> tinyint, varchar(3),smalldatetime.
> >>
> >> it works fine before the amount of its records reaches
> 10
> >> millions around. afterwards, the insertion of one record
> >> in ASP may return an ODBC Timeout Error. when this
> >> happens, the only way to insert a record which I can
> >> imagine is to run the same stored procedure in Query
> >> Analyzer, Guess how long it took? 70 seconds!
> >>
> >> the strangest thing is, after the 70 seconds insertion,
> >> the next insertion only takes 1 second or less, at that
> >> time, ASP page works again.
> >>
> >> My SQL server is SQL2000+sp3
> >>
> >> I noticed the same problem was reported in this
> newsgroup
> >> two years ago, somebody suggested using aba_lockinfo to
> >> figure it out, I will try it when the problem happens
> >> again. In the meantime, I wonder if anybody got a better
> >> solution, or knew what was the main reason of this
> problem.
> >>
> >> Thanks,
> >>
> >> Mingfa Ma
> >>
> >>
> >
> >
> >.
> >|||Sorry, I mistook DDL as DLL.
the table is very simple, no index, no trigger.
Here is the definition of the table
if exists (select * from dbo.sysobjects where id =object_id(N'[dbo].[n2_tblLogUserQuery]') and OBJECTPROPERTY
(id, N'IsUserTable') = 1)
drop table [dbo].[n2_tblLogUserQuery]
GO
CREATE TABLE [dbo].[n2_tblLogUserQuery] (
[UID] [nvarchar] (16) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[SID] [nvarchar] (16) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[Query] [nvarchar] (128) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[CommonNameID] [int] NULL ,
[Type] [tinyint] NULL ,
[App] [tinyint] NULL ,
[CountryCode] [varchar] (3) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[LogDate] [smalldatetime] NULL
) ON [PRIMARY]
GO
>--Original Message--
>That is the definition of the table, indexes, etc. You
can get this by
>right clicking on the table in EM and choosing "All
Tasks - Generate Sql
>Script" and make sure you include the indexes, triggers
etc.
>--
>Andrew J. Kelly
>SQL Server MVP
>
>"Mingfa Ma" <mingfa@.commonname.com> wrote in message
>news:04ff01c34b9e$9ea475c0$a001280a@.phx.gbl...
>> Thanks, Andrew,
>> but what do you mean "the actual DDL"? how to get it?
>> here is the sample of the inserted row,
>> 626995265,1052399332,Dering Harbor,0,20,100,US,2003-07-
15
>> 02:23:00
>>
>> Mingfa Ma
>>
>> >--Original Message--
>> >Sounds like you may have page splitting going on and a
>> really slow disk
>> >subsystem. What is the actual DDL including indexes
for
>> the table and a
>> >sample of the inserted row? You could also have
>> blocking issues which can
>> >be found with sp_who2.
>> >
>> >--
>> >
>> >Andrew J. Kelly
>> >SQL Server MVP
>> >
>> >
>> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
>> >news:03e701c34b8d$d8c13b00$a001280a@.phx.gbl...
>> >> I got a completely independent log table, which I
mean
>> >> there is no relationship with other tables. its
columns
>> >> look like
>> >>
>> >> nvarchar(16), nvarchar(16), nvarchar(16), int,
tinyint,
>> >> tinyint, varchar(3),smalldatetime.
>> >>
>> >> it works fine before the amount of its records
reaches
>> 10
>> >> millions around. afterwards, the insertion of one
record
>> >> in ASP may return an ODBC Timeout Error. when this
>> >> happens, the only way to insert a record which I can
>> >> imagine is to run the same stored procedure in Query
>> >> Analyzer, Guess how long it took? 70 seconds!
>> >>
>> >> the strangest thing is, after the 70 seconds
insertion,
>> >> the next insertion only takes 1 second or less, at
that
>> >> time, ASP page works again.
>> >>
>> >> My SQL server is SQL2000+sp3
>> >>
>> >> I noticed the same problem was reported in this
>> newsgroup
>> >> two years ago, somebody suggested using aba_lockinfo
to
>> >> figure it out, I will try it when the problem happens
>> >> again. In the meantime, I wonder if anybody got a
better
>> >> solution, or knew what was the main reason of this
>> problem.
>> >>
>> >> Thanks,
>> >>
>> >> Mingfa Ma
>> >>
>> >>
>> >
>> >
>> >.
>> >
>
>.
>|||You have no indexes at all? Is there anyone running selects on this table?
If so they will most likely take out a table lock and block the insert until
done. Just curious if the UID and SID are just numbers why ar eyou using a
NVARCHAR vs a regular VARCHAR or even an INT? You might consider placing a
clustered index on the table but you need to decide how you access it to
determine the proper column to use.
--
Andrew J. Kelly
SQL Server MVP
"Mingfa Ma" <mingfa@.commonname.com> wrote in message
news:0c0401c34bb0$61ec76c0$a501280a@.phx.gbl...
> Sorry, I mistook DDL as DLL.
> the table is very simple, no index, no trigger.
> Here is the definition of the table
> if exists (select * from dbo.sysobjects where id => object_id(N'[dbo].[n2_tblLogUserQuery]') and OBJECTPROPERTY
> (id, N'IsUserTable') = 1)
> drop table [dbo].[n2_tblLogUserQuery]
> GO
> CREATE TABLE [dbo].[n2_tblLogUserQuery] (
> [UID] [nvarchar] (16) COLLATE
> SQL_Latin1_General_CP1_CI_AS NULL ,
> [SID] [nvarchar] (16) COLLATE
> SQL_Latin1_General_CP1_CI_AS NULL ,
> [Query] [nvarchar] (128) COLLATE
> SQL_Latin1_General_CP1_CI_AS NULL ,
> [CommonNameID] [int] NULL ,
> [Type] [tinyint] NULL ,
> [App] [tinyint] NULL ,
> [CountryCode] [varchar] (3) COLLATE
> SQL_Latin1_General_CP1_CI_AS NULL ,
> [LogDate] [smalldatetime] NULL
> ) ON [PRIMARY]
> GO
>
>
> >--Original Message--
> >That is the definition of the table, indexes, etc. You
> can get this by
> >right clicking on the table in EM and choosing "All
> Tasks - Generate Sql
> >Script" and make sure you include the indexes, triggers
> etc.
> >
> >--
> >
> >Andrew J. Kelly
> >SQL Server MVP
> >
> >
> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
> >news:04ff01c34b9e$9ea475c0$a001280a@.phx.gbl...
> >> Thanks, Andrew,
> >>
> >> but what do you mean "the actual DDL"? how to get it?
> >>
> >> here is the sample of the inserted row,
> >>
> >> 626995265,1052399332,Dering Harbor,0,20,100,US,2003-07-
> 15
> >> 02:23:00
> >>
> >>
> >> Mingfa Ma
> >>
> >>
> >> >--Original Message--
> >> >Sounds like you may have page splitting going on and a
> >> really slow disk
> >> >subsystem. What is the actual DDL including indexes
> for
> >> the table and a
> >> >sample of the inserted row? You could also have
> >> blocking issues which can
> >> >be found with sp_who2.
> >> >
> >> >--
> >> >
> >> >Andrew J. Kelly
> >> >SQL Server MVP
> >> >
> >> >
> >> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
> >> >news:03e701c34b8d$d8c13b00$a001280a@.phx.gbl...
> >> >> I got a completely independent log table, which I
> mean
> >> >> there is no relationship with other tables. its
> columns
> >> >> look like
> >> >>
> >> >> nvarchar(16), nvarchar(16), nvarchar(16), int,
> tinyint,
> >> >> tinyint, varchar(3),smalldatetime.
> >> >>
> >> >> it works fine before the amount of its records
> reaches
> >> 10
> >> >> millions around. afterwards, the insertion of one
> record
> >> >> in ASP may return an ODBC Timeout Error. when this
> >> >> happens, the only way to insert a record which I can
> >> >> imagine is to run the same stored procedure in Query
> >> >> Analyzer, Guess how long it took? 70 seconds!
> >> >>
> >> >> the strangest thing is, after the 70 seconds
> insertion,
> >> >> the next insertion only takes 1 second or less, at
> that
> >> >> time, ASP page works again.
> >> >>
> >> >> My SQL server is SQL2000+sp3
> >> >>
> >> >> I noticed the same problem was reported in this
> >> newsgroup
> >> >> two years ago, somebody suggested using aba_lockinfo
> to
> >> >> figure it out, I will try it when the problem happens
> >> >> again. In the meantime, I wonder if anybody got a
> better
> >> >> solution, or knew what was the main reason of this
> >> problem.
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Mingfa Ma
> >> >>
> >> >>
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >|||Correct, there is no indexes on the table as there is
nobody running selects on this table.
UID and SID are not numbers, but they can be changed to
varchar if that would make any difference.
It is whorthwhile pointing out that this table is not
being accessed frequently. 99.99% of time it is only used
to log incoming data and there are about 15 to 30 incoming
data to be recorded within a single second. I am pretty
sure nobody is runnng 'select' when the problem happens.
If creating an index on this table, would it not further
slow down this table? Also, this table can grow like 1
million records in a day, the index of the table would
also be very huge?
Mingfa Ma
>--Original Message--
>You have no indexes at all? Is there anyone running
selects on this table?
>If so they will most likely take out a table lock and
block the insert until
>done. Just curious if the UID and SID are just numbers
why ar eyou using a
>NVARCHAR vs a regular VARCHAR or even an INT? You might
consider placing a
>clustered index on the table but you need to decide how
you access it to
>determine the proper column to use.
>--
>Andrew J. Kelly
>SQL Server MVP
>
>"Mingfa Ma" <mingfa@.commonname.com> wrote in message
>news:0c0401c34bb0$61ec76c0$a501280a@.phx.gbl...
>> Sorry, I mistook DDL as DLL.
>> the table is very simple, no index, no trigger.
>> Here is the definition of the table
>> if exists (select * from dbo.sysobjects where id =>> object_id(N'[dbo].[n2_tblLogUserQuery]') and
OBJECTPROPERTY
>> (id, N'IsUserTable') = 1)
>> drop table [dbo].[n2_tblLogUserQuery]
>> GO
>> CREATE TABLE [dbo].[n2_tblLogUserQuery] (
>> [UID] [nvarchar] (16) COLLATE
>> SQL_Latin1_General_CP1_CI_AS NULL ,
>> [SID] [nvarchar] (16) COLLATE
>> SQL_Latin1_General_CP1_CI_AS NULL ,
>> [Query] [nvarchar] (128) COLLATE
>> SQL_Latin1_General_CP1_CI_AS NULL ,
>> [CommonNameID] [int] NULL ,
>> [Type] [tinyint] NULL ,
>> [App] [tinyint] NULL ,
>> [CountryCode] [varchar] (3) COLLATE
>> SQL_Latin1_General_CP1_CI_AS NULL ,
>> [LogDate] [smalldatetime] NULL
>> ) ON [PRIMARY]
>> GO
>>
>>
>> >--Original Message--
>> >That is the definition of the table, indexes, etc. You
>> can get this by
>> >right clicking on the table in EM and choosing "All
>> Tasks - Generate Sql
>> >Script" and make sure you include the indexes, triggers
>> etc.
>> >
>> >--
>> >
>> >Andrew J. Kelly
>> >SQL Server MVP
>> >
>> >
>> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
>> >news:04ff01c34b9e$9ea475c0$a001280a@.phx.gbl...
>> >> Thanks, Andrew,
>> >>
>> >> but what do you mean "the actual DDL"? how to get it?
>> >>
>> >> here is the sample of the inserted row,
>> >>
>> >> 626995265,1052399332,Dering Harbor,0,20,100,US,2003-
07-
>> 15
>> >> 02:23:00
>> >>
>> >>
>> >> Mingfa Ma
>> >>
>> >>
>> >> >--Original Message--
>> >> >Sounds like you may have page splitting going on
and a
>> >> really slow disk
>> >> >subsystem. What is the actual DDL including indexes
>> for
>> >> the table and a
>> >> >sample of the inserted row? You could also have
>> >> blocking issues which can
>> >> >be found with sp_who2.
>> >> >
>> >> >--
>> >> >
>> >> >Andrew J. Kelly
>> >> >SQL Server MVP
>> >> >
>> >> >
>> >> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
>> >> >news:03e701c34b8d$d8c13b00$a001280a@.phx.gbl...
>> >> >> I got a completely independent log table, which I
>> mean
>> >> >> there is no relationship with other tables. its
>> columns
>> >> >> look like
>> >> >>
>> >> >> nvarchar(16), nvarchar(16), nvarchar(16), int,
>> tinyint,
>> >> >> tinyint, varchar(3),smalldatetime.
>> >> >>
>> >> >> it works fine before the amount of its records
>> reaches
>> >> 10
>> >> >> millions around. afterwards, the insertion of one
>> record
>> >> >> in ASP may return an ODBC Timeout Error. when this
>> >> >> happens, the only way to insert a record which I
can
>> >> >> imagine is to run the same stored procedure in
Query
>> >> >> Analyzer, Guess how long it took? 70 seconds!
>> >> >>
>> >> >> the strangest thing is, after the 70 seconds
>> insertion,
>> >> >> the next insertion only takes 1 second or less, at
>> that
>> >> >> time, ASP page works again.
>> >> >>
>> >> >> My SQL server is SQL2000+sp3
>> >> >>
>> >> >> I noticed the same problem was reported in this
>> >> newsgroup
>> >> >> two years ago, somebody suggested using
aba_lockinfo
>> to
>> >> >> figure it out, I will try it when the problem
happens
>> >> >> again. In the meantime, I wonder if anybody got a
>> better
>> >> >> solution, or knew what was the main reason of this
>> >> problem.
>> >> >>
>> >> >> Thanks,
>> >> >>
>> >> >> Mingfa Ma
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> >.
>> >> >
>> >
>> >
>> >.
>> >
>
>.
>|||The main reason I mentioned changing the datatype was to reduce space and
keep the index smaller if you had one on those columns. If this does not
get queried then I suppose you don't need an index for that purpose but
sometimes a clustered index can help with insertions. In a heap sql server
needs to lookup a fair amount of information to determine where to place the
next row and with a large number of rows this may take a while, although
usually not that long<g>. With a clustered index there is no choice but to
place it where it belongs according to the index expression. If you use a
column such a an Identity or a datetime that is always in chronological
order for your index expression the new rows are always just added to the
end. It's pretty clean and efficient. First I would run profiler and
perfmon to see what is happening in the system at the time of the slowdown.
Make sure there are no high disk or cpu queues etc. Run sp_who2 to ensure
that nothing is blocking the inserts. And I would try the clustered index
on the LogDate column and see how that works out.
--
Andrew J. Kelly
SQL Server MVP
"Mingfa Ma" <mingfa@.commonname.com> wrote in message
news:091f01c34c62$86066d60$a501280a@.phx.gbl...
> Correct, there is no indexes on the table as there is
> nobody running selects on this table.
> UID and SID are not numbers, but they can be changed to
> varchar if that would make any difference.
> It is whorthwhile pointing out that this table is not
> being accessed frequently. 99.99% of time it is only used
> to log incoming data and there are about 15 to 30 incoming
> data to be recorded within a single second. I am pretty
> sure nobody is runnng 'select' when the problem happens.
> If creating an index on this table, would it not further
> slow down this table? Also, this table can grow like 1
> million records in a day, the index of the table would
> also be very huge?
> Mingfa Ma
>
> >--Original Message--
> >You have no indexes at all? Is there anyone running
> selects on this table?
> >If so they will most likely take out a table lock and
> block the insert until
> >done. Just curious if the UID and SID are just numbers
> why ar eyou using a
> >NVARCHAR vs a regular VARCHAR or even an INT? You might
> consider placing a
> >clustered index on the table but you need to decide how
> you access it to
> >determine the proper column to use.
> >
> >--
> >
> >Andrew J. Kelly
> >SQL Server MVP
> >
> >
> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
> >news:0c0401c34bb0$61ec76c0$a501280a@.phx.gbl...
> >> Sorry, I mistook DDL as DLL.
> >>
> >> the table is very simple, no index, no trigger.
> >>
> >> Here is the definition of the table
> >>
> >> if exists (select * from dbo.sysobjects where id => >> object_id(N'[dbo].[n2_tblLogUserQuery]') and
> OBJECTPROPERTY
> >> (id, N'IsUserTable') = 1)
> >> drop table [dbo].[n2_tblLogUserQuery]
> >> GO
> >>
> >> CREATE TABLE [dbo].[n2_tblLogUserQuery] (
> >> [UID] [nvarchar] (16) COLLATE
> >> SQL_Latin1_General_CP1_CI_AS NULL ,
> >> [SID] [nvarchar] (16) COLLATE
> >> SQL_Latin1_General_CP1_CI_AS NULL ,
> >> [Query] [nvarchar] (128) COLLATE
> >> SQL_Latin1_General_CP1_CI_AS NULL ,
> >> [CommonNameID] [int] NULL ,
> >> [Type] [tinyint] NULL ,
> >> [App] [tinyint] NULL ,
> >> [CountryCode] [varchar] (3) COLLATE
> >> SQL_Latin1_General_CP1_CI_AS NULL ,
> >> [LogDate] [smalldatetime] NULL
> >> ) ON [PRIMARY]
> >> GO
> >>
> >>
> >>
> >>
> >> >--Original Message--
> >> >That is the definition of the table, indexes, etc. You
> >> can get this by
> >> >right clicking on the table in EM and choosing "All
> >> Tasks - Generate Sql
> >> >Script" and make sure you include the indexes, triggers
> >> etc.
> >> >
> >> >--
> >> >
> >> >Andrew J. Kelly
> >> >SQL Server MVP
> >> >
> >> >
> >> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
> >> >news:04ff01c34b9e$9ea475c0$a001280a@.phx.gbl...
> >> >> Thanks, Andrew,
> >> >>
> >> >> but what do you mean "the actual DDL"? how to get it?
> >> >>
> >> >> here is the sample of the inserted row,
> >> >>
> >> >> 626995265,1052399332,Dering Harbor,0,20,100,US,2003-
> 07-
> >> 15
> >> >> 02:23:00
> >> >>
> >> >>
> >> >> Mingfa Ma
> >> >>
> >> >>
> >> >> >--Original Message--
> >> >> >Sounds like you may have page splitting going on
> and a
> >> >> really slow disk
> >> >> >subsystem. What is the actual DDL including indexes
> >> for
> >> >> the table and a
> >> >> >sample of the inserted row? You could also have
> >> >> blocking issues which can
> >> >> >be found with sp_who2.
> >> >> >
> >> >> >--
> >> >> >
> >> >> >Andrew J. Kelly
> >> >> >SQL Server MVP
> >> >> >
> >> >> >
> >> >> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
> >> >> >news:03e701c34b8d$d8c13b00$a001280a@.phx.gbl...
> >> >> >> I got a completely independent log table, which I
> >> mean
> >> >> >> there is no relationship with other tables. its
> >> columns
> >> >> >> look like
> >> >> >>
> >> >> >> nvarchar(16), nvarchar(16), nvarchar(16), int,
> >> tinyint,
> >> >> >> tinyint, varchar(3),smalldatetime.
> >> >> >>
> >> >> >> it works fine before the amount of its records
> >> reaches
> >> >> 10
> >> >> >> millions around. afterwards, the insertion of one
> >> record
> >> >> >> in ASP may return an ODBC Timeout Error. when this
> >> >> >> happens, the only way to insert a record which I
> can
> >> >> >> imagine is to run the same stored procedure in
> Query
> >> >> >> Analyzer, Guess how long it took? 70 seconds!
> >> >> >>
> >> >> >> the strangest thing is, after the 70 seconds
> >> insertion,
> >> >> >> the next insertion only takes 1 second or less, at
> >> that
> >> >> >> time, ASP page works again.
> >> >> >>
> >> >> >> My SQL server is SQL2000+sp3
> >> >> >>
> >> >> >> I noticed the same problem was reported in this
> >> >> newsgroup
> >> >> >> two years ago, somebody suggested using
> aba_lockinfo
> >> to
> >> >> >> figure it out, I will try it when the problem
> happens
> >> >> >> again. In the meantime, I wonder if anybody got a
> >> better
> >> >> >> solution, or knew what was the main reason of this
> >> >> problem.
> >> >> >>
> >> >> >> Thanks,
> >> >> >>
> >> >> >> Mingfa Ma
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >> >.
> >> >> >
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >|||Thanks very much indeed.
I will try your suggestions when the problem happens again.
and I'll inform you the result. Is your email
sqlmvpnooospam@.shadhawk.com reachable? just in case this
topic would be too old in the group at that time, and you
would not notice it.
Kind regards,
Mingfa Ma
>--Original Message--
>The main reason I mentioned changing the datatype was to
reduce space and
>keep the index smaller if you had one on those columns.
If this does not
>get queried then I suppose you don't need an index for
that purpose but
>sometimes a clustered index can help with insertions. In
a heap sql server
>needs to lookup a fair amount of information to determine
where to place the
>next row and with a large number of rows this may take a
while, although
>usually not that long<g>. With a clustered index there
is no choice but to
>place it where it belongs according to the index
expression. If you use a
>column such a an Identity or a datetime that is always in
chronological
>order for your index expression the new rows are always
just added to the
>end. It's pretty clean and efficient. First I would
run profiler and
>perfmon to see what is happening in the system at the
time of the slowdown.
>Make sure there are no high disk or cpu queues etc. Run
sp_who2 to ensure
>that nothing is blocking the inserts. And I would try
the clustered index
>on the LogDate column and see how that works out.
>--
>Andrew J. Kelly
>SQL Server MVP
>
>"Mingfa Ma" <mingfa@.commonname.com> wrote in message
>news:091f01c34c62$86066d60$a501280a@.phx.gbl...
>> Correct, there is no indexes on the table as there is
>> nobody running selects on this table.
>> UID and SID are not numbers, but they can be changed to
>> varchar if that would make any difference.
>> It is whorthwhile pointing out that this table is not
>> being accessed frequently. 99.99% of time it is only
used
>> to log incoming data and there are about 15 to 30
incoming
>> data to be recorded within a single second. I am pretty
>> sure nobody is runnng 'select' when the problem happens.
>> If creating an index on this table, would it not further
>> slow down this table? Also, this table can grow like 1
>> million records in a day, the index of the table would
>> also be very huge?
>> Mingfa Ma
>>
>> >--Original Message--
>> >You have no indexes at all? Is there anyone running
>> selects on this table?
>> >If so they will most likely take out a table lock and
>> block the insert until
>> >done. Just curious if the UID and SID are just numbers
>> why ar eyou using a
>> >NVARCHAR vs a regular VARCHAR or even an INT? You
might
>> consider placing a
>> >clustered index on the table but you need to decide how
>> you access it to
>> >determine the proper column to use.
>> >
>> >--
>> >
>> >Andrew J. Kelly
>> >SQL Server MVP
>> >
>> >
>> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
>> >news:0c0401c34bb0$61ec76c0$a501280a@.phx.gbl...
>> >> Sorry, I mistook DDL as DLL.
>> >>
>> >> the table is very simple, no index, no trigger.
>> >>
>> >> Here is the definition of the table
>> >>
>> >> if exists (select * from dbo.sysobjects where id =>> >> object_id(N'[dbo].[n2_tblLogUserQuery]') and
>> OBJECTPROPERTY
>> >> (id, N'IsUserTable') = 1)
>> >> drop table [dbo].[n2_tblLogUserQuery]
>> >> GO
>> >>
>> >> CREATE TABLE [dbo].[n2_tblLogUserQuery] (
>> >> [UID] [nvarchar] (16) COLLATE
>> >> SQL_Latin1_General_CP1_CI_AS NULL ,
>> >> [SID] [nvarchar] (16) COLLATE
>> >> SQL_Latin1_General_CP1_CI_AS NULL ,
>> >> [Query] [nvarchar] (128) COLLATE
>> >> SQL_Latin1_General_CP1_CI_AS NULL ,
>> >> [CommonNameID] [int] NULL ,
>> >> [Type] [tinyint] NULL ,
>> >> [App] [tinyint] NULL ,
>> >> [CountryCode] [varchar] (3) COLLATE
>> >> SQL_Latin1_General_CP1_CI_AS NULL ,
>> >> [LogDate] [smalldatetime] NULL
>> >> ) ON [PRIMARY]
>> >> GO
>> >>
>> >>
>> >>
>> >>
>> >> >--Original Message--
>> >> >That is the definition of the table, indexes, etc.
You
>> >> can get this by
>> >> >right clicking on the table in EM and choosing "All
>> >> Tasks - Generate Sql
>> >> >Script" and make sure you include the indexes,
triggers
>> >> etc.
>> >> >
>> >> >--
>> >> >
>> >> >Andrew J. Kelly
>> >> >SQL Server MVP
>> >> >
>> >> >
>> >> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
>> >> >news:04ff01c34b9e$9ea475c0$a001280a@.phx.gbl...
>> >> >> Thanks, Andrew,
>> >> >>
>> >> >> but what do you mean "the actual DDL"? how to get
it?
>> >> >>
>> >> >> here is the sample of the inserted row,
>> >> >>
>> >> >> 626995265,1052399332,Dering
Harbor,0,20,100,US,2003-
>> 07-
>> >> 15
>> >> >> 02:23:00
>> >> >>
>> >> >>
>> >> >> Mingfa Ma
>> >> >>
>> >> >>
>> >> >> >--Original Message--
>> >> >> >Sounds like you may have page splitting going on
>> and a
>> >> >> really slow disk
>> >> >> >subsystem. What is the actual DDL including
indexes
>> >> for
>> >> >> the table and a
>> >> >> >sample of the inserted row? You could also have
>> >> >> blocking issues which can
>> >> >> >be found with sp_who2.
>> >> >> >
>> >> >> >--
>> >> >> >
>> >> >> >Andrew J. Kelly
>> >> >> >SQL Server MVP
>> >> >> >
>> >> >> >
>> >> >> >"Mingfa Ma" <mingfa@.commonname.com> wrote in
message
>> >> >> >news:03e701c34b8d$d8c13b00$a001280a@.phx.gbl...
>> >> >> >> I got a completely independent log table,
which I
>> >> mean
>> >> >> >> there is no relationship with other tables. its
>> >> columns
>> >> >> >> look like
>> >> >> >>
>> >> >> >> nvarchar(16), nvarchar(16), nvarchar(16), int,
>> >> tinyint,
>> >> >> >> tinyint, varchar(3),smalldatetime.
>> >> >> >>
>> >> >> >> it works fine before the amount of its records
>> >> reaches
>> >> >> 10
>> >> >> >> millions around. afterwards, the insertion of
one
>> >> record
>> >> >> >> in ASP may return an ODBC Timeout Error. when
this
>> >> >> >> happens, the only way to insert a record which
I
>> can
>> >> >> >> imagine is to run the same stored procedure in
>> Query
>> >> >> >> Analyzer, Guess how long it took? 70 seconds!
>> >> >> >>
>> >> >> >> the strangest thing is, after the 70 seconds
>> >> insertion,
>> >> >> >> the next insertion only takes 1 second or
less, at
>> >> that
>> >> >> >> time, ASP page works again.
>> >> >> >>
>> >> >> >> My SQL server is SQL2000+sp3
>> >> >> >>
>> >> >> >> I noticed the same problem was reported in this
>> >> >> newsgroup
>> >> >> >> two years ago, somebody suggested using
>> aba_lockinfo
>> >> to
>> >> >> >> figure it out, I will try it when the problem
>> happens
>> >> >> >> again. In the meantime, I wonder if anybody
got a
>> >> better
>> >> >> >> solution, or knew what was the main reason of
this
>> >> >> problem.
>> >> >> >>
>> >> >> >> Thanks,
>> >> >> >>
>> >> >> >> Mingfa Ma
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> >.
>> >> >> >
>> >> >
>> >> >
>> >> >.
>> >> >
>> >
>> >
>> >.
>> >
>
>.
>|||You have to remove the nooospam first. GoodLuck.
--
Andrew J. Kelly
SQL Server MVP
"Mingfa Ma" <mingfa@.commonname.com> wrote in message
news:0c3001c34c75$48451f40$a401280a@.phx.gbl...
> Thanks very much indeed.
> I will try your suggestions when the problem happens again.
> and I'll inform you the result. Is your email
> sqlmvpnooospam@.shadhawk.com reachable? just in case this
> topic would be too old in the group at that time, and you
> would not notice it.
> Kind regards,
> Mingfa Ma
>
> >--Original Message--
> >The main reason I mentioned changing the datatype was to
> reduce space and
> >keep the index smaller if you had one on those columns.
> If this does not
> >get queried then I suppose you don't need an index for
> that purpose but
> >sometimes a clustered index can help with insertions. In
> a heap sql server
> >needs to lookup a fair amount of information to determine
> where to place the
> >next row and with a large number of rows this may take a
> while, although
> >usually not that long<g>. With a clustered index there
> is no choice but to
> >place it where it belongs according to the index
> expression. If you use a
> >column such a an Identity or a datetime that is always in
> chronological
> >order for your index expression the new rows are always
> just added to the
> >end. It's pretty clean and efficient. First I would
> run profiler and
> >perfmon to see what is happening in the system at the
> time of the slowdown.
> >Make sure there are no high disk or cpu queues etc. Run
> sp_who2 to ensure
> >that nothing is blocking the inserts. And I would try
> the clustered index
> >on the LogDate column and see how that works out.
> >
> >--
> >
> >Andrew J. Kelly
> >SQL Server MVP
> >
> >
> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
> >news:091f01c34c62$86066d60$a501280a@.phx.gbl...
> >> Correct, there is no indexes on the table as there is
> >> nobody running selects on this table.
> >>
> >> UID and SID are not numbers, but they can be changed to
> >> varchar if that would make any difference.
> >>
> >> It is whorthwhile pointing out that this table is not
> >> being accessed frequently. 99.99% of time it is only
> used
> >> to log incoming data and there are about 15 to 30
> incoming
> >> data to be recorded within a single second. I am pretty
> >> sure nobody is runnng 'select' when the problem happens.
> >>
> >> If creating an index on this table, would it not further
> >> slow down this table? Also, this table can grow like 1
> >> million records in a day, the index of the table would
> >> also be very huge?
> >>
> >> Mingfa Ma
> >>
> >>
> >> >--Original Message--
> >> >You have no indexes at all? Is there anyone running
> >> selects on this table?
> >> >If so they will most likely take out a table lock and
> >> block the insert until
> >> >done. Just curious if the UID and SID are just numbers
> >> why ar eyou using a
> >> >NVARCHAR vs a regular VARCHAR or even an INT? You
> might
> >> consider placing a
> >> >clustered index on the table but you need to decide how
> >> you access it to
> >> >determine the proper column to use.
> >> >
> >> >--
> >> >
> >> >Andrew J. Kelly
> >> >SQL Server MVP
> >> >
> >> >
> >> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
> >> >news:0c0401c34bb0$61ec76c0$a501280a@.phx.gbl...
> >> >> Sorry, I mistook DDL as DLL.
> >> >>
> >> >> the table is very simple, no index, no trigger.
> >> >>
> >> >> Here is the definition of the table
> >> >>
> >> >> if exists (select * from dbo.sysobjects where id => >> >> object_id(N'[dbo].[n2_tblLogUserQuery]') and
> >> OBJECTPROPERTY
> >> >> (id, N'IsUserTable') = 1)
> >> >> drop table [dbo].[n2_tblLogUserQuery]
> >> >> GO
> >> >>
> >> >> CREATE TABLE [dbo].[n2_tblLogUserQuery] (
> >> >> [UID] [nvarchar] (16) COLLATE
> >> >> SQL_Latin1_General_CP1_CI_AS NULL ,
> >> >> [SID] [nvarchar] (16) COLLATE
> >> >> SQL_Latin1_General_CP1_CI_AS NULL ,
> >> >> [Query] [nvarchar] (128) COLLATE
> >> >> SQL_Latin1_General_CP1_CI_AS NULL ,
> >> >> [CommonNameID] [int] NULL ,
> >> >> [Type] [tinyint] NULL ,
> >> >> [App] [tinyint] NULL ,
> >> >> [CountryCode] [varchar] (3) COLLATE
> >> >> SQL_Latin1_General_CP1_CI_AS NULL ,
> >> >> [LogDate] [smalldatetime] NULL
> >> >> ) ON [PRIMARY]
> >> >> GO
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> >--Original Message--
> >> >> >That is the definition of the table, indexes, etc.
> You
> >> >> can get this by
> >> >> >right clicking on the table in EM and choosing "All
> >> >> Tasks - Generate Sql
> >> >> >Script" and make sure you include the indexes,
> triggers
> >> >> etc.
> >> >> >
> >> >> >--
> >> >> >
> >> >> >Andrew J. Kelly
> >> >> >SQL Server MVP
> >> >> >
> >> >> >
> >> >> >"Mingfa Ma" <mingfa@.commonname.com> wrote in message
> >> >> >news:04ff01c34b9e$9ea475c0$a001280a@.phx.gbl...
> >> >> >> Thanks, Andrew,
> >> >> >>
> >> >> >> but what do you mean "the actual DDL"? how to get
> it?
> >> >> >>
> >> >> >> here is the sample of the inserted row,
> >> >> >>
> >> >> >> 626995265,1052399332,Dering
> Harbor,0,20,100,US,2003-
> >> 07-
> >> >> 15
> >> >> >> 02:23:00
> >> >> >>
> >> >> >>
> >> >> >> Mingfa Ma
> >> >> >>
> >> >> >>
> >> >> >> >--Original Message--
> >> >> >> >Sounds like you may have page splitting going on
> >> and a
> >> >> >> really slow disk
> >> >> >> >subsystem. What is the actual DDL including
> indexes
> >> >> for
> >> >> >> the table and a
> >> >> >> >sample of the inserted row? You could also have
> >> >> >> blocking issues which can
> >> >> >> >be found with sp_who2.
> >> >> >> >
> >> >> >> >--
> >> >> >> >
> >> >> >> >Andrew J. Kelly
> >> >> >> >SQL Server MVP
> >> >> >> >
> >> >> >> >
> >> >> >> >"Mingfa Ma" <mingfa@.commonname.com> wrote in
> message
> >> >> >> >news:03e701c34b8d$d8c13b00$a001280a@.phx.gbl...
> >> >> >> >> I got a completely independent log table,
> which I
> >> >> mean
> >> >> >> >> there is no relationship with other tables. its
> >> >> columns
> >> >> >> >> look like
> >> >> >> >>
> >> >> >> >> nvarchar(16), nvarchar(16), nvarchar(16), int,
> >> >> tinyint,
> >> >> >> >> tinyint, varchar(3),smalldatetime.
> >> >> >> >>
> >> >> >> >> it works fine before the amount of its records
> >> >> reaches
> >> >> >> 10
> >> >> >> >> millions around. afterwards, the insertion of
> one
> >> >> record
> >> >> >> >> in ASP may return an ODBC Timeout Error. when
> this
> >> >> >> >> happens, the only way to insert a record which
> I
> >> can
> >> >> >> >> imagine is to run the same stored procedure in
> >> Query
> >> >> >> >> Analyzer, Guess how long it took? 70 seconds!
> >> >> >> >>
> >> >> >> >> the strangest thing is, after the 70 seconds
> >> >> insertion,
> >> >> >> >> the next insertion only takes 1 second or
> less, at
> >> >> that
> >> >> >> >> time, ASP page works again.
> >> >> >> >>
> >> >> >> >> My SQL server is SQL2000+sp3
> >> >> >> >>
> >> >> >> >> I noticed the same problem was reported in this
> >> >> >> newsgroup
> >> >> >> >> two years ago, somebody suggested using
> >> aba_lockinfo
> >> >> to
> >> >> >> >> figure it out, I will try it when the problem
> >> happens
> >> >> >> >> again. In the meantime, I wonder if anybody
> got a
> >> >> better
> >> >> >> >> solution, or knew what was the main reason of
> this
> >> >> >> problem.
> >> >> >> >>
> >> >> >> >> Thanks,
> >> >> >> >>
> >> >> >> >> Mingfa Ma
> >> >> >> >>
> >> >> >> >>
> >> >> >> >
> >> >> >> >
> >> >> >> >.
> >> >> >> >
> >> >> >
> >> >> >
> >> >> >.
> >> >> >
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >

Friday, February 24, 2012

Insert performance/nvarchar

hello,
i wrote a performance test for sequential inserts with ado.net on a P4 2GHz
512 Meg Ram machine
and got the following scores:
insert 10000 ints 1:30 mins
insert 10000 reals 1:20 mins
inserting 10000 nvarchars
first 10000: 1:30
second 10000: 4:11
third 10000: 6:50
fourth 10000: 9:30
fifth 10000: 12:12
sixth 10000: 15:00
seventh 10000 18:20
so the times gets worse and worse.
i would expect, that the convergate but they don't
Is this normal?
If yes we will have problems, because we expect a couple of millions entries
in this
table where this strings are stored.
all tables for the performance test have the same stucture and indices
except of
the datatype which is tested, which is
id
value
Can you give me a hint how to speed this?
thanks mike
Do you have your databases auto-growing during these tests, or did you set
the files to a large enough size before the tests to ensure that they
wouldn't grow?
Do you have the columns indexed? Are the inserts causing page splits?
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> hello,
> i wrote a performance test for sequential inserts with ado.net on a P4
2GHz
> 512 Meg Ram machine
> and got the following scores:
> insert 10000 ints 1:30 mins
> insert 10000 reals 1:20 mins
> inserting 10000 nvarchars
> first 10000: 1:30
> second 10000: 4:11
> third 10000: 6:50
> fourth 10000: 9:30
> fifth 10000: 12:12
> sixth 10000: 15:00
> seventh 10000 18:20
> so the times gets worse and worse.
> i would expect, that the convergate but they don't
> Is this normal?
> If yes we will have problems, because we expect a couple of millions
entries
> in this
> table where this strings are stored.
> all tables for the performance test have the same stucture and indices
> except of
> the datatype which is tested, which is
> id
> value
> Can you give me a hint how to speed this?
> thanks mike
|||Hello Adam,
yes its auto-growing
yes columns are indexed
most inserts are NOT causing page splits
thanks mike
"Adam Machanic" wrote:

> Do you have your databases auto-growing during these tests, or did you set
> the files to a large enough size before the tests to ensure that they
> wouldn't grow?
> Do you have the columns indexed? Are the inserts causing page splits?
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> 2GHz
> entries
>
>
|||You'll get more consistent results if you grow the file first...
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
news:857ED961-21D6-4B62-B2DF-07B3FB24F3FA@.microsoft.com...[vbcol=seagreen]
> Hello Adam,
> yes its auto-growing
> yes columns are indexed
> most inserts are NOT causing page splits
> thanks mike
>
> "Adam Machanic" wrote:
set[vbcol=seagreen]
|||hello adam,
nope,
i dropped the old database, created a new one with fixed size
600 meg (for data and tranlog).
The behaviour is still the same.
The insert times are growing endless.
greetings mike
"Adam Machanic" wrote:

> You'll get more consistent results if you grow the file first...
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:857ED961-21D6-4B62-B2DF-07B3FB24F3FA@.microsoft.com...
> set
>
>
|||Can you post the table definitions, including constraints and indexes?
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...[vbcol=seagreen]
> hello adam,
> nope,
> i dropped the old database, created a new one with fixed size
> 600 meg (for data and tranlog).
> The behaviour is still the same.
> The insert times are growing endless.
> greetings mike
>
> "Adam Machanic" wrote:
you[vbcol=seagreen]
they[vbcol=seagreen]
splits?[vbcol=seagreen]
message[vbcol=seagreen]
a P4[vbcol=seagreen]
millions[vbcol=seagreen]
indices[vbcol=seagreen]
|||Hello Adam,
here comes the table
create table LogStringTable
(
ID int identity (1,1) not null,
stringValue nvarchar(400) not null,
attributeTypeId int not null,
logItemId int not null
constraint FKATIhasStringValues
foreign key ( attributeTypeId )
references LogAttributeType (Id),
constraint FKItemHasStringvalues
foreign key (LogItemId )
references LogItem ( Id )
) on primary
there are four indices
primary key index on Id (clustered)
and an the other columns (not unique)
thank you mike
"Adam Machanic" wrote:

> Can you post the table definitions, including constraints and indexes?
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> you
> they
> splits?
> message
> a P4
> millions
> indices
>
>
|||Hello Adam,
I dropped all indices and tried again
-> nothing principaly changed.
The times are shorter, but they are still growing endless,
with each 10000 insert.
When I have 100.000 entries in that table than the performance is reduce to
about
15 inserts/second compared with 100 inserts/second when starting with a
blank table.
And the performance goes down and down.
Greets mike
"Adam Machanic" wrote:

> Can you post the table definitions, including constraints and indexes?
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> you
> they
> splits?
> message
> a P4
> millions
> indices
>
>
|||hello adam,
i know now, that it is not a problem if the sql server.
it has to do with ado.net.
currently i don't know what it is, but now I inserted 10.000 nvarchars with
the
query analyzer and it lasts about 5 seconds
regardless how many records are in the table.
so i have to look into the ado.net stuff.
thank you for your help
I'll let you know what is is, when i know it.
thank you very much
greets michael
"Adam Machanic" wrote:

> Can you post the table definitions, including constraints and indexes?
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> you
> they
> splits?
> message
> a P4
> millions
> indices
>
>
|||Hello Adam,
I got it.
There is an option at the data adapter called
refresh the dataset
This was set to true.
I set it to false and now my world is perpendicular again.
The insert times for 10.000 stings are now about 5-7 seconds.
Unfortunatly, I even didn't use a dataset, so this option is useless even
when set to true.
I think this is worthy a microsoft call.
thank you for your help.
mike.
"Adam Machanic" wrote:

> Can you post the table definitions, including constraints and indexes?
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> you
> they
> splits?
> message
> a P4
> millions
> indices
>
>

Insert performance/nvarchar

hello,
i wrote a performance test for sequential inserts with ado.net on a P4 2GHz
512 Meg Ram machine
and got the following scores:
insert 10000 ints 1:30 mins
insert 10000 reals 1:20 mins
inserting 10000 nvarchars
first 10000: 1:30
second 10000: 4:11
third 10000: 6:50
fourth 10000: 9:30
fifth 10000: 12:12
sixth 10000: 15:00
seventh 10000 18:20
so the times gets worse and worse.
i would expect, that the convergate but they don't
Is this normal?
If yes we will have problems, because we expect a couple of millions entries
in this
table where this strings are stored.
all tables for the performance test have the same stucture and indices
except of
the datatype which is tested, which is
id
value
Can you give me a hint how to speed this?
thanks mikeDo you have your databases auto-growing during these tests, or did you set
the files to a large enough size before the tests to ensure that they
wouldn't grow?
Do you have the columns indexed? Are the inserts causing page splits?
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> hello,
> i wrote a performance test for sequential inserts with ado.net on a P4
2GHz
> 512 Meg Ram machine
> and got the following scores:
> insert 10000 ints 1:30 mins
> insert 10000 reals 1:20 mins
> inserting 10000 nvarchars
> first 10000: 1:30
> second 10000: 4:11
> third 10000: 6:50
> fourth 10000: 9:30
> fifth 10000: 12:12
> sixth 10000: 15:00
> seventh 10000 18:20
> so the times gets worse and worse.
> i would expect, that the convergate but they don't
> Is this normal?
> If yes we will have problems, because we expect a couple of millions
entries
> in this
> table where this strings are stored.
> all tables for the performance test have the same stucture and indices
> except of
> the datatype which is tested, which is
> id
> value
> Can you give me a hint how to speed this?
> thanks mike|||Hello Adam,
yes its auto-growing
yes columns are indexed
most inserts are NOT causing page splits
thanks mike
"Adam Machanic" wrote:

> Do you have your databases auto-growing during these tests, or did you set
> the files to a large enough size before the tests to ensure that they
> wouldn't grow?
> Do you have the columns indexed? Are the inserts causing page splits?
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> 2GHz
> entries
>
>|||You'll get more consistent results if you grow the file first...
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
news:857ED961-21D6-4B62-B2DF-07B3FB24F3FA@.microsoft.com...[vbcol=seagreen]
> Hello Adam,
> yes its auto-growing
> yes columns are indexed
> most inserts are NOT causing page splits
> thanks mike
>
> "Adam Machanic" wrote:
>
set[vbcol=seagreen]|||hello adam,
nope,
i dropped the old database, created a new one with fixed size
600 meg (for data and tranlog).
The behaviour is still the same.
The insert times are growing endless.
greetings mike
"Adam Machanic" wrote:

> You'll get more consistent results if you grow the file first...
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:857ED961-21D6-4B62-B2DF-07B3FB24F3FA@.microsoft.com...
> set
>
>|||Can you post the table definitions, including constraints and indexes?
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...[vbcol=seagreen]
> hello adam,
> nope,
> i dropped the old database, created a new one with fixed size
> 600 meg (for data and tranlog).
> The behaviour is still the same.
> The insert times are growing endless.
> greetings mike
>
> "Adam Machanic" wrote:
>
you[vbcol=seagreen]
they[vbcol=seagreen]
splits?[vbcol=seagreen]
message[vbcol=seagreen]
a P4[vbcol=seagreen]
millions[vbcol=seagreen]
indices[vbcol=seagreen]|||Hello Adam,
here comes the table
create table LogStringTable
(
ID int identity (1,1) not null,
stringValue nvarchar(400) not null,
attributeTypeId int not null,
logItemId int not null
constraint FKATIhasStringValues
foreign key ( attributeTypeId )
references LogAttributeType (Id),
constraint FKItemHasStringvalues
foreign key (LogItemId )
references LogItem ( Id )
) on primary
there are four indices
primary key index on Id (clustered)
and an the other columns (not unique)
thank you mike
"Adam Machanic" wrote:

> Can you post the table definitions, including constraints and indexes?
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> you
> they
> splits?
> message
> a P4
> millions
> indices
>
>|||Hello Adam,
I dropped all indices and tried again
-> nothing principaly changed.
The times are shorter, but they are still growing endless,
with each 10000 insert.
When I have 100.000 entries in that table than the performance is reduce to
about
15 inserts/second compared with 100 inserts/second when starting with a
blank table.
And the performance goes down and down.
Greets mike
"Adam Machanic" wrote:

> Can you post the table definitions, including constraints and indexes?
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> you
> they
> splits?
> message
> a P4
> millions
> indices
>
>|||hello adam,
i know now, that it is not a problem if the sql server.
it has to do with ado.net.
currently i don't know what it is, but now I inserted 10.000 nvarchars with
the
query analyzer and it lasts about 5 seconds
regardless how many records are in the table.
so i have to look into the ado.net stuff.
thank you for your help
I'll let you know what is is, when i know it.
thank you very much
greets michael
"Adam Machanic" wrote:

> Can you post the table definitions, including constraints and indexes?
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> you
> they
> splits?
> message
> a P4
> millions
> indices
>
>|||Hello Adam,
I got it.
There is an option at the data adapter called
refresh the dataset
This was set to true.
I set it to false and now my world is perpendicular again.
The insert times for 10.000 stings are now about 5-7 seconds.
Unfortunatly, I even didn't use a dataset, so this option is useless even
when set to true.
I think this is worthy a microsoft call.
thank you for your help.
mike.
"Adam Machanic" wrote:

> Can you post the table definitions, including constraints and indexes?
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> you
> they
> splits?
> message
> a P4
> millions
> indices
>
>

Insert performance/nvarchar

hello,
i wrote a performance test for sequential inserts with ado.net on a P4 2GHz
512 Meg Ram machine
and got the following scores:
insert 10000 ints 1:30 mins
insert 10000 reals 1:20 mins
inserting 10000 nvarchars
first 10000: 1:30
second 10000: 4:11
third 10000: 6:50
fourth 10000: 9:30
fifth 10000: 12:12
sixth 10000: 15:00
seventh 10000 18:20
so the times gets worse and worse.
i would expect, that the convergate but they don't
Is this normal?
If yes we will have problems, because we expect a couple of millions entries
in this
table where this strings are stored.
all tables for the performance test have the same stucture and indices
except of
the datatype which is tested, which is
id
value
Can you give me a hint how to speed this?
thanks mikeDo you have your databases auto-growing during these tests, or did you set
the files to a large enough size before the tests to ensure that they
wouldn't grow?
Do you have the columns indexed? Are the inserts causing page splits?
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> hello,
> i wrote a performance test for sequential inserts with ado.net on a P4
2GHz
> 512 Meg Ram machine
> and got the following scores:
> insert 10000 ints 1:30 mins
> insert 10000 reals 1:20 mins
> inserting 10000 nvarchars
> first 10000: 1:30
> second 10000: 4:11
> third 10000: 6:50
> fourth 10000: 9:30
> fifth 10000: 12:12
> sixth 10000: 15:00
> seventh 10000 18:20
> so the times gets worse and worse.
> i would expect, that the convergate but they don't
> Is this normal?
> If yes we will have problems, because we expect a couple of millions
entries
> in this
> table where this strings are stored.
> all tables for the performance test have the same stucture and indices
> except of
> the datatype which is tested, which is
> id
> value
> Can you give me a hint how to speed this?
> thanks mike|||Hello Adam,
yes its auto-growing
yes columns are indexed
most inserts are NOT causing page splits
thanks mike
"Adam Machanic" wrote:
> Do you have your databases auto-growing during these tests, or did you set
> the files to a large enough size before the tests to ensure that they
> wouldn't grow?
> Do you have the columns indexed? Are the inserts causing page splits?
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> > hello,
> >
> > i wrote a performance test for sequential inserts with ado.net on a P4
> 2GHz
> >
> > 512 Meg Ram machine
> >
> > and got the following scores:
> >
> > insert 10000 ints 1:30 mins
> > insert 10000 reals 1:20 mins
> >
> > inserting 10000 nvarchars
> > first 10000: 1:30
> > second 10000: 4:11
> > third 10000: 6:50
> > fourth 10000: 9:30
> > fifth 10000: 12:12
> > sixth 10000: 15:00
> > seventh 10000 18:20
> >
> > so the times gets worse and worse.
> > i would expect, that the convergate but they don't
> > Is this normal?
> >
> > If yes we will have problems, because we expect a couple of millions
> entries
> > in this
> > table where this strings are stored.
> >
> > all tables for the performance test have the same stucture and indices
> > except of
> > the datatype which is tested, which is
> > id
> > value
> >
> > Can you give me a hint how to speed this?
> >
> > thanks mike
>
>|||You'll get more consistent results if you grow the file first...
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
news:857ED961-21D6-4B62-B2DF-07B3FB24F3FA@.microsoft.com...
> Hello Adam,
> yes its auto-growing
> yes columns are indexed
> most inserts are NOT causing page splits
> thanks mike
>
> "Adam Machanic" wrote:
> > Do you have your databases auto-growing during these tests, or did you
set
> > the files to a large enough size before the tests to ensure that they
> > wouldn't grow?
> >
> > Do you have the columns indexed? Are the inserts causing page splits?
> >
> >
> > --
> > Adam Machanic
> > SQL Server MVP
> > http://www.sqljunkies.com/weblog/amachanic
> > --
> >
> >
> > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> > news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> > > hello,
> > >
> > > i wrote a performance test for sequential inserts with ado.net on a P4
> > 2GHz
> > >
> > > 512 Meg Ram machine
> > >
> > > and got the following scores:
> > >
> > > insert 10000 ints 1:30 mins
> > > insert 10000 reals 1:20 mins
> > >
> > > inserting 10000 nvarchars
> > > first 10000: 1:30
> > > second 10000: 4:11
> > > third 10000: 6:50
> > > fourth 10000: 9:30
> > > fifth 10000: 12:12
> > > sixth 10000: 15:00
> > > seventh 10000 18:20
> > >
> > > so the times gets worse and worse.
> > > i would expect, that the convergate but they don't
> > > Is this normal?
> > >
> > > If yes we will have problems, because we expect a couple of millions
> > entries
> > > in this
> > > table where this strings are stored.
> > >
> > > all tables for the performance test have the same stucture and indices
> > > except of
> > > the datatype which is tested, which is
> > > id
> > > value
> > >
> > > Can you give me a hint how to speed this?
> > >
> > > thanks mike
> >
> >
> >|||hello adam,
nope,
i dropped the old database, created a new one with fixed size
600 meg (for data and tranlog).
The behaviour is still the same.
The insert times are growing endless.
greetings mike
"Adam Machanic" wrote:
> You'll get more consistent results if you grow the file first...
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:857ED961-21D6-4B62-B2DF-07B3FB24F3FA@.microsoft.com...
> > Hello Adam,
> >
> > yes its auto-growing
> > yes columns are indexed
> >
> > most inserts are NOT causing page splits
> >
> > thanks mike
> >
> >
> >
> > "Adam Machanic" wrote:
> >
> > > Do you have your databases auto-growing during these tests, or did you
> set
> > > the files to a large enough size before the tests to ensure that they
> > > wouldn't grow?
> > >
> > > Do you have the columns indexed? Are the inserts causing page splits?
> > >
> > >
> > > --
> > > Adam Machanic
> > > SQL Server MVP
> > > http://www.sqljunkies.com/weblog/amachanic
> > > --
> > >
> > >
> > > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> > > news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> > > > hello,
> > > >
> > > > i wrote a performance test for sequential inserts with ado.net on a P4
> > > 2GHz
> > > >
> > > > 512 Meg Ram machine
> > > >
> > > > and got the following scores:
> > > >
> > > > insert 10000 ints 1:30 mins
> > > > insert 10000 reals 1:20 mins
> > > >
> > > > inserting 10000 nvarchars
> > > > first 10000: 1:30
> > > > second 10000: 4:11
> > > > third 10000: 6:50
> > > > fourth 10000: 9:30
> > > > fifth 10000: 12:12
> > > > sixth 10000: 15:00
> > > > seventh 10000 18:20
> > > >
> > > > so the times gets worse and worse.
> > > > i would expect, that the convergate but they don't
> > > > Is this normal?
> > > >
> > > > If yes we will have problems, because we expect a couple of millions
> > > entries
> > > > in this
> > > > table where this strings are stored.
> > > >
> > > > all tables for the performance test have the same stucture and indices
> > > > except of
> > > > the datatype which is tested, which is
> > > > id
> > > > value
> > > >
> > > > Can you give me a hint how to speed this?
> > > >
> > > > thanks mike
> > >
> > >
> > >
>
>|||Can you post the table definitions, including constraints and indexes?
--
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> hello adam,
> nope,
> i dropped the old database, created a new one with fixed size
> 600 meg (for data and tranlog).
> The behaviour is still the same.
> The insert times are growing endless.
> greetings mike
>
> "Adam Machanic" wrote:
> > You'll get more consistent results if you grow the file first...
> >
> >
> > --
> > Adam Machanic
> > SQL Server MVP
> > http://www.sqljunkies.com/weblog/amachanic
> > --
> >
> >
> > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> > news:857ED961-21D6-4B62-B2DF-07B3FB24F3FA@.microsoft.com...
> > > Hello Adam,
> > >
> > > yes its auto-growing
> > > yes columns are indexed
> > >
> > > most inserts are NOT causing page splits
> > >
> > > thanks mike
> > >
> > >
> > >
> > > "Adam Machanic" wrote:
> > >
> > > > Do you have your databases auto-growing during these tests, or did
you
> > set
> > > > the files to a large enough size before the tests to ensure that
they
> > > > wouldn't grow?
> > > >
> > > > Do you have the columns indexed? Are the inserts causing page
splits?
> > > >
> > > >
> > > > --
> > > > Adam Machanic
> > > > SQL Server MVP
> > > > http://www.sqljunkies.com/weblog/amachanic
> > > > --
> > > >
> > > >
> > > > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in
message
> > > > news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> > > > > hello,
> > > > >
> > > > > i wrote a performance test for sequential inserts with ado.net on
a P4
> > > > 2GHz
> > > > >
> > > > > 512 Meg Ram machine
> > > > >
> > > > > and got the following scores:
> > > > >
> > > > > insert 10000 ints 1:30 mins
> > > > > insert 10000 reals 1:20 mins
> > > > >
> > > > > inserting 10000 nvarchars
> > > > > first 10000: 1:30
> > > > > second 10000: 4:11
> > > > > third 10000: 6:50
> > > > > fourth 10000: 9:30
> > > > > fifth 10000: 12:12
> > > > > sixth 10000: 15:00
> > > > > seventh 10000 18:20
> > > > >
> > > > > so the times gets worse and worse.
> > > > > i would expect, that the convergate but they don't
> > > > > Is this normal?
> > > > >
> > > > > If yes we will have problems, because we expect a couple of
millions
> > > > entries
> > > > > in this
> > > > > table where this strings are stored.
> > > > >
> > > > > all tables for the performance test have the same stucture and
indices
> > > > > except of
> > > > > the datatype which is tested, which is
> > > > > id
> > > > > value
> > > > >
> > > > > Can you give me a hint how to speed this?
> > > > >
> > > > > thanks mike
> > > >
> > > >
> > > >
> >
> >
> >|||Hello Adam,
here comes the table
create table LogStringTable
(
ID int identity (1,1) not null,
stringValue nvarchar(400) not null,
attributeTypeId int not null,
logItemId int not null
constraint FKATIhasStringValues
foreign key ( attributeTypeId )
references LogAttributeType (Id),
constraint FKItemHasStringvalues
foreign key (LogItemId )
references LogItem ( Id )
) on primary
there are four indices
primary key index on Id (clustered)
and an the other columns (not unique)
thank you mike
"Adam Machanic" wrote:
> Can you post the table definitions, including constraints and indexes?
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> > hello adam,
> >
> > nope,
> >
> > i dropped the old database, created a new one with fixed size
> > 600 meg (for data and tranlog).
> >
> > The behaviour is still the same.
> >
> > The insert times are growing endless.
> >
> > greetings mike
> >
> >
> >
> > "Adam Machanic" wrote:
> >
> > > You'll get more consistent results if you grow the file first...
> > >
> > >
> > > --
> > > Adam Machanic
> > > SQL Server MVP
> > > http://www.sqljunkies.com/weblog/amachanic
> > > --
> > >
> > >
> > > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> > > news:857ED961-21D6-4B62-B2DF-07B3FB24F3FA@.microsoft.com...
> > > > Hello Adam,
> > > >
> > > > yes its auto-growing
> > > > yes columns are indexed
> > > >
> > > > most inserts are NOT causing page splits
> > > >
> > > > thanks mike
> > > >
> > > >
> > > >
> > > > "Adam Machanic" wrote:
> > > >
> > > > > Do you have your databases auto-growing during these tests, or did
> you
> > > set
> > > > > the files to a large enough size before the tests to ensure that
> they
> > > > > wouldn't grow?
> > > > >
> > > > > Do you have the columns indexed? Are the inserts causing page
> splits?
> > > > >
> > > > >
> > > > > --
> > > > > Adam Machanic
> > > > > SQL Server MVP
> > > > > http://www.sqljunkies.com/weblog/amachanic
> > > > > --
> > > > >
> > > > >
> > > > > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in
> message
> > > > > news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> > > > > > hello,
> > > > > >
> > > > > > i wrote a performance test for sequential inserts with ado.net on
> a P4
> > > > > 2GHz
> > > > > >
> > > > > > 512 Meg Ram machine
> > > > > >
> > > > > > and got the following scores:
> > > > > >
> > > > > > insert 10000 ints 1:30 mins
> > > > > > insert 10000 reals 1:20 mins
> > > > > >
> > > > > > inserting 10000 nvarchars
> > > > > > first 10000: 1:30
> > > > > > second 10000: 4:11
> > > > > > third 10000: 6:50
> > > > > > fourth 10000: 9:30
> > > > > > fifth 10000: 12:12
> > > > > > sixth 10000: 15:00
> > > > > > seventh 10000 18:20
> > > > > >
> > > > > > so the times gets worse and worse.
> > > > > > i would expect, that the convergate but they don't
> > > > > > Is this normal?
> > > > > >
> > > > > > If yes we will have problems, because we expect a couple of
> millions
> > > > > entries
> > > > > > in this
> > > > > > table where this strings are stored.
> > > > > >
> > > > > > all tables for the performance test have the same stucture and
> indices
> > > > > > except of
> > > > > > the datatype which is tested, which is
> > > > > > id
> > > > > > value
> > > > > >
> > > > > > Can you give me a hint how to speed this?
> > > > > >
> > > > > > thanks mike
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||Hello Adam,
I dropped all indices and tried again
-> nothing principaly changed.
The times are shorter, but they are still growing endless,
with each 10000 insert.
When I have 100.000 entries in that table than the performance is reduce to
about
15 inserts/second compared with 100 inserts/second when starting with a
blank table.
And the performance goes down and down.
Greets mike
"Adam Machanic" wrote:
> Can you post the table definitions, including constraints and indexes?
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> > hello adam,
> >
> > nope,
> >
> > i dropped the old database, created a new one with fixed size
> > 600 meg (for data and tranlog).
> >
> > The behaviour is still the same.
> >
> > The insert times are growing endless.
> >
> > greetings mike
> >
> >
> >
> > "Adam Machanic" wrote:
> >
> > > You'll get more consistent results if you grow the file first...
> > >
> > >
> > > --
> > > Adam Machanic
> > > SQL Server MVP
> > > http://www.sqljunkies.com/weblog/amachanic
> > > --
> > >
> > >
> > > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> > > news:857ED961-21D6-4B62-B2DF-07B3FB24F3FA@.microsoft.com...
> > > > Hello Adam,
> > > >
> > > > yes its auto-growing
> > > > yes columns are indexed
> > > >
> > > > most inserts are NOT causing page splits
> > > >
> > > > thanks mike
> > > >
> > > >
> > > >
> > > > "Adam Machanic" wrote:
> > > >
> > > > > Do you have your databases auto-growing during these tests, or did
> you
> > > set
> > > > > the files to a large enough size before the tests to ensure that
> they
> > > > > wouldn't grow?
> > > > >
> > > > > Do you have the columns indexed? Are the inserts causing page
> splits?
> > > > >
> > > > >
> > > > > --
> > > > > Adam Machanic
> > > > > SQL Server MVP
> > > > > http://www.sqljunkies.com/weblog/amachanic
> > > > > --
> > > > >
> > > > >
> > > > > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in
> message
> > > > > news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> > > > > > hello,
> > > > > >
> > > > > > i wrote a performance test for sequential inserts with ado.net on
> a P4
> > > > > 2GHz
> > > > > >
> > > > > > 512 Meg Ram machine
> > > > > >
> > > > > > and got the following scores:
> > > > > >
> > > > > > insert 10000 ints 1:30 mins
> > > > > > insert 10000 reals 1:20 mins
> > > > > >
> > > > > > inserting 10000 nvarchars
> > > > > > first 10000: 1:30
> > > > > > second 10000: 4:11
> > > > > > third 10000: 6:50
> > > > > > fourth 10000: 9:30
> > > > > > fifth 10000: 12:12
> > > > > > sixth 10000: 15:00
> > > > > > seventh 10000 18:20
> > > > > >
> > > > > > so the times gets worse and worse.
> > > > > > i would expect, that the convergate but they don't
> > > > > > Is this normal?
> > > > > >
> > > > > > If yes we will have problems, because we expect a couple of
> millions
> > > > > entries
> > > > > > in this
> > > > > > table where this strings are stored.
> > > > > >
> > > > > > all tables for the performance test have the same stucture and
> indices
> > > > > > except of
> > > > > > the datatype which is tested, which is
> > > > > > id
> > > > > > value
> > > > > >
> > > > > > Can you give me a hint how to speed this?
> > > > > >
> > > > > > thanks mike
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||hello adam,
i know now, that it is not a problem if the sql server.
it has to do with ado.net.
currently i don't know what it is, but now I inserted 10.000 nvarchars with
the
query analyzer and it lasts about 5 seconds
regardless how many records are in the table.
so i have to look into the ado.net stuff.
thank you for your help
I'll let you know what is is, when i know it.
thank you very much
greets michael
"Adam Machanic" wrote:
> Can you post the table definitions, including constraints and indexes?
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> > hello adam,
> >
> > nope,
> >
> > i dropped the old database, created a new one with fixed size
> > 600 meg (for data and tranlog).
> >
> > The behaviour is still the same.
> >
> > The insert times are growing endless.
> >
> > greetings mike
> >
> >
> >
> > "Adam Machanic" wrote:
> >
> > > You'll get more consistent results if you grow the file first...
> > >
> > >
> > > --
> > > Adam Machanic
> > > SQL Server MVP
> > > http://www.sqljunkies.com/weblog/amachanic
> > > --
> > >
> > >
> > > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> > > news:857ED961-21D6-4B62-B2DF-07B3FB24F3FA@.microsoft.com...
> > > > Hello Adam,
> > > >
> > > > yes its auto-growing
> > > > yes columns are indexed
> > > >
> > > > most inserts are NOT causing page splits
> > > >
> > > > thanks mike
> > > >
> > > >
> > > >
> > > > "Adam Machanic" wrote:
> > > >
> > > > > Do you have your databases auto-growing during these tests, or did
> you
> > > set
> > > > > the files to a large enough size before the tests to ensure that
> they
> > > > > wouldn't grow?
> > > > >
> > > > > Do you have the columns indexed? Are the inserts causing page
> splits?
> > > > >
> > > > >
> > > > > --
> > > > > Adam Machanic
> > > > > SQL Server MVP
> > > > > http://www.sqljunkies.com/weblog/amachanic
> > > > > --
> > > > >
> > > > >
> > > > > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in
> message
> > > > > news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> > > > > > hello,
> > > > > >
> > > > > > i wrote a performance test for sequential inserts with ado.net on
> a P4
> > > > > 2GHz
> > > > > >
> > > > > > 512 Meg Ram machine
> > > > > >
> > > > > > and got the following scores:
> > > > > >
> > > > > > insert 10000 ints 1:30 mins
> > > > > > insert 10000 reals 1:20 mins
> > > > > >
> > > > > > inserting 10000 nvarchars
> > > > > > first 10000: 1:30
> > > > > > second 10000: 4:11
> > > > > > third 10000: 6:50
> > > > > > fourth 10000: 9:30
> > > > > > fifth 10000: 12:12
> > > > > > sixth 10000: 15:00
> > > > > > seventh 10000 18:20
> > > > > >
> > > > > > so the times gets worse and worse.
> > > > > > i would expect, that the convergate but they don't
> > > > > > Is this normal?
> > > > > >
> > > > > > If yes we will have problems, because we expect a couple of
> millions
> > > > > entries
> > > > > > in this
> > > > > > table where this strings are stored.
> > > > > >
> > > > > > all tables for the performance test have the same stucture and
> indices
> > > > > > except of
> > > > > > the datatype which is tested, which is
> > > > > > id
> > > > > > value
> > > > > >
> > > > > > Can you give me a hint how to speed this?
> > > > > >
> > > > > > thanks mike
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||Hello Adam,
I got it.
There is an option at the data adapter called
refresh the dataset
This was set to true.
I set it to false and now my world is perpendicular again.
The insert times for 10.000 stings are now about 5-7 seconds.
Unfortunatly, I even didn't use a dataset, so this option is useless even
when set to true.
I think this is worthy a microsoft call.
thank you for your help.
mike.
"Adam Machanic" wrote:
> Can you post the table definitions, including constraints and indexes?
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> > hello adam,
> >
> > nope,
> >
> > i dropped the old database, created a new one with fixed size
> > 600 meg (for data and tranlog).
> >
> > The behaviour is still the same.
> >
> > The insert times are growing endless.
> >
> > greetings mike
> >
> >
> >
> > "Adam Machanic" wrote:
> >
> > > You'll get more consistent results if you grow the file first...
> > >
> > >
> > > --
> > > Adam Machanic
> > > SQL Server MVP
> > > http://www.sqljunkies.com/weblog/amachanic
> > > --
> > >
> > >
> > > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> > > news:857ED961-21D6-4B62-B2DF-07B3FB24F3FA@.microsoft.com...
> > > > Hello Adam,
> > > >
> > > > yes its auto-growing
> > > > yes columns are indexed
> > > >
> > > > most inserts are NOT causing page splits
> > > >
> > > > thanks mike
> > > >
> > > >
> > > >
> > > > "Adam Machanic" wrote:
> > > >
> > > > > Do you have your databases auto-growing during these tests, or did
> you
> > > set
> > > > > the files to a large enough size before the tests to ensure that
> they
> > > > > wouldn't grow?
> > > > >
> > > > > Do you have the columns indexed? Are the inserts causing page
> splits?
> > > > >
> > > > >
> > > > > --
> > > > > Adam Machanic
> > > > > SQL Server MVP
> > > > > http://www.sqljunkies.com/weblog/amachanic
> > > > > --
> > > > >
> > > > >
> > > > > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in
> message
> > > > > news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> > > > > > hello,
> > > > > >
> > > > > > i wrote a performance test for sequential inserts with ado.net on
> a P4
> > > > > 2GHz
> > > > > >
> > > > > > 512 Meg Ram machine
> > > > > >
> > > > > > and got the following scores:
> > > > > >
> > > > > > insert 10000 ints 1:30 mins
> > > > > > insert 10000 reals 1:20 mins
> > > > > >
> > > > > > inserting 10000 nvarchars
> > > > > > first 10000: 1:30
> > > > > > second 10000: 4:11
> > > > > > third 10000: 6:50
> > > > > > fourth 10000: 9:30
> > > > > > fifth 10000: 12:12
> > > > > > sixth 10000: 15:00
> > > > > > seventh 10000 18:20
> > > > > >
> > > > > > so the times gets worse and worse.
> > > > > > i would expect, that the convergate but they don't
> > > > > > Is this normal?
> > > > > >
> > > > > > If yes we will have problems, because we expect a couple of
> millions
> > > > > entries
> > > > > > in this
> > > > > > table where this strings are stored.
> > > > > >
> > > > > > all tables for the performance test have the same stucture and
> indices
> > > > > > except of
> > > > > > the datatype which is tested, which is
> > > > > > id
> > > > > > value
> > > > > >
> > > > > > Can you give me a hint how to speed this?
> > > > > >
> > > > > > thanks mike
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||Thanks for all of the updates; this is good to know! Can you post an
abbreviated version of the code you were using? How does a dataset option
affect you when you're not using a dataset? And how did you turn it off
without using a dataset?
--
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
news:EBAADD96-9F27-4A71-AC21-B8487352237C@.microsoft.com...
> Hello Adam,
> I got it.
> There is an option at the data adapter called
> refresh the dataset
> This was set to true.
> I set it to false and now my world is perpendicular again.
> The insert times for 10.000 stings are now about 5-7 seconds.
> Unfortunatly, I even didn't use a dataset, so this option is useless even
> when set to true.
> I think this is worthy a microsoft call.
> thank you for your help.
> mike.
>
> "Adam Machanic" wrote:
> > Can you post the table definitions, including constraints and indexes?
> >
> > --
> > Adam Machanic
> > SQL Server MVP
> > http://www.sqljunkies.com/weblog/amachanic
> > --
> >
> >
> > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in message
> > news:021A9342-82D0-48B5-8746-9F6E013AC032@.microsoft.com...
> > > hello adam,
> > >
> > > nope,
> > >
> > > i dropped the old database, created a new one with fixed size
> > > 600 meg (for data and tranlog).
> > >
> > > The behaviour is still the same.
> > >
> > > The insert times are growing endless.
> > >
> > > greetings mike
> > >
> > >
> > >
> > > "Adam Machanic" wrote:
> > >
> > > > You'll get more consistent results if you grow the file first...
> > > >
> > > >
> > > > --
> > > > Adam Machanic
> > > > SQL Server MVP
> > > > http://www.sqljunkies.com/weblog/amachanic
> > > > --
> > > >
> > > >
> > > > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in
message
> > > > news:857ED961-21D6-4B62-B2DF-07B3FB24F3FA@.microsoft.com...
> > > > > Hello Adam,
> > > > >
> > > > > yes its auto-growing
> > > > > yes columns are indexed
> > > > >
> > > > > most inserts are NOT causing page splits
> > > > >
> > > > > thanks mike
> > > > >
> > > > >
> > > > >
> > > > > "Adam Machanic" wrote:
> > > > >
> > > > > > Do you have your databases auto-growing during these tests, or
did
> > you
> > > > set
> > > > > > the files to a large enough size before the tests to ensure that
> > they
> > > > > > wouldn't grow?
> > > > > >
> > > > > > Do you have the columns indexed? Are the inserts causing page
> > splits?
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Adam Machanic
> > > > > > SQL Server MVP
> > > > > > http://www.sqljunkies.com/weblog/amachanic
> > > > > > --
> > > > > >
> > > > > >
> > > > > > "Michael Zdarsky" <zdarsky@.zac-it.com.(nospamplease)> wrote in
> > message
> > > > > > news:E8610339-B39C-4A69-BD95-7EA882D0D228@.microsoft.com...
> > > > > > > hello,
> > > > > > >
> > > > > > > i wrote a performance test for sequential inserts with ado.net
on
> > a P4
> > > > > > 2GHz
> > > > > > >
> > > > > > > 512 Meg Ram machine
> > > > > > >
> > > > > > > and got the following scores:
> > > > > > >
> > > > > > > insert 10000 ints 1:30 mins
> > > > > > > insert 10000 reals 1:20 mins
> > > > > > >
> > > > > > > inserting 10000 nvarchars
> > > > > > > first 10000: 1:30
> > > > > > > second 10000: 4:11
> > > > > > > third 10000: 6:50
> > > > > > > fourth 10000: 9:30
> > > > > > > fifth 10000: 12:12
> > > > > > > sixth 10000: 15:00
> > > > > > > seventh 10000 18:20
> > > > > > >
> > > > > > > so the times gets worse and worse.
> > > > > > > i would expect, that the convergate but they don't
> > > > > > > Is this normal?
> > > > > > >
> > > > > > > If yes we will have problems, because we expect a couple of
> > millions
> > > > > > entries
> > > > > > > in this
> > > > > > > table where this strings are stored.
> > > > > > >
> > > > > > > all tables for the performance test have the same stucture and
> > indices
> > > > > > > except of
> > > > > > > the datatype which is tested, which is
> > > > > > > id
> > > > > > > value
> > > > > > >
> > > > > > > Can you give me a hint how to speed this?
> > > > > > >
> > > > > > > thanks mike
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >