bedankt voor de racties, helaas ondersteund onze mysql server nog geen profiling. dus die optie komt helaas te vervallen.
het zoeken naar mogelijke indices om het te versnellen is ook al grotendeels gedaan, het gaan dan ook niet echt om optimalisatie in dit geval. ik zoek nu echt een manier om dat getalletje, die scanned rows, te bepalen.
@voutloos, kan je mij zeggen hoe ik in die explain bepaal of het wel of niet allemaal cartesische producten zijn? en misschien ook hoe het anders uitgerekend kan worden als het niet allemaal cartesische producten zijn.
hierbij even een iets ingekorte explain. gewoon vermenigvuldigen geeft mij 4.327.680 scanned rows. een vergelijkbare query leverde laatst een slow query log op met daarin slechts 23.000 rows. terwijl de explain bijna gelijk was (kwam ik ook in de 10 mil uit bij vermenigvuldigen)
code:
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
| id select_type type rows Extra
1 PRIMARY ref 5 Using where; Using filesort
1 PRIMARY ref 1 Using where
1 PRIMARY ref 1 Using where
1 PRIMARY eq_ref 1 Using where
1 PRIMARY eq_ref 1
1 PRIMARY eq_ref 1 Using where
1 PRIMARY eq_ref 1
1 PRIMARY eq_ref 1
1 PRIMARY eq_ref 1
1 PRIMARY ref 1 Using where
11 DEPENDENT SUBQUERY ref 1 Using where; Using index; Using filesort
11 DEPENDENT SUBQUERY ref 3 Using where; Using index
11 DEPENDENT SUBQUERY eq_ref 1 Using where
10 DEPENDENT SUBQUERY ref 1 Using where
10 DEPENDENT SUBQUERY eq_ref 1
10 DEPENDENT SUBQUERY ref 1 Using where; Using index
9 DEPENDENT SUBQUERY ref 1 Using where
9 DEPENDENT SUBQUERY eq_ref 1
9 DEPENDENT SUBQUERY ref 1 Using where; Using index
8 SUBQUERY ALL 98 Using where
8 SUBQUERY ref 23 Using where
7 DEPENDENT SUBQUERY ref 2 Using where
7 DEPENDENT SUBQUERY eq_ref 1 Using where
7 DEPENDENT SUBQUERY eq_ref 1 Using where
6 DEPENDENT SUBQUERY ref 2 Using where
6 DEPENDENT SUBQUERY eq_ref 1 Using where
6 DEPENDENT SUBQUERY ref 2 Using where
5 DEPENDENT SUBQUERY ref 2 Using where
5 DEPENDENT SUBQUERY eq_ref 1 Using where
5 DEPENDENT SUBQUERY eq_ref 1 Using where
5 DEPENDENT SUBQUERY eq_ref 1 Using where; Using index
4 DEPENDENT SUBQUERY ref 2 Using where
4 DEPENDENT SUBQUERY eq_ref 1 Using where
4 DEPENDENT SUBQUERY eq_ref 1 Using index
4 DEPENDENT SUBQUERY ref 2 Using where
3 DEPENDENT SUBQUERY ref 1 Using index
3 DEPENDENT SUBQUERY eq_ref 1
2 DEPENDENT SUBQUERY ref 2 Using where |