[TYPO3-core] RFC #12858: Feature: Provide a DB API to insert multiple rows at once

Christian Kuhn lolli at schwarzbu.ch
Sun Jan 10 14:27:05 CET 2010


This is SVN patch request.

Type: Feature

Branches: trunk

BT reference: http://bugs.typo3.org/view.php?id=12858

Problem:
It would be nice if t3lib_db provides an API to insert multiple rows at
once, using mysql's extended insert.

Solution:
Add methods exec_INSERTmultipleRows and INSERTmultipleRows to t3lib_db.

Notes:
There is a significant performance advantage if many rows are inserted
with one query instead of a query per row. This is especially useful for
the caching framework with db backend if fiddling with many tags, could
be used in other core parts as well, and might be useful for some
extensions.

ext:enetcache has a performance unit test for this:
- svn co http://forge.typo3.org/repositories/show/extension-enetcache/trunk
- $TYPO3_CONF_VARS['SYS']['useCachingFramework'] = '1';
- Run enetcache testcases
- Apply this patch and the patch from 12859 (enables insert multiple in
the caching framework)
- Run testcases again

For me "testSetManyTags" took 4 seconds before and 0.3 seconds after
(5000 rows handled).

@Xavier: Could you take a look and figure out what needs to be done for
dbal? If other db's don't handle extended inserts it would be easy to
iterate over the rows and call exec_INSERTquery() each in dbal again.

Regards
Christian
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 12858_01.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100110/995e2a7a/attachment.asc>


More information about the TYPO3-team-core mailing list