Bonjour,
J'aurai une petite question (remarque on est là pour ça :mouarf:)
Qu'est ce qui est le plus rapide donc mieux ?
Utiliser INSERT INTO avec plusieurs UNION ?
ou bien
Utiliser plusieurs INSERT INTO en parallèle ?
Ceci bien sûr sur la même table.
Merci pour vos différentes réponses.
OuCode:
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 INSERT INTO MaTablePrincipale ( Champs1, Champs2, Champs3, ... ... ) SELECT Champs1, Champs2, Champs3, ... ... FROM MaTable1 UNION SELECT Champs1, Champs2, Champs3, ... ... FROM MaTable2 UNION SELECT Champs1, Champs2, Champs3, ... ... FROM MaTable3 UNION ... ... ...
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 INSERT INTO MaTablePrincipale ( Champs1, Champs2, Champs3, ... ... ) SELECT Champs1, Champs2, Champs3, ... ... FROM MaTable1
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 INSERT INTO MaTablePrincipale ( Champs1, Champs2, Champs3, ... ... ) SELECT Champs1, Champs2, Champs3, ... ... FROM MaTable2
Ceci autant de fois en parallèle que nécessaire.Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 INSERT INTO MaTablePrincipale ( Champs1, Champs2, Champs3, ... ... ) SELECT Champs1, Champs2, Champs3, ... ... FROM MaTable3