[MySQLÓÅ»¯] ÈçºÎ²éÕÒSQLЧÂʵØÏµÄÔÒò
[MySQLÓÅ»¯] -- ÈçºÎ²éÕÒSQLЧÂʵØÏµÄÔÒò
ʱ¼ä:2010-2-28À´Ô´:HaCMS¿ªÔ´ÉçÇø ×÷Õß:chusong
²éѯµ½Ð§ÂÊµÍµÄ SQL Óï¾ä ºó£¬¿ÉÒÔͨ¹ý EXPLAIN »òÕß DESC ÃüÁî»ñÈ¡ MySQL ÈçºÎÖ´ÐÐ SELECT Óï¾äµÄÐÅÏ¢£¬°üÀ¨ÔÚ SELECT Óï¾äÖ´Ðйý³ÌÖбíÈçºÎÁ¬½ÓºÍÁ¬½ÓµÄ˳Ðò£¬±ÈÈçÎÒÃÇÏë¼ÆËã 2006 ÄêËùÓй«Ë¾µÄÏúÊ۶ÐèÒª¹ØÁª sales ±íºÍ company ±í£¬²¢ÇÒ¶Ô profit ×Ö¶Î×öÇóºÍ£¨ s ...
²éѯµ½Ð§ÂÊµÍµÄ SQL Óï¾ä ºó£¬¿ÉÒÔͨ¹ý EXPLAIN »òÕß DESC ÃüÁî»ñÈ¡ MySQL ÈçºÎÖ´ÐÐ SELECT Óï¾äµÄÐÅÏ¢£¬°üÀ¨ÔÚ SELECT Óï¾äÖ´Ðйý³ÌÖбíÈçºÎÁ¬½ÓºÍÁ¬½ÓµÄ˳Ðò£¬±ÈÈçÎÒÃÇÏë¼ÆËã 2006 ÄêËùÓй«Ë¾µÄÏúÊ۶ÐèÒª¹ØÁª sales ±íºÍ company ±í£¬²¢ÇÒ¶Ô profit ×Ö¶Î×öÇóºÍ£¨ sum £©²Ù×÷£¬ÏàÓ¦ SQL µÄÖ´Ðмƻ®ÈçÏ£º
mysql> explain select sum(profit) from sales a,company b where a.company_id = b.id and a.year = 2006\G;
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: a
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 12
Extra: Using where
*************************** 2. row ***************************
id: 1
select_type: SIMPLE
table: b
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 12
Extra: Using where
2 rows in set (0.00 sec)
ÿ¸öÁеĽâÊÍÈçÏ£º
Extra £ºÖ´ÐÐÇé¿öµÄ˵Ã÷ºÍÃèÊö¡£
ÔÚÉÏÃæµÄÀý×ÓÖУ¬ÒѾ¿ÉÒÔÈ·ÈÏÊÇ ¶Ô a ±íµÄÈ«±íɨÃèµ¼ÖÂЧÂʵIJ»ÀíÏ룬ÄÇô ¶Ô a ±íµÄ year ×ֶδ´½¨Ë÷Òý£¬¾ßÌåÈçÏ£º
mysql> create index idx_sales_year on sales(year);
Query OK, 12 rows affected (0.01 sec)
Records: 12 Duplicates: 0 Warnings: 0
´´½¨Ë÷Òýºó£¬ÕâÌõÓï¾äµÄÖ´Ðмƻ®ÈçÏ£º
mysql> explain select sum(profit) from sales a,company b where a.company_id = b.id and a.year = 2006\G;
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: a
type: ref
possible_keys: idx_sales_year
key: idx_sales_
Ïà¹ØÎĵµ£º
1. ËÀËøÔÀí
¸ù¾Ý²Ù×÷ϵͳÖе͍Ò壺ËÀËøÊÇÖ¸ÔÚÒ»×é½ø³ÌÖеĸ÷¸ö½ø³Ì¾ùÕ¼Óв»»áÊͷŵÄ×ÊÔ´£¬µ«Òò»¥ÏàÉêÇë±»ÆäËû½ø³ÌËùÕ¾Óò»»áÊͷŵÄ×ÊÔ´¶ø´¦ÓÚµÄÒ»ÖÖÓÀ¾ÃµÈ´ý״̬¡£
ËÀËøµÄËĸö±ØÒªÌõ¼þ£º
»¥³âÌõ¼þ(Mutual exclusion)£º×ÊÔ´²»Äܱ»¹²Ïí£¬Ö»ÄÜÓÉÒ»¸ö½ø³ÌʹÓá£
ÇëÇóÓë±£³ÖÌ ......
×î½üÕÛÌÚGeoServerÓëMysqlµÄÁ¬½Ó£¬ÊÔÁ˲»ÉÙʱ¼ä£¬³öÏÖÁ˼¸¸öÎÊÌâ
1 ·¢²¼µÄ»ùÓÚmysqlÊý¾Ý¿âLayer£¬ÔÚÔ¤ÀÀʱʧ°Ü
Ïà¹Ø°æ±¾ÈçÏ£º
Gerserver 2.0.1
Mysql 5.5.1
mysql-connector-java-5.1.5.jar
gt-mysql-2.6.0.jar
ºó³¢ÊÔÌæ»»MysqlÊý¾Ý¿â°æ±¾Îª5.0 ......
ÓÉÓÚÖÖÖÖÔÒò£¬ÎÒÃÇÈç¹ûµ±Ê±½ö½ö±¸·ÝÁËmdfµµ£¬ÄÇô»Ö¸´ÆðÀ´¾ÍÊÇÒ»¼þºÜÂé·³µÄÊÂÇéÁË¡£
Èç¹ûÄúµÄmdfµµÊǵ±Ç°×ÊÁÏ¿â²úÉúµÄ£¬ÄÇôºÜ½ÄÐÒ£¬Ò²ÐíÄãʹÓÃsp_attach_db»òÕßsp_attach_single_file_db¿ÉÒÔ»Ö¸´×ÊÁϿ⣬µ«ÊÇ»á³öÏÖÀàËÆÏÂÃæµÄÌáʾ×ÊѶ
É豸Æô¶¯´íÎó¡£ÎïÀíµµ°¸Ãû 'C:\Program Files\Microsoft SQL S ......
1. ¿ÉÒÔÓýű¾±¸·Ý
¡¡¡¡manger studio--ÓÒ¼üÄãµÄÊý¾Ý¿â--ÈÎÎñ--Éú³É½Å±¾
¡¡¡¡Ôڽű¾Éú³ÉÏòµ¼µÄ"Ñ¡Ôñ¶ÔÏóÀàÐÍ"²½ÖèÖÐ, ½«"´æ´¢¹ý³Ì"Ñ¡ÉÏ, ÔÚ½ÓÏÂÀ´µÄ"Ñ¡Ôñ´æ´¢¹ý³Ì"µÄ²½ÖèÖÐ, Ñ¡ÔñËùÓеĴ洢¹ý³Ì(»òÕßÄãÒª¸´ÖƵĴ洢¹ý³Ì)
¡¡¡¡Íê³Éºó, ËùÓд洢¹ý³ÌµÄ½Å±¾»áÉú³ÉÔÚÒ»¸öеIJéѯ´°¿ÚÖÐ, ¹ØµôÉú³É½Å±¾Ïòµ¼, ÔÚÉú³ÉµÄ´æ´¢¹ý³Ì ......
VS2010ÒѾ·¢²¼¼¸Ììʱ¼äÁË£¬Ò»Ð©ÐµÄÌØÐÔÌØ±ðÒýÈËעĿ£¬±ÈÈ磺 ÐÔÄܵÄÎȶ¨ºÍÌáÉý£¬±íÏÖÔÚWPF GUIºÍWPFÎı¾³ÊÏÖ¡£ Windows Azure ToolsÄ£°å¡£ ¶àÏÔʾÆ÷Ö§³Ö£¬Êä³ö´°¿Ú£¬Ààͼ´°¿Ú£¬´úÂ붨Òå´°¿ÚµÈÌṩ¸¨ÖúÐÅÏ¢µÄ´°¿Ú·ÅÖÃÔÚ¸±ÏÔʾÆ÷ÖС£ ¶Ô²¢ÐмÆË㿪·¢µÄ´óÁ¿Ö§³Ö¡£ °üº¬ÁËSharePointµÄÏîĿģ°åºÍµ÷ÊÔÖ§³Ö ......