Re: Time-out problem
If I try to execute this query:
select fk_id_ad_format from spd_unit join spd_ad on fk_id_ad = id_ad where fk_id_campaign in (1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167) and spd_unit.duration_time > 0 group by fk_id_ad_format
This take more than 1,3 minutes to execute
+----+-------------+----------+-------+---------------------------------------+-------------------------------+---------+-----------------------------------------+-------+-----------------------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+----------+-------+---------------------------------------+-------------------------------+---------+-----------------------------------------+-------+-----------------------------------------------------------+
| 1 | SIMPLE | spd_ad | range | PRIMARY,t_campanha_t_grupo_anuncio_fk | t_campanha_t_grupo_anuncio_fk | 4 | NULL | 30 | Using where; Using index; Using temporary; Using filesort |
| 1 | SIMPLE | spd_unit | ref | t_anuncio_t_pecas_fk,fk_id_ad_format | t_anuncio_t_pecas_fk | 4 | prod_liquidashop_front_end.spd_ad.id_ad | 88934 | Using where |
+----+-------------+----------+-------+---------------------------------------+-------------------------------+---------+-----------------------------------------+-------+-----------------------------------------------------------+