1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-10 17:45:18 +02:00

[ticket/11469] Add benefits over collecting huge insert arrays to class doc.

PHPBB3-11469
This commit is contained in:
Andreas Fischer 2013-03-27 18:22:59 +01:00
parent 55fb87ff18
commit 8c5fcac232

View File

@ -19,6 +19,18 @@ if (!defined('IN_PHPBB'))
* Collects rows for insert into a database until the buffer size is reached.
* Then flushes the buffer to the database and starts over again.
*
* Benefits over collecting a (possibly huge) insert array and then using
* $db->sql_multi_insert() include:
*
* - Going over max packet size of the database connection is usually prevented
* because the data is submitted in batches.
*
* - Reaching database connection timeout is usually prevented because
* submission of batches talks to the database every now and then.
*
* - Usage of less PHP memory because data no longer needed is discarded on
* buffer flush.
*
* Usage:
* <code>
* $buffer = new phpbb_db_sql_insert_buffer($db, 'test_table', 1234);