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

Sql Server 2005 ͳ¼ÆÐÅÏ¢ÓÃ;

1, ʲôÊÇͳ¼ÆÐÅÏ¢ 
    ÒÔÏÂÊǹٷ½µÄ¶Ôͳ¼ÆÐÅÏ¢µÄÃèÊö£º
     °´ÕÕĬÈÏÉèÖã¬Èç¹û±íÖеÄijÁÐûÓÐË÷Òý£¬ÔòSQL Server»á×Ô¶¯Îª¸ÃÁд´½¨Í³¼Æ¡£È»ºó£¬²éѯÓÅ»¯Æ÷ÆÀ¹À¸ÃÁÐÖÐÊý¾Ý·Ö²¼·¶Î§µÄͳ¼ÆÐÅÏ¢£¬ÒÔÑ¡ÔñÒ»¸ö¸üΪÓÐЧµÄ²éѯ´¦Àí·½°¸¡£·Ö±æ×Ô¶¯´´½¨µÄͳ¼ÆºÜ¼òµ¥£¬ÔÚSQL Server 7.0ºÍSQL Server 2000ÖУ¬×Ô¶¯´´½¨µÄͳ¼ÆµÄǰ׺Ϊ_WA_Sys¡£
 
  ¸öÈ˸ÐÏ룺  
    ÒÔÇ°¶Ô_WA_Sys¿ªÍ·µÄͳ¼ÆÐÅÏ¢Ò»Ö±²»ÖªµÀÓÐʲôÓã¬ÔÚѧϰÁËoracleʱµÄCBOºÍÈý¸öËã·¨£¨Ç¶Ì×Ñ­»·£¬ºÏ²¢Á¬½ÓºÍhashÁ¬½Ó£©²Å·¢ÏÖÕâ¸ö_WA_Sys¿ªÍ·µÄͳ¼ÆÐÅÏ¢ºÍË÷ÒýµÄͳ¼ÆÐÅÏ¢¶ÔÎÒÃÇÓû§Ã»Ó㬶ÔÊý¾Ý¿âÊǺÜÖØÒªµÄ¡£
   2, ͳ¼ÆÐÅÏ¢ÄÚÈÝ£º
dbcc show_statistics('[[zping.com]]]',idx_operator)
   ÔËÐÐÉÏÃæÃüÁîÒԺ󣬳öÀ´ÏÂÁÐÐÅÏ¢£º    
Name         Updated                        Rows Rows      Sampled    Steps     Density           Average key length    String Index
idx_operator 07 24 2008  8:15PM   721370          721370     200      0.002035875  63.99907               YES
 ÕâÀïµÄÐÅϢ˵Ã÷£º
     name:ͳ¼ÆÐÅÏ¢µÄÃû³Æ¡£ Updated :ÉÏÒ»´Î¸üÐÂͳ¼ÆÐÅÏ¢µÄÈÕÆÚºÍʱ¼ä   
     Rows :±íÖеÄÐÐÊý¡£ Rows Sampled :ͳ¼ÆÐÅÏ¢µÄ³éÑùÐÐÊý¡£
     Steps:·Ö·¢²½ÖèÊý(ÔÚsql server×î¶à200²½£©  Average key length :ËùÓÐË÷ÒýÁеÄƽ¾ù³¤¶È
   ÕâЩÐÅÏ¢ÊǶÔͳ¼ÆÐÅÏ¢Ò»¸ö»ã×Ü
   »¹ÓÐÏÂÁÐÐÅÏ¢£º   
All density     Average Le


Ïà¹ØÎĵµ£º

SQL SERVERÐÔÄÜ·ÖÎö ËÀËø¼ì²âÊý¾Ý¿â×èÈûÓï¾ä

×÷ÖÐÊý¾Ý¿â¾­³£³ö´íËÀËø£¬²¢ÇÒ»¹ÒªÒªÇó½â¾öµ±Ç°µÄËÀËø£¬ÎÊÌâ¶à¶à£»
²ÎÕÕCSDN£¬Öйú·ç(Roy)һƪËÀËøÎÄÕ²¢¸Ä½øÁËÏ£»
/***********************************************************************************************************************
ÕûÀíÈË£ººÚľÑÂÉϵÄÎÏÅ£(lenolotus) ÈÕÆÚ:2009.04.28
************ ......

¸ßЧSQL²éѯ֮Ë÷Òý£¨II£©

ÉÏ»ØÎÒÃÇ˵µ½ÆÀ¹ÀÒ»ÌõÓï¾äÖ´ÐÐЧÂÊÖ÷Òª¿´Âß¼­ IO £¨É¶ÊÇÂß¼­ IO £¬É¶ÊÇÎïÀí IO ¼ûÁª»úÎĵµ£©£¬Õâ´ÎÎÒÃǼÌÐø¡£
ÎÒÃÇÏÈ˵˵£¬·µ»Ø¶àÐнá¹ûʱ£¬ÎªÊ²Ã´ SQLServer ÓÐʱ»áÑ¡Ôñ index seek £¬ÓÐʱ»áÑ¡Ôñ index scan ¡£
ÒÔ nonclustered index ΪÀý˵Ã÷¡£
ÏñËùÓеÄË÷Òý B Ê÷Ò»Ñù£¬·Ç¾Û¼¯Ë÷ÒýÊ÷Ò²°üÀ¨ÍêÈ«ÓÉË÷ÒýÊý¾Ý×é³ÉµÄ¸ù½ ......

¸ßЧSQL²éѯ֮Ë÷Òý£¨III£©

ÏÈ˵˵ÕâЩÎóÇø¡£Ëùν“ÎóÇø”£¬ÓÐһЩÊÇÐÂÊÖºÜÈÝÒ×·¸µÄ´íÎó»òÕߺÜÈÝÒ׺öÂÔµÄÎÊÌ⣬ÁíÍâһЩ£¬ÔòÊÇÏñ“ºÄ×Ó³ÔÁËÑλá±ä³Éòùòð”Ò»Ñù£¬ÈÃÎÒÃÇ´ÓС¾ÍÈÏΪÊÇÕýÈ·µÄÊÂÇé¡£ÈçÏ£º
1¡¢   ±íÉϲ»¹ÜÓõÃ×ÅÓò»×Å£¬¶¼¼Ó¸ö¾Û¼¯Ë÷Òý¡£
ÎÒÃÇÖªµÀ£¬±íÒÔÁ½ÖÖ·½Ê½×éÖ¯ÎïÀí´æ´¢£ºÓоۼ¯Ë÷ÒýµÄ“¾Û¼¯± ......

C#ÏîÄ¿´ò°ü£¬²¢×Ô¶¯°²×°SQLÊý¾Ý¿â

ӦһλÍøÓѵÄÐèÇ󣬲¢ÐÞÕýÁËMVPÀîºé¸ù".NETƽ̨ÏÂWEBÓ¦ÓóÌÐòµÄ²¿Êð(°²×°Êý¾Ý¿âºÍ×Ô¶¯ÅäÖÃ)"ÖеÄosqlÓ÷¨´íÎó£¬ÒѲâÊÔͨ¹ý¡£
Ò»).´´½¨²¿ÊðÏîÄ¿
1. ÔÚ“Îļþ”²Ëµ¥ÉÏÖ¸Ïò“Ìí¼ÓÏîÄ¿”£¬È»ºóÑ¡Ôñ“н¨ÏîÄ¿”¡£
2. ÔÚ“Ìí¼ÓÐÂÏîÄ¿”¶Ô»°¿òÖУ¬Ñ¡Ôñ“ÏîÄ¿ÀàÐÍ”´°¸ñÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ