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

JoH asenau info at cybercraft.de
Mon Jan 24 20:56:37 CET 2011



This is an SVN patch request

Type: Performance tuning

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

Branches:
trunk

Problem:
Due to some newly implemented features, getRows has returned to the 
places that belong to getSingle Row now.

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 --------------
An embedded and charset-unspecified text was scrubbed...
Name: 16445_followup.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20110124/da3b70ba/attachment.txt>


More information about the TYPO3-team-core mailing list