Issue Bug Closed

#22341Missing key on l18n parent in tt_content table

Christian Kuhn 03/29/10, 14:24 updated 07/02/10, 11:16

Description

Problem:
t3lib_BEfunc::translationCount issues a query like ‘SELECT COUNT FROM tt_content WHERE l18n_parent=123 AND sys_language_uid!=0 AND deleted=0’. EXPLAIN shows no usable key for this type of query.

Solution:
Add index key on l18n_parent.

Notes:
This is especially useful for the list module which calls this method for each listed tt_content record.
I decided against a combined index here as there are several other queries with l18n_parent in its where part but other additional field.
This profiling was done with a happy little extension called ‘mf_mysql_profiler’ that xclasses t3lib_db to normalize and log queries to a log table, together with a backend module to analyze them. I encouraged the author to upload it to forge.

(issue imported from #M13945)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.