Bonjour

voici ma requete
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
SELECT a.id_serv,a.id_app,sum(a.obj_sauve),sum(a.vol_sauve),
sum(a.nb_sauve),sum(a.err_sauve),sum(a.obj_rest),
sum(a.vol_rest),sum(a.nb_rest),sum(a.err_rest)
,a.id_dom_1,a.id_dom_2,a.id_dom_3,
a.id_dom_4,a.id_dom_5,a.id_dom_6,
a.id_dom_7,a.id_dom_8
FROM tab_stat_app_jour a,domaines b
WHERE a.date>=to_date('01/03/2010', 'DD/MM/YYYY')
AND a.date<to_date('01/03/2010', 'DD/MM/YYYY')+ '1 month'::interval
AND b.domaine='mon_domaine'
And (b.id_dom=a.id_dom_1
or b.id_dom=a.id_dom_2
or b.id_dom=a.id_dom_3
or b.id_dom=a.id_dom_4
or b.id_dom=a.id_dom_5
or b.id_dom=a.id_dom_6
or b.id_dom=a.id_dom_7
or b.id_dom=a.id_dom_8)
group by a.id_serv,a.id_app,
a.id_dom_1,a.id_dom_2,a.id_dom_3,
a.id_dom_4,a.id_dom_5,a.id_dom_6,
a.id_dom_7,a.id_dom_8;
J'ai essayé de mettre un index sur le champ date ou sur le champ id_serv.
Dans les deux cas, l'index n'est pas utilisé. Hors comme je commence à avoir pas mal de donnée, la durée du traitement evolue considerablement.
Je passe de 14mn à presque 30 mn maintenant
Que faire .....