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
Multiple Insert or Batch Processing #22
Comments
|
I did some experiments to make this happen. But the problem is we are using |
|
I was trying something like in in Now the problem is in prepare statement and also 4 tests fails . Its not finished, nor in a working condition . The test failure is due to the check for multi query in prepare which happens to be a multi dimensional array for the query IN ( ) and where condition. It will be also good if we can just execute the query when we say execute than executing by default . |
|
Executing multiple inserts in a single statement is probably the fastest. However, something that is also very fast is executing multiple inserts inside a transaction. I've done that before and the speed difference from doing it outside a transaction is dramatic. |
|
@pmjones What about |
|
"Don't" ? ;-) |
|
On a more serious note, it sounds like a multiple insert is different-enough from a single insert that it might do better as a class of its own. I have to wonder how well prepared statements will work with multiple placeholders, though. Would need some way of numbering them properly. |
|
@pmjones So may be I misunderstood. So a simple question :) . 1 ) According to my understanding transactions doesn't commit on the first time and for first sql. It only does in the final stage and when there is an issue it can be reverted back by So the basic question is in MyISAM even the transaction begins its inserting, and it will not wait for the last commit ( yes / no ). According to a comment http://www.php.net/manual/en/pdo.begintransaction.php#82033 . But anyway I am not getting error even if its MyISAM as in the comment. |
|
Also according to my knowledge in a transaction if we never issued a |
|
@pmjones about numbering my idea was to for eg : For the $cols[0] we keep the tables column name. For the other we can or we don't need to keep .
Not sure whether this is a good idea though. |
|
Is this still something you think is necessary functionality? It seems relatively complex as it is. I'd like to close this ticket in order to clean up the issues listing, but if you feel it's really needed, I'd be happy to see a pull request in place of the ticket. |
|
@pmjones I love to give a PR. But as you mentioned it is hard . But I will think about it and will come up when I have something. You can close it for the time if needed. I will add in my todo list. |
Hi Paul ,
I am in need to issue multi query . Is there a way we can make it ?
I was looking at http://stackoverflow.com/a/4559320/487878
Do you have any suggestions how we can make it ?
The text was updated successfully, but these errors were encountered: