List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:May 26 2003 1:49am
Subject:Re: Optimize this query...
View as plain text  
In the last episode (May 26), Daniel Kasak said:
> I have a query:
> 
> select RSLCOMID, AccountNo, Client
> from CallData
> group by RSLCOMID, AccountNo, Client
> 
> An 'explain' command gives:
> 
>
> +----------+------+---------------+------+---------+------+--------+---------------------------------+
> | table    | type | possible_keys | key  | key_len | ref  | rows   |  Extra          
>                 |
>
> +----------+------+---------------+------+---------+------+--------+---------------------------------+
> | CallData | ALL  | NULL          | NULL |    NULL | NULL | 938904 |  Using
> temporary; Using filesort |
>
> +----------+------+---------------+------+---------+------+--------+---------------------------------+
> 
> I have indexes on all three fields in the select list. The query takes 
> about 90 seconds to run (500Mhz / 256MB). Is there any way to speed the 
> query up? Would an index across all three fields improve things?

That's the only thing that will.  Mysql can only use one index per
table.

-- 
	Dan Nelson
	dnelson@stripped
Thread
Optimize this query...Daniel Kasak26 May
  • Re: Optimize this query...Daniel Kasak26 May
  • Re: Optimize this query...Dan Nelson26 May
  • Re: Optimize this query...Emanuel Alexandre Tavares26 May
  • Re: Optimize this query...Emanuel Alexandre Tavares26 May
    • Re: Optimize this query...Daniel Kasak26 May