Feature #20880
closedt3lib_BEfunc::selectVersionsOfRecord: Need a Hook for query-buildung
0%
Description
The selectVersionsOfRecord() 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 query. A subselect might also be suitable in some occasions.
My table has several hundred-thousand entries, and when entering list-view in extended mode. It takes about about 2 minutes to select the first 20 records.
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 build the sql-string. The query will then be submitted and processed by the t3lib_BEfunc::selectVersionsOfRecord()-function.
(issue imported from #M11712)
Files