MSSQL ÐÐÊýͳ¼ÆµÄÎÊÌâ - MS-SQL Server / ÒÉÄÑÎÊÌâ
ÓÐÁ½¸ö±í£¬ÊýÁ¿¼¶ÔÚ3000w×óÓÒ£¬ Ïë²é¿´¾ßÌåµÄÊýÁ¿£¬ÓÃselect Count(*) ËÙ¶ÈÌ«Âý£¬ ֮ǰ¿´µ½ËµÔÚsysindexesÖÐÓÐrows ÁУ¬ µ«ÊÇÎÒ·¢ÏÖ£¬ÕâÁ½¸öµÄÖµ²»Ò»Ñù£¬Ôõô»ØÊ°¡£¿ лл
ÓÐÈËÄܻشðÒ»ÏÂÂð? ²»ÊǺÜÃ÷°×°¡ÒýÓà ÓÐÁ½¸ö±í£¬ÊýÁ¿¼¶ÔÚ3000w×óÓÒ£¬ Ïë²é¿´¾ßÌåµÄÊýÁ¿£¬ÓÃselect Count(*) ËÙ¶ÈÌ«Âý£¬ ֮ǰ¿´µ½ËµÔÚsysindexesÖÐÓÐrows ÁУ¬ µ«ÊÇÎÒ·¢ÏÖ£¬ÕâÁ½¸öµÄÖµ²»Ò»Ñù£¬Ôõô»ØÊ°¡£¿ лл »á²»»áÊÇÄãcount()²éѯÍêµÄʱºò£¬ÁíÒ»¸öÓû§ÔÚÔö¼Ó»òɾ³ý¼Ç¼£¬µ¼ÖÂÄãÔÙ²éѯsysindexes±íµÄʱºò£¬¼Ç¼²»Ò»Ö¡£ ѧϰ£¡ sysindexes±íͳ¼Æ³öÀ´µÄÊǸö²»Ì«¾«È·µÄÖµ ÒòΪsql server²»ÊÇʵʱ¸üÐÂsysindexesÖеÄrowsÁУ¬¶øÊǶ¨Ê±¸üС£
Ïà¹ØÎÊ´ð£º
ÏÖÔÚÓÐÁ½ÕÅ±í£ºÎÄÕÂÖ÷±íA(articleId,articleTitle)£¬ÎÄÕÂÆÀÂÛ±íB(commentId,articleId,commentTitle) ÏÖÔÚÎÒÏëʵÏÖÕâÑùµÄ¹¦ÄÜ£ºÁгöÎÄÕÂÁÐ±í£¬ÆäÖÐÿƪÎÄÕ±êÌâÏÂÃæÁгö´ËÎÄÕµÄÇ°2¸öÎÄÕÂÆÀÂÛ£¬ÇëÎÊsqlÓï¾äÔõôд°¡ ......
ÐèÇóÈçÏ£º ѧԺ academy£¨aid,aname£© °à¼¶ class£¨cid,cname,aid£© ѧÉú stu(sid,sname,aid,cid) סËÞÇø region(rid,rname) ËÞÉáÂ¥ build(bid,rid,bnote) bnoteÊÇ¡®ÄС¯/¡®Å®¡¯ ËÞÉá dorm(did,rid,bid£¬bedn ......
ÕâÀïÏëÁ˽âÏ£¬¹ØÓÚSQL ServerÖзÖÒ³ºÍOracleÖзÖÒ³£» ƽ³£Ð´Ó¦ÓóÌÐòµÄʱºò£¬±ÈÈçÓõÄÓïÑÔÊÇJava£¬ÓиöÁбíÒ³Ã棬ÐèÒª¶ÔÊý¾Ý·ÖÒ³ÏÔʾ£» ÕâÀïÒª·ÖÒ³ÄѵÀ²»ÐèÒª½èÖúJava£¬¶øÖ±½ÓsqlÄÜÖªµÀ·ÖÒ³Âð£¬ÆðÂëÒ²Òª´«¸öÒ³Âë½ ......
±íÊý¾Ý COL1 COL2 COL2 COL4 COL5 ---------------------------------------------------------------------------------------------- 2010-05-05 00:00 ......
ͨ¹ýNAME×Ö¶ÎÌõ¼þ²éѯһ¸öÊý¾Ý±í£¬¼ÙÉèÎÒÓÐ100¸öÐÕÃû£¬ÓÐÒÔÏÂÁ½¸ö·½·¨£¬ ·½·¨1£º °Ñ100¸öName ×é³ÉÒ»¸öSQLÓï¾ä£¬±ÈÈç Select * from tmp_table where Name='ÕÅÈý' or Name ='ÀîËÄ' Or ...Or Name='µÚÒ»°Ù¸öÐÕÃû' ......