[TYPO3-core] RFC #15457: Add support for prepared queries

Ernesto Baschny [cron IT] ernst at cron-it.de
Tue Aug 17 09:18:00 CEST 2010


Martin Kutschker schrieb am 17.08.2010 09:10:
> Am 17.08.2010 01:21, schrieb Helmut Hummel:
>> Now that we will have prepare_SELECTquery(), are there plans for
>> prepare_INSERTquery() etc. ? :)
> 
> What for? IMHO the real point in prepared queries is not the (named) paramters, but the fact that
> the DB only once creates a query plan, so that *repeated* queries with varying arguments are
> extecuted faster. So you gain nothing with INSERT. Possibly there is an advantage for UPDATE/DELETE
> statements with JOINs.

To speed up mass-imports of data with INSERT's?

$sth = prepare('INSERT INTO test (uid,bodytext,caption) VALUES (?,?,?)');
foreach ($massiveDataArray as $row) {
	$sth->execute($row);
}

1) MySQL is speed up
2) DBAL is speed up (parsing query only once)
2) your EXT is speed up (you don't need to "fullQuoteStr" the huge array
before dumping it into the DB)

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list