MySQL Forums
Forum List  »  Optimizer & Parser

Insert multiple values within a transaction with LAST_INSERT_ID
Posted by: Matthias Bendewald
Date: April 15, 2011 02:14AM

Hi Folks,
i have a little performance issue. I use a innodb database and C# to connect to it.
I want to insert values into two related tables.
Table one has an ID field which is pointed to in table two.

So i do the following within a transaction for multiple datasets:

INSERT INTO table1 (...) VALUES (...);
and then
INSERT INTO table2 (table1_id, ...) VALUES (LAST_INSERT_ID(), ...);

Works fine. But it is really slow (about 80 inserted Values per second).
What can i do to speed it up?

MySQL server is 5.1.41, i am connecting to it via C#.net Connector which is pretty fast in almost all other situations.

Options: ReplyQuote


Subject
Views
Written By
Posted
Insert multiple values within a transaction with LAST_INSERT_ID
6605
April 15, 2011 02:14AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.