Performance Problem - how to tune a query?
Hi @All!
I´m facing a problem with an query running on MySQL 4.0.21. The following query takes on a P4, 1GB RAM, WinXP (my testing environment) about 38 seconds:
SELECT HIGH_PRIORITY
c.customer_name AS 'customer',
c.customer_freevolume AS 'freevolume',
c.customer_price_per_gb AS 'pricePerGB',
c.customer_currency AS 'currency',
ROUND(((SUM(d.data_recievedbytes) + sum(d.data_sendbytes))/1024/1024/1024),3) AS 'traffic',
ROUND(((SUM(d.data_recievedbytes) + sum(d.data_sendbytes))/1024/1024/1024),3) - c.customer_freevolume AS 'billedTraffic'
FROM billing_data d, billing_customer c
WHERE data_starttime LIKE '200510%'
AND MID(d.data_site,3,3) = c.customer_short
GROUP BY c.customer_name
Any ideas how to speep up this query?
Greetings,
Daniel!