[TYPO3-mvc] Speed improvement extbase with DB

Georg Ringer mail at ringerge.org
Fri Jan 21 07:48:05 CET 2011


Hi,

I did a small patch and would be nice to get some comments on it.
Background is an arcticle I read about inefficient queries [1].

Problem is, that extbase escapes every value even if it is an integer,
for example the result of
-----------------------------
$query->in('pid', array(1,2,3));
-----------------------------

is: uid IN('1', '2', '3') which seems to be improveable.

My patch is quite simple and checks if the value is
a) an integer => nothing is done
b) something else but casting this to integer is the same value =>
casted value is used
c) escape the value

What do you think about this?
I didn't to any proper tests yet.

Georg

[1] http://www.chriscalender.com/?p=118
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: escape.patch
URL: <http://lists.typo3.org/pipermail/typo3-project-typo3v4mvc/attachments/20110121/3cfef72f/attachment.txt>


More information about the TYPO3-project-typo3v4mvc mailing list