php - MySql "Preparing" costs too much time -
i new mysql performance analysis. find join query in system becomes slow (3.52s ~4 tables, each table has ~1000-2000 rows). , viewed performance analysis phpmyadmin. result shown below:
1 starting 170 µs
2 opening tables 44 µs
3 system lock 7 µs
4 table lock 7 µs
5 init 65 µs
6 optimizing 20 µs
7 statistics 92 µs
8 preparing 31 µs
9 creating tmp table 236 µs
10 executing 2 µs
11 copying tmp table 68 µs
12 optimizing 10 µs
13 statistics 14 µs
14 preparing 3.5 s
15 creating sort index 2.6 ms
16 copying group table 15.9 ms
17 sorting result 2.1 ms
18 sending data 391 µs
19 end 7 µs
20 removing tmp table 1.3 ms
21 end 3 µs
22 removing tmp table 819 µs
23 end 10 µs
24 query end 2 µs
25 freeing items 20 µs
26 removing tmp table 6 µs
27 freeing items 365 µs
28 logging slow query 3 µs
29 cleaning 6 µs
i don't understand why preparing
phase costs 3.5s. how can reduce it?
i'm going throw wild guess in answer, you don't use index.
in sql optimization, indexing broken cheat, konami-code
in contra
, or doors
in age of empire
.
anyway, try putting indexing in database, come us, , amazed how fast preparing phase goes now.
Comments
Post a Comment