If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Slow inserts on .NET

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-23-05, 05:56
IAmNull IAmNull is offline
Registered User
 
Join Date: Feb 2005
Posts: 2
Slow inserts on .NET

I use the .NET connector from MySql. And when I use the MySqlCommandBuilder to do insert in my table, it seems to run quite slow. I have a little mor than 1000 rows to insert at one time. Yet it takes approx. two minutes do finish the inserts. This seems quite slow to me.

Any ideas on how I can get the execution faster??
Reply With Quote
  #2 (permalink)  
Old 02-23-05, 06:01
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
why not insert several rows at once?

instead of this --

insert into mytable (col1, col2, ... colN) values ('val1', val2, ... 'valN')
insert into mytable (col1, col2, ... colN) values ('val1', val2, ... 'valN')
insert into mytable (col1, col2, ... colN) values ('val1', val2, ... 'valN')
insert into mytable (col1, col2, ... colN) values ('val1', val2, ... 'valN')
...

try this --

insert into mytable (col1, col2, ... colN)
values ('val1', val2, ... 'valN')
, ('val1', val2, ... 'valN')
, ('val1', val2, ... 'valN')
, ('val1', val2, ... 'valN')
...
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On