2. show status 4lr(,nPRD
J2::'Hw*s
Aborted_clients ÓÉÓÚ¿Í»§Ã»ÓÐÕýÈ·¹Ø±ÕÁ¬½ÓÒѾËÀµô£¬ÒѾ·ÅÆúµÄÁ¬½ÓÊýÁ¿¡£ d:#yEC
Aborted_connects ³¢ÊÔÒѾʧ°ÜµÄMySQL·þÎñÆ÷µÄÁ¬½ÓµÄ´ÎÊý¡£ H<VTa? n
Connections ÊÔͼÁ¬½ÓMySQL·þÎñÆ÷µÄ´ÎÊý¡£ O~T@rX9f
Created_tmp_tables µ±Ö´ÐÐÓï¾äʱ£¬ÒѾ±»´´ÔìÁ˵ÄÒþº¬ÁÙʱ±íµÄÊýÁ¿¡£ kjg~n9#T
Delayed_insert_threads ÕýÔÚʹÓõÄÑÓ³Ù²åÈë´¦ÀíÆ÷Ï̵߳ÄÊýÁ¿¡£ +fC=UAZ
Delayed_writes ÓÃINSERT DELAYEDдÈëµÄÐÐÊý¡£ kW*f.!
Delayed_errors ÓÃINSERT DELAYEDдÈëµÄ·¢ÉúijЩ´íÎó(¿ÉÄÜÖظ´¼üÖµ)µÄÐÐÊý¡£ v'U{/ ,x
Flush_commands Ö´ÐÐFLUSHÃüÁîµÄ´ÎÊý¡£ :Pvzl1
Handler_delete ÇëÇó´ÓÒ»ÕűíÖÐɾ³ýÐеĴÎÊý¡£ +b.g$CRr
Handler_read_first ÇëÇó¶ÁÈë±íÖеÚÒ»ÐеĴÎÊý¡£ @aAW*D~-J
Handler_read_key ÇëÇóÊý×Ö»ùÓÚ¼ü¶ÁÐС£ 4[;X{ !
Handler_read_next ÇëÇó¶ÁÈë»ùÓÚÒ»¸ö¼üµÄÒ»ÐеĴÎÊý¡£ V,mw[Hw
Handler_read_rnd ÇëÇó¶ÁÈë»ùÓÚÒ»¸ö¹Ì¶¨Î»ÖõÄÒ»ÐеĴÎÊý¡£ HW=C),*]cR
Handler_update ÇëÇó¸üбíÖÐÒ»ÐеĴÎÊý¡£ SLkhCR
Handler_write ÇëÇóÏò±íÖвåÈëÒ»ÐеĴÎÊý¡£ [Grxw[(_:
Key_blocks_used ÓÃÓڹؼü×Ö»º´æµÄ¿éµÄÊýÁ¿¡£ !D@ZYK;
Key_read_requests ÇëÇó´Ó»º´æ¶ÁÈëÒ»¸ö¼üÖµµÄ´ÎÊý¡£ spdvZU=}
Key_reads ´Ó´ÅÅÌÎïÀí¶ÁÈëÒ»¸ö¼üÖµµÄ´ÎÊý¡£ d/ARm-D
Key_write_requests ÇëÇó½«Ò»¸ö¹Ø¼ü×Ö¿éдÈ뻺´æ´ÎÊý¡£ e7m*rh%5>
Key_writes ½«Ò»¸ö¼üÖµ¿éÎïÀíдÈë´ÅÅ̵ĴÎÊý¡£ nSW=LjrO~<
Max_used_connections ͬʱʹÓõÄÁ¬½ÓµÄ×î´óÊýÄ¿¡£ |2RC# ]/-Y
Not_flushed_key_blocks ÔÚ¼ü»º´æÖÐÒѾ¸Ä±äµ«ÊÇ»¹Ã»±»Çå¿Õµ½´ÅÅÌÉϵļü¿é¡£ t; 4]cg:_
Not_flushed_delayed_rows ÔÚINSERT DELAY¶ÓÁÐÖеȴýдÈëµÄÐеÄÊýÁ¿¡£ *pSQU=dmS
Open_tables ´ò¿ª±íµÄÊýÁ¿¡£ [U5\bX@$
Open_files ´ò¿ªÎļþµÄÊýÁ¿¡£ Oy%''+g
Open_streams ´ò¿ªÁ÷µÄÊýÁ¿(Ö÷ÒªÓÃÓÚÈÕÖ¾¼ÇÔØ£© !ePr5On
Opened_tables ÒѾ´ò¿ªµÄ±íµÄÊýÁ¿¡£ S 5/R_5
Questions ·¢Íù·þÎñÆ÷µÄ²éѯµÄÊýÁ¿¡£ }|g\ 8jq
Slow_queries Òª»¨³¬¹ýlong_query_timeʱ¼äµÄ²éѯÊýÁ¿¡£ 0\[Chja
Threads_connected µ±Ç°´ò¿ªµÄÁ¬½ÓµÄÊýÁ¿¡£ OR%'K2C6S
Threads_running ²»ÔÚ˯ÃßµÄÏß³ÌÊýÁ¿¡£ }s(N6 a&(
Uptime ·þÎñÆ÷¹¤×÷Á˶àÉÙÃë¡£ ~$)2s7
O
H@q?v+2
After create @JD;k>
N"]q='t
This occurs when the thread creates a table (including internal temporary tables), at the end of the function that creates the table. This state is used even if the table could not be created due to some error. a0D%k: k5
FFu9&8Y
Analyzing nEJY5Bz$
BW 4%l
The thread is calculating a MyISAM table key distributions (for example, for ANALYZE TABLE). y#U+c*LB
9%B\/&f
checking permissions xlA$:M&
dwDcR,z?a
The thread is checking whether the server has the required privileges to execute the statement. _V7r1fY:
*7ZN]/VRT
Checking table vb<oi&X
7?GIS '
The thread is performing a table check operation. .k%[4:Fe
M$/|)U'W
cleaning up L"o>wYx
>[*8I\*@n
The thread has processed one command and is preparing to free memory and reset certain state variables. 57umx`m
CG Y]r.O*
closing tables +l9!Fl{MK\
7UVzp v
The thread is flushing the changed table data to disk and closing the used tables. This should be a fast operation. If not, you should verify that you do not have a full disk and that the disk is not in very heavy use. >z%&xgOa
>8WP0Qx/
converting HEAP to MyISAM @~!wDDS
vms|x wb
The thread is converting an internal temporary table from a MEMORY table to an on-disk MyISAM table. 1IC~e^"
6p?,(
copy to tmp table iOU6V
++6`sMJ
The thread is processing an ALTER TABLE statement. This state occurs after the table with the new structure has been created but before rows are copied into it. i;/5Y'KZ
Fl kcU
`j
Copying to group table 'gC_)rK*
/178A;Jy
If a statement has different ORDER BY and GROUP BY criteria, the rows are sorted by group and copied to a temporary table. }001K
(.D~0a JU
Copying to tmp table }+.}J
#$18*?tLv|
The server is copying to a temporary table in memory. , w{e
A#.edVj.g4
Copying to tmp table on disk a1C{(f)
,}3
'I [
The server is copying to a temporary table on disk. The temporary result set was larger than tmp_table_size and the thread is changing the temporary table from in-memory to disk-based format to save memory. (;T^8mI2
F*IzQ(#HW
Creating index #|L8tuWW
RRmz"j>
The thread is processing ALTER TABLE ... ENABLE KEYS for a MyISAM table. 1oR7iD^
S\:P-&dC
Creating sort index ]{3)^axW;
tXNm$Cq.|
The thread is processing a SELECT that is resolved using an internal temporary table. s'!Cp=xQF"
o_XflzC
creating table arIf'CG6
J%u=Ucdh
The thread is creating a table. This includes creation of temporary tables. 2;k*@k-t
MI/MhkS
?
Creating tmp table IHB}`e|
Bo)3!wO8
The thread is creating a temporary table in memory or on disk. If the table is created in memory but later is converted to an on-disk table, the state during that operation will be Copying to tmp table on disk. ( /=f6^}
fT;s-v[`k
deleting from main table "sS}N%!
6/5YjO|a
The server is executing the first part of a multiple-table delete. It is deleting only from the first table, and saving columns and offsets to be used for deleting from the other (reference) tables. ?^7t'`zk
I@T8Iv=
deleting from reference tables bp*
^z,w
[A~y%bI"
The server is executing the second part of a multiple-table delete and deleting the matched rows from the other tables. DVG(Vw
M\o9I
discard_or_import_tablespace )B
T
`nUXDmdwzO
The thread is processing an ALTER TABLE ... DISCARD TABLEspaCE or ALTER TABLE ... IMPORT TABLEspaCE statement. @:j}Jmg
|9u OUE
end eX?OYDDC0j
IshKH-
This occurs at the end but before the cleanup of ALTER TABLE, CREATE VIEW, DELETE, INSERT, SELECT, or UPDATE statements. 4;w;'3zq
h:W;^\J:-
executing p?*Q- f
zpzK>DH(
The thread has begun executing a statement. $ZUdT
,KF'TsFf
Execution of init_command -c_74c50
US+Q~GTA
The thread is executing statements in the value of the init_command system variable. Qk0R a_
-j+UMlkB
freeing items b[sx_b
z#8~iF1
The thread has executed a command. This state is usually followed by cleaning up. ED2a}Tt>Z
hP=WFD&
Flushing tables c CSs
~De"?
The thread is executing FLUSH TABLES and is waiting for all threads to close their tables. N/[p <
8|b3j^u
FULLTEXT initialization 4ae`pAu
ucuSe!IcX
The server is preparing to perform a natural-language full-text search. heltgRt
)}''L{k-
init ~{*7"o/
~{?_p@&n
This occurs before the initialization of ALTER TABLE, DELETE, INSERT, SELECT, or UPDATE statements. 4]rnY~
#m lS}~n
Killed anuL1fXO
k=2Lo
Someone has sent a KILL statement to the thread and it should abort next time it checks the kill flag. The flag is checked in each major loop in MySQL, but in some cases it might still take a short time for the thread to die. If the thread is locked by some other thread, the kill takes effect as soon as the other thread releases its lock. V
@rI`~$
VJ84?b{c
W
Locked ]~844Jp
1ofKt=|=
The query is locked by another query. K*\'.~[6
?8HHA:GP
logging slow query |HU@
>
xE1 eT,
The thread is writing a statement to the slow-query log. w|3z;-#Q;
:Y-{Kn6`_
NULL BW-`t-,E;
\Fl+\?~D
This state is used for the SHOW PROCESSLIST state. u,F nAh?"
g$n7CXoT
login Xsa2(-
Yj%U
>),8
The initial state for a connection thread until the client has been authenticated successfully. Y_}mYvJW
yphS'AG
Opening tables, Opening table X7[^s
$VK
5>VY LI
The thread is trying to open a table. This is should be very fast procedure, unless something prevents opening. For example, an ALTER TABLE or a LOCK TABLE statement can prevent opening a table until the statement is finished. ()tp>
cQG
+$0(
preparing 0$_oT;{8
Q=BZ N]g2
This state occurs during query optimization. U ?'vXa
"nm FzN
Purging old relay logs 6)z?f4,
6Z#\CixG
The thread is removing unneeded relay log files. MWI4Y@1bS
VmCW6
G#M
query end CL)lq)1(
uqM yoIc
This state occurs after processing a query but before the freeing items state. Bt1p'g(V|
!E,A7s
Reading from net y'(Ne=y
T(AVlI6
The server is reading a packet from the network. )>b.;
#
S}Z8
Removing duplicates N-jTc?mT~&
=1O<E
The query was using SELECT DISTINCT in such a way that MySQL could not optimize away the distinct operation at an early stage. Because of this, MySQL requires an extra stage to remove all duplicated rows before sending the result to the client. k=4N(i/s
_
):d`O e
removing tmp table ~ zil/P8
?q(\=;Y
The thread is removing an internal temporary table after processing a SELECT statement. This state is not used if no temporary table was created. \%/#x V
.Q@S #d
rename !>BZ6gn5
?+g`HTY u
The thread is renaming a table. K+Z+wA?
o@#Y8M
rename result table K TsgJ\W
"z0zpHXek
The thread is processing an ALTER TABLE statement, has created the new table, and is renaming it to replace the original table. c9kzOQ2n
T[,/5J
Reopen tables {fha`i
f6_];]yP
The thread got a lock for the table, but noticed after getting the lock that the underlying table structure changed. It has freed the lock, closed the table, and is trying to reopen it. f;&]:2.j
4Ue_Y'LmM
Repair by sorting uKz,SqX
JCPUM*g8
The repair code is using a sort to create indexes. lqowG!3H
Y 2Q=rj
Repair done QV h4
ly4s"4v
The thread has completed a multi-threaded repair for a MyISAM table. #Hvq/7a2R
],ZzI
Repair with keycache -*~CV:2iq-
/wxE1][.
The repair code is using creating keys one by one through the key cache. This is much slower than Repair by sorting. PN$X N<
zP:cE
Rolling back +&X%<S
W
6oinidB[l
The thread is rolling back a transaction. -UZ@G~K
g|Y] wd
Saving state WKrX,GF
FZ|CqD"#
For MyISAM table operations such as repair or analysis, the thread is saving the new table state to the .MYI file header. State includes information such as number of rows, the AUTO_INCREMENT counter, and key distributions. QN>7~=`
- ZW3
Searching rows for update T"T;`y@(
/<&h@$NHH4
The thread is doing a first phase to find all matching rows before updating them. This has to be done if the UPDATE is changing the index that is used to find the involved rows. joXfmHB}
J9%@VZut
Sending data |!H?+Jj:
4KI [D{
The thread is processing rows for a SELECT statement and also is sending data to the client. aV`&L,Q)7E
L{ho*^b
setup V (rr"K+
-$<O\5cAQ
The thread is beginning an ALTER TABLE operation. Y-~~,Yl~
;`v% sx#
Sorting for group cPn+<M#
(0Naf
The thread is doing a sort to satisfy a GROUP BY. -Dzsa
=y%rG :!
Sorting for order zzZg$9PT[
XTqm]
The thread is doing a sort to satisfy a ORDER BY. 49 }{R/:
:a3LS|W
Sorting index ~fzuwz
BH@b1}
The thread is sorting index pages for more efficient access during a MyISAM table optimization operation. tkuc/Z/@
|$hgT K[L
Sorting result 8*!|8 BPj^
QLbMPS
For a SELECT statement, this is similar to Creating sort index, but for nontemporary tables. qeaA&(|5
J\W-dI
statistics cfoYnM
X<MpN5%|Wo
The server is calculating statistics to develop a query execution plan. 73DlRt
*
_|n=cC4Qu
System lock VEh]p5D
JmWR{du
The thread is going to request or is waiting for an internal or external system lock for the table. If this state is being caused by requests for external locks and you are not using multiple mysqld servers that are accessing the same tables, you can disable external system locks with the --skip-external-locking option. However, external locking is disabled by default, so it is likely that this option will have no effect. For SHOW PROFILE, this state means the thread is requesting the lock (not waiting for it). 0B3 QVbp'
F+j O*F2h
Table lock 0 K3Hf^>m
!Q[}s#g
The next thread state after System lock. The thread has acquired an external lock and is going to request an internal table lock. -h\@RC
ag]*DsBt
Updating J'7 y
T8q[7Zn
The thread is searching for rows to update and is updating them. @f=RL)$|
>)%#V<{<
updating main table M'|)dM|
FH
-p!4+]
The server is executing the first part of a multiple-table update. It is updating only the first table, and saving columns and offsets to be used for updating the other (reference) tables. q6)p*}-
nL\ZId
updating reference tables rIp'vy S\p
`Of[{.Q
The server is executing the second part of a multiple-table update and updating the matched rows from the other tables. R8{e&nPE
_s@bz|yqw
User lock \v s%U}IrO
wjg}[R@!
The thread is going to request or is waiting for an advisory lock requested with a GET_LOCK() call. For SHOW PROFILE, this state means the thread is requesting the lock (not waiting for it). 6o9sR)c
?
/9TL&_A-T
Waiting for tables, Waiting for table -Cml0}.O
I4CHfs"ar
The thread got a notification that the underlying structure for a table has changed and it needs to reopen the table to get the new structure. However, to reopen the table, it must wait until all other threads have closed the table in question. ax;{MfsK
)MMhlcNC
This notification takes place if another thread has used FLUSH TABLES or one of the following statements on the table in question: FLUSH TABLES tbl_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE, or OPTIMIZE TABLE. a]{uZGn@i
Q;Q
Waiting on cond `6n!$Cxo
% Mw' e/?
A generic state in which the thread is waiting for a condition to become true. No specific state information is available. T^+1rG
tu7+LwF7
Writing to net $8EV,9^U
^#}dPGm
The server is writing a packet to the network. 1mY+0
3. kill mysql Ö´ÐÐÏß³Ì 8H&_, ;
(1) show processlist;