bonjour,
j'ai besoin de votre aide j'ai une requête qui et lente et j'arrive pas a l’optimiser pouvez vous m'aider ?


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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 
 
INSERT INTO`t_stock` (
    `clef`,
    `ref`,
    GLOBAL,
    `st_doc40`,
    `dispo`,
    `dispo_instantane`,
    `fini_intermediaire_sans_st`,
    `lavage_doc50`,
    `avant_montage_deja_lave_doc50`,
    `depart_doc50`,
    `doc50`,
    `retour_doc50`,
    `fini_sans_st`,
    `lavage_doc60`,
    `depart_doc60`,
    `doc60`,
    `retour_doc60`,
    `avant_montage_deja_lave`,
    `rack_synchro`,
    `lavage`,
    `module`,
    `stock_secu_module`,
    `doc70`,
    `magasin`,
    `magasin_dim`,
    `magasin_transit`,
    `magasin_consignation`,
    `magart`,
    `magart_dim`,
    `magart_transit`,
    `magart_consignation`
  )
SELECT`art`.`clef`,
  `art`.`ref`,
  `stk`.`global`,
  `ifnull` (`st`.`st_doc40`, ?) AS `st_doc40`,
  `stk`.`dispo`,
  `ifnull` (`stk_brut`.`stock_dispo`, ?) AS `dispo_instantane`,
  IF (
    (
      `art`.`module` = ?
      AND `art`.`type` != ?
    )
    OR `art`.`type` = ?,
    `stk`.`module1` - `ifnull` (`sst50`.`en_lav`, ?) - `ifnull` (`st`.`st_doc50`, ?) - `ifnull` (`sst50`.`depart`, ?) - `ifnull` (`sst50`.`recue`, ?)

Merci d'avance .