[TYPO3-core] RFC #16445 Performance Tuning: Replace exec_SELECTgetRows with exec_SELECTgetSingleRow whenever a single record is expected

JoH asenau info at cybercraft.de
Wed Nov 17 15:36:46 CET 2010


This is an SVN patch request

Type: Performance tuning

Bugtracker reference:
http://bugs.typo3.org/view.php?id=16445

Branches:
trunk

Problem:
In the core the method exec_SELECTgetRows is used to fetch records from the DB. 
Often this method is used, even though there is just one single record expected as a result.

Solution:
Attached patch replaces exec_SELECT-getRows with exec_SELECTgetSingleRow for each case dealing with single records only.

Indicators are:
list(blah) is used in front of exec_SELECTgetRows
$blah[0] is used only
array_shift is used and the rest of the array stays untouched
LIMIT 1 is used within the method

and the array is not used with any foreach loop.

Cheers

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: replace_getRows_with_getSingleRow.diff
Type: application/octet-stream
Size: 26490 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101117/7f5afe27/attachment-0001.obj>


More information about the TYPO3-team-core mailing list