²âÊÔSQL ServerÖ´ÐÐʱ¼äºÍCPUʱ¼ä
ÔÚÐèÒª²âÊÔsqlÓï¾ä»òÕß´æ´¢¹ý³ÌÐÔÄܵÄʱºò¿ÉÒÔÓõÃÉÏ
CHECKPOINT --ÓÃÓÚ¼ì²éµ±Ç°¹¤×÷µÄÊý¾Ý¿âÖб»¸ü¸Ä¹ýµÄÊý¾ÝÒ³»òÈÕÖ¾Ò³£¬²¢½«ÕâЩÊý¾Ý´ÓÊý¾Ý»º³åÆ÷ÖÐÇ¿ÖÆÐ´ÈëÓ²ÅÌ
GO
DBCC FreeProcCache --´Ó»º³å³ØÖÐɾ³ýËùÓлº³åÇø
DBCC DropCleanBuffers --´Ó¹ý³Ì¸ßËÙ»º´æÖÐɾ³ýËùÓÐÔªËØ
GO
DBCC FreeSystemCache('ALL') ;--Çå³ýSQLʵÀýµÄ¼Æ»®»º´æ
GO
SET Statistics IO ON
SET Statistics TIME ON
GO
---------------------------
DECLARE @b datetime
DECLARE @e datetime
set @b = getdate();
select COUNT(*) from test1;
set @e = getdate();
select DATEDIFF(ms,@b,@e)
----------------------------
SET Statistics IO OFF
SET Statistics TIME OFF
GO
DBCC DropCleanBuffers
DBCC FreeProcCache
Ö´Ðнá¹ûÈçÏ£º---------------------------------------------------------
ÿÌì½ø²½Ò»µãµã...
Ïà¹ØÎĵµ£º
CHARINDEXº¯Êý·µ»Ø×Ö·û»òÕß×Ö·û´®ÔÚÁíÒ»¸ö×Ö·û´®ÖÐµÄÆðʼλÖá£CHARINDEXº¯Êýµ÷Ó÷½·¨ÈçÏ£º
CHARINDEX ( expression1 , expression2 [ , start_location ] )
Expression1ÊÇÒªµ½expression2ÖÐѰÕÒµÄ×Ö·ûÖУ¬start_locationÊÇCHAR ......
VBͨ¹ýADOÁ¬½ÓSQL ServerÊý¾Ý¿â¿ÉÒÔ·ÖΪÓÐÔ´Êý¾Ý¿âÁ¬½ÓºÍÎÞÔ´Êý¾Ý¿âÁ¬½Ó£¬Çø±ðËüÃÇ¿´ÊÇ·ñʹÓÃÁËDSN£¨Êý¾ÝÔ´Ãû³Æ£©À´¾ö¶¨¡£
1 ÎÞÔ´Êý¾Ý¿âÁ¬½Ó
Æäʵ£¬“ÎÞÔ´Êý¾Ý¿â”Á¬½ÓÒ²²¢²»ÊÇ˵²»ÐèÒªÊý¾ÝÔ´£¬Èç¹ûûÓÐÊý¾ÝÔ´ÔòÁ¬½ÓÊÇÖ½ÉÏ̸±ø£¬Ö»ÊDz»ÐèÒªÅäÖÃODBCÊý¾ÝÔ´£¬ÀûÓÃADO¾Í¿Éͨ¹ý´úÂë½øÐÐÁ¬½Ó¡£
1.1 ADO ......
²éѯËÙ¶ÈÂýµÄÔÒòºÜ¶à£¬³£¼ûÈçϼ¸ÖÖ
1¡¢Ã»ÓÐË÷Òý»òÕßûÓÐÓõ½Ë÷Òý(ÕâÊDzéѯÂý×î³£¼ûµÄÎÊÌ⣬ÊdzÌÐòÉè¼ÆµÄȱÏÝ)
2¡¢I/OÍÌÍÂÁ¿Ð¡£¬ÐγÉÁËÆ¿¾±Ð§Ó¦¡£
3¡¢Ã»Óд´½¨¼ÆËãÁе¼Ö²éѯ²»ÓÅ»¯¡£
4¡¢ÄÚ´æ²»×ã
5¡¢ÍøÂçËÙ¶ÈÂý
6¡¢²éѯ³öµÄÊý¾ÝÁ¿¹ý´ó£¨¿ÉÒÔ²ÉÓöà´Î²éѯ£¬ÆäË ......
ÏÖÓÐtable_for_report_1ºÍtable_for_report_2£¬ÏêÇéÈçÏ£º
table_for_report_1ÓÐnum×ֶΣ¬c1,c2,c3×ֶΡ£
Êý¾ÝÈçÏ£º
num c1 c2 c3
1 15001346690 11 12 13
2 1 ......