[TYPO3-dev] Question about overlay query condition
Francois Suter
fsuter at cobweb.ch
Sun Sep 14 18:22:50 CEST 2008
Hi all,
The method t3lib_page::getRecordOverlay() is used to overlay a single
record with its translation, if it exists.
The query that fetches the overlay record looks like this:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'*',
$table,
'pid='.intval($row['pid']).
' AND
'.$TCA[$table]['ctrl']['languageField'].'='.intval($sys_language_content).
' AND
'.$TCA[$table]['ctrl']['transOrigPointerField'].'='.intval($row['uid']).
$this->enableFields($table),
'',
'',
'1'
);
I'm puzzled about the condition on the pid. I don't see why it is
necessary to test that the overlay record is on the same page as the
original one, since we are already testing the original/translation
relationship by comparing the transOrigPointerField to the original's uid.
Am I missing something?
I'm asking because I'm trying to optimise the overlay process, which
currently requires 2 queries per record to overlay (one for the language
overlay and one for the workspace overlay of the language overlay).
Needless to say that this can kill performance. If the pid condition
were not useful, it could be removed and all language overlays could be
gotten in one go for a set of originals by testing transOrigPointerField
with "IN" and a list of uid's from the original records.
Cheers
--
Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch
More information about the TYPO3-dev
mailing list