MySQL Forums
Forum List  »  Optimizer & Parser

Query long time
Posted by: Sahid Ferdjaoui
Date: July 08, 2008 02:25AM

Hello,

i need help for optimize my query.
this query is used for stats
engin is MyIsam

Query:
select i.sexe, count(i.affiliateid)
from InscriptionNew i
join stats_referer_abo sra on i.affiliateid = sra.affiliateid
group by i.sexe;

Result: 11 rows in set (9.18 sec)

Explain:
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: IL
type: ALL
possible_keys: PRIMARY
key: NULL
key_len: NULL
ref: NULL
rows: 394176
Extra: Using temporary; Using filesort
*************************** 2. row ***************************
id: 1
select_type: SIMPLE
table: ICM
type: eq_ref
possible_keys: PRIMARY
key: PRIMARY
key_len: 4
ref: nete.IL.id
rows: 1
Extra:
*************************** 3. row ***************************
id: 1
select_type: SIMPLE
table: II
type: eq_ref
possible_keys: PRIMARY
key: PRIMARY
key_len: 4
ref: nete.ICM.id
rows: 1
Extra: Using where; Using index
*************************** 4. row ***************************
id: 1
select_type: SIMPLE
table: sra
type: ref
possible_keys: affiliateid,affiliateid_2
key: affiliateid_2
key_len: 110
ref: func
rows: 1
Extra: Using where; Using index
4 rows in set (0.00 sec)

mysql search in 394176...


you have idea or tips for optimise my query or my relation ?
maybe update a new relation with a count per sex ?

thank you

Options: ReplyQuote


Subject
Views
Written By
Posted
Query long time
3643
July 08, 2008 02:25AM
2251
July 08, 2008 04:33AM
2292
July 08, 2008 05:39AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.