From: Carlos Eduardo Caldi Date: April 28 2009 2:49pm Subject: Copying to tmp table List-Archive: http://lists.mysql.com/mysql/217318 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="_b1230b81-e41d-4746-beb0-b5a60bd78b91_" --_b1230b81-e41d-4746-beb0-b5a60bd78b91_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi friends I have a proble with Copying to tmp table with large tables=2C table have m= ore than 3 million rows EXPLAIN da Query : Table : log0904 Type : ref Possible_keys : data_login_tplig=2Cemp_grp_login_dtlig=2Cgrp_tiporeg_tipoli= g_dtlig=2Cgrp_dtlig_tplig=2Cdtlig_num=2Cgrp_equipe_emp_dtlig Key : grp_tiporeg_tipolig_dtlig Key_Len : 7 Ref : const Rows : 11554 Extra : Using where=3B Using temporary=3B Using filesort I kill my queries with more than 60 seconds Time (sec) : 75 User : logs Maquina : 192.168.0.76:43947 BD : logs Thread : 18811390 State : Copying to tmp table Query : SELECT tipo_atendimento =2Clogin_operador=2Csum(duracao_opera= dor) as duracao_operador=2C count(*)as total FROM log0904 Where grupo =3D= '1172' AND data_ligacao =3D '2009-04-27' and hora_ligacao_ini between '17= :00:00' and '17:59:59' AND empresa =3D 'EXTREME-U' AND tipo_registro in= ('L'=2C'T') GROUP BY tipo_atendimento=2Clogin_operador Somebody kwons a kind of tunning can I do? Thanks Carlos Caldi=20 _________________________________________________________________ Descubra seu lado desconhecido com o novo Windows Live! http://www.windowslive.com.br= --_b1230b81-e41d-4746-beb0-b5a60bd78b91_--