[TYPO3-core] RFC #11712: Feature: t3lib_BEfunc::selectVersionsOfRecord: Need a Hook for query-building

Mathias Gisch m.gisch at mx.uni-saarland.de
Fri Aug 14 10:54:12 CEST 2009


This is an SVN patch request.

Type: New feature

Bugtracker references:
http://bugs.typo3.org/view.php?id=11712

Branches:
Trunk

Problem:
The selectVersionsOfRecord()-function selects all records based on the  
uid or t3ver_oid in combination with the pid field. This is very  
ineffective in large datasets as it is not possible to setup a MySQL- 
multicolumn-index here. So a full tablescan has to be performed every  
time.
For large datasets it is faster to do a union select for records with  
the uid, and records with the t3ver_oid and pid, as I can use  
multicolumn-indices in both queries. A subselect might also be  
suitable in some occasions.

Solution:
I propose to introduce a hook in  
t3lib_BEfunc::selectVersionsOfRecord() which enables me to build my  
own queries based on the table that is beeing queried:
  $TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php'] 
['selectVersionsQuery'][$table]
  The hook just builds the sql-string. The query will then be  
submitted and processed by the t3lib_BEfunc::selectVersionsOfRecord()- 
function.


Greetings,
	Mathias


-------------- next part --------------



More information about the TYPO3-team-core mailing list