Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

[MySQLÓÅ»¯] ÈçºÎʹÓÃSQL Profiler ÐÔÄÜ·ÖÎöÆ÷


[MySQLÓÅ»¯] -- ÈçºÎʹÓÃSQL Profiler ÐÔÄÜ·ÖÎöÆ÷
ʱ¼ä:2010-2-28À´Ô´:HaCMS¿ªÔ´ÉçÇø ×÷Õß:diesou
mysql µÄ sql ÐÔÄÜ·ÖÎöÆ÷Ö÷ÒªÓÃ;ÊÇÏÔʾ sql Ö´ÐеÄÕû¸ö¹ý³ÌÖи÷Ïî×ÊÔ´µÄʹÓÃÇé¿ö¡£·ÖÎöÆ÷¿ÉÒÔ¸üºÃµÄչʾ³ö²»Á¼ SQL µÄÐÔÄÜÎÊÌâËùÔÚ¡£ ÏÂÃæÎÒÃǾÙÀý½éÉÜһϠMySQL SQL Profiler µÄʹÓ÷½·¨£º Ê×ÏÈ£¬¿ªÆô MySQL SQL Profiler mysql> SELECT @@profiling; +------- ...
mysql µÄ sql ÐÔÄÜ·ÖÎöÆ÷Ö÷ÒªÓÃ;ÊÇÏÔʾ sql Ö´ÐеÄÕû¸ö¹ý³ÌÖи÷Ïî×ÊÔ´µÄʹÓÃÇé¿ö¡£·ÖÎöÆ÷¿ÉÒÔ¸üºÃµÄչʾ³ö²»Á¼ SQL µÄÐÔÄÜÎÊÌâËùÔÚ¡£ 
ÏÂÃæÎÒÃǾÙÀý½éÉÜһϠMySQL SQL Profiler µÄʹÓ÷½·¨£º 
Ê×ÏÈ£¬¿ªÆô MySQL SQL Profiler
mysql> SELECT @@profiling; 
+-------------+ 
| @@profiling | 
+-------------+ 
| 0 | 
+-------------+ 
1 row in set (0.00 sec) 
mysql> SET profiling = 1; 
Query OK, 0 rows affected (0.00 sec) 
mysql> SELECT @@profiling; 
+-------------+ 
| @@profiling | 
+-------------+ 
| 1 | 
+-------------+ 
1 row in set (0.00 sec) 
ĬÈÏÇé¿öÏ profiling µÄֵΪ 0 ±íʾ MySQL SQL Profiler ´¦ÓÚ OFF ״̬£¬¿ªÆô SQL ÐÔÄÜ·ÖÎöÆ÷ºó profiling µÄֵΪ 1. 
ͨ¹ý sql ÐÔÄÜ·ÖÎöÆ÷£¬ÎÒÃÇÀ´¶Ô±ÈһϠÏÂÁÐÓï¾äǰºó 2 ´ÎÖ´Ðйý³ÌµÄ²îÒ죬¶ÔÎÒÃÇÁ˽â sql µÄÏêϸִÐйý³ÌÊǷdz£ÓаïÖúµÄ¡£
mysql> create table t_engines select * from t_engines1; 
Query OK, 57344 rows affected (0.10 sec) 
Records: 57344 Duplicates: 0 Warnings: 0 
mysql> select count(*) from t_engines; 
+----------+ 
| count(*) | 
+----------+ 
| 57344 | 
+----------+ 
1 row in set (0.00 sec) 
mysql> select count(*) from t_engines; 
+----------+ 
| count(*) | 
+----------+ 
| 57344 | 
+----------+ 
1 row in set (0.00 sec) 
mysql> SHOW PROFILES; 
+----------+------------+-------------------------------------------------+ 
| Query_ID | Duration | Query | 
+----------+------------+-------------------------------------------------+ 
| 26 | 0.


Ïà¹ØÎĵµ£º

SQL 2005 CHECKÔ¼ÊøºÍ¹æÔòÇø±ð


Ò»¡¢Ô¼Êø   
      Ô¼Êø¶¨Ò幨ÓÚÁÐÖÐÔÊÐíÖµµÄ¹æÔò£¬ÊÇÇ¿ÖÆÍêÕûÐԵıê×¼»úÖÆ¡£
      Ê¹ÓÃÔ¼ÊøÓÅÏÈÓÚʹÓô¥·¢Æ÷¡¢¹æÔòºÍĬÈÏÖµ¡£²éѯÓÅ»¯Æ÷ҲʹÓÃÔ¼Êø¶¨ÒåÉú³É¸ßÐÔÄܵIJéѯִÐмƻ®¡£SQL Server 2005Ö§³ÖÎåÀàÔ¼Êø£º  
      1. NOT ......

SQL ServerËÀËø

 1. ËÀËøÔ­Àí
    ¸ù¾Ý²Ù×÷ϵͳÖе͍Ò壺ËÀËøÊÇÖ¸ÔÚÒ»×é½ø³ÌÖеĸ÷¸ö½ø³Ì¾ùÕ¼Óв»»áÊͷŵÄ×ÊÔ´£¬µ«Òò»¥ÏàÉêÇë±»ÆäËû½ø³ÌËùÕ¾Óò»»áÊͷŵÄ×ÊÔ´¶ø´¦ÓÚµÄÒ»ÖÖÓÀ¾ÃµÈ´ý״̬¡£
    ËÀËøµÄËĸö±ØÒªÌõ¼þ£º
»¥³âÌõ¼þ(Mutual exclusion)£º×ÊÔ´²»Äܱ»¹²Ïí£¬Ö»ÄÜÓÉÒ»¸ö½ø³ÌʹÓá£
ÇëÇóÓë±£³ÖÌ ......

תÌû sqlË÷Òý½á¹¹

Ò»¡¢ÉîÈëdz³öÀí½âË÷Òý½á¹¹
ʵ¼ÊÉÏ£¬Äú¿ÉÒÔ°ÑË÷ÒýÀí½âΪһÖÖÌØÊâµÄĿ¼¡£Î¢ÈíµÄSQL SERVERÌṩÁËÁ½ÖÖË÷Òý£º¾Û¼¯Ë÷Òý£¨clustered index£¬Ò²³Æ¾ÛÀàË÷Òý¡¢´Ø¼¯Ë÷Òý£©ºÍ·Ç¾Û¼¯Ë÷Òý£¨nonclustered index£¬Ò²³Æ·Ç¾ÛÀàË÷Òý¡¢·Ç´Ø¼¯Ë÷Òý£©¡£ÏÂÃæ£¬ÎÒÃǾÙÀýÀ´ËµÃ÷һϾۼ¯Ë÷ÒýºÍ·Ç¾Û¼¯Ë÷ÒýµÄÇø±ð£º
Æäʵ£¬ÎÒÃǵĺºÓï×ÖµäµÄÕýÎı¾Éí¾ ......

(ת)mysqlÄÚ´æµ÷ÓÅ

key_buffer_size - Õâ¶ÔMyISAM±íÀ´Ëµ·Ç³£ÖØÒª¡£Èç¹ûÖ»ÊÇʹÓÃMyISAM±í£¬¿ÉÒÔ°ÑËüÉèÖÃΪ¿ÉÓÃÄÚ´æµÄ 30-40%¡£ºÏÀíµÄֵȡ¾öÓÚË÷Òý´óС¡¢Êý¾ÝÁ¿ÒÔ¼°¸ºÔØ¡£
¼Çס£¬MyISAM±í»áʹÓòÙ×÷ϵͳµÄ»º´æÀ´»º´æÊý¾Ý£¬Òò´ËÐèÒªÁô³ö²¿·ÖÄÚ´æ¸øËüÃÇ£¬ºÜ¶àÇé¿öÏÂÊý¾Ý±ÈË÷Òý´ó¶àÁË¡£¾¡¹ÜÈç´Ë£¬ÐèÒª×ÜÊǼì²éÊÇ·ñËùÓÐµÄ key_buffer ¶¼±»ÀûÓÃÁË¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ