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

Martin Kutschker masi-no at spam-typo3.org
Tue Aug 17 09:28:07 CEST 2010


Am 17.08.2010 09:18, schrieb Ernesto Baschny [cron IT]:
> 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

I will have to test this. But I reckon you will gain more if you temporarily disable the indices for
that table.

> 2) DBAL is speed up (parsing query only once)

Yes.

> 2) your EXT is speed up (you don't need to "fullQuoteStr" the huge array
> before dumping it into the DB)

Hm, yes.

Anyway, having the stuff in won't hurt.

Masi


More information about the TYPO3-team-core mailing list