[TYPO3-english] Site Slowdown - MySQL Query - Possible TT-News Related Question

Björn Pedersen pedersen at frm2.tum.de
Fri Jul 15 10:44:59 CEST 2011


Am 15.07.2011 08:09, schrieb Jigal van Hemert:
> Hi,
> 
> On 14-7-2011 21:11, Louis Coppola wrote:
>> SELECT group_concat( cast(pid as char)) as pids FROM tt_content WHERE
>> list_type=9 and hidden=0
>>
>> Can anyone tell me what this query is doing, and what could be causing
>> it to hang in this way?
> 
> 
Additionally I guess that this query is doing a full table scan, as
there is no index on list_type:

mysql> explain SELECT group_concat( cast(pid as char)) as pids FROM
tt_content WHERE list_type=9 and hidden=0;
+----+-------------+------------+------+---------------+------+---------+------+------+-------------+
| id | select_type | table      | type | possible_keys | key  | key_len
| ref  | rows | Extra       |
+----+-------------+------------+------+---------------+------+---------+------+------+-------------+
|  1 | SIMPLE      | tt_content | ALL  | NULL          | NULL | NULL
| NULL | 3865 | Using where |
+----+-------------+------------+------+---------------+------+---------+------+------+-------------+

So if you really need this query, add a suitable index.

Björn



More information about the TYPO3-english mailing list