This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Insert or read all data in one big batch, smallest possible number of queries. | |
| // Sauce: http://inchoo.net/dev-talk/thou-shalt-not-do-inserts-in-a-foreach-unless-you-know-the-trick/ | |
| /*** Speed tests say (time in seconds): | |
| 100 iterations 1000 iterations 10000 iterations | |
| Insert multiple 0.017 0.079 0.379 | |
| Foreach in a transaction 0.074 0.501 4.701 |