-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insert multi rows in one query #55
Conversation
I am not really sure how often this will actually be useful. Does anyone else have an opinion on this one ( @durhamhale )? I am leaning towards avoiding it to keep complexity down. |
See issue #40 as they seem related also |
While I think it should be avoided to preserve simplicity, it might be useful in cases where latency between application server and database server is high. (This should be a rare use case.) |
I am going to put the same time limit on this pull request as the MS SQL TOP pull request #37. If I hear no fresh calls for this or justifications for inclusion in the library by 2013 then it will be closed without merge. |
This have very better performance for many data which you can see at below test.
https://gist.github.com/6db54b4e6eb9d0e133c6 |
I'll repeat my comment on the gist here: Data being submitted is different. In line 19 of $data[]=array('key'=>$key,'bar'=>$i); // value for 'key' changed from original There are probably a handful of ways to speed up the first implementation, if it were important. One that comes to mind first is doing the |
This isn't really what Idiorm is intended for. If you are handling such volumes of data then you are after the greatest efficiency you can get and that is not going to be through an ORM. I am still not convinced that this is a worthy feature of a light ORM. @tag mentions a good alternative in using the |
Thank you for the pull request, but unfortunately in this case I am going to be closing it without merge. Please see @tag comments for |
Method 2 for insert- mass insert by one query
Result query:
INSERT INTO
aaa
(one
,two
) VALUES (?, ?), (?, ?)