<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_脚印</title><subtitle type="text"/><id>http://feed.cnblogs.com/blog/u/24087/rss</id><updated>2011-12-06T02:32:55Z</updated><author><name>脚印</name><uri>http://www.cnblogs.com/moses/</uri></author><generator>CNBlogs BlogServer</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moses/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/24087/rss"/><entry><id>http://www.cnblogs.com/moses/archive/2011/12/05/2277043.html</id><title type="text">【转】 Image Tips for Windows Phone 7</title><summary type="text">引用地址：http://blog.csdn.net/huangliangjie/article/details/6710188在开发WP7程序过程中，会遇到在UI上使用用大量的Image这种情况。你可能会以为使用Image是一个很简单的事情，不需要用一篇博客的篇幅的介绍：仅仅设置一个Uri给Image的Source属性就完成了？但是，还有其他的事情需要考虑呢。这里有许多的小细节如果你知道到的话，会对的你的程序有帮助，特别是当希望开发出的软件能够有较好的体验和较少的内存使用(移动开发这点很重要)。这些小的提示，不仅适用WP7手机开发，同样也适用SilverLight桌面程序。但是在手机开发中，把</summary><published>2011-12-05T09:09:00Z</published><updated>2011-12-05T09:09:00Z</updated><author><name>脚印</name><uri>http://www.cnblogs.com/moses/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moses/archive/2011/12/05/2277043.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moses/archive/2011/12/05/2277043.html"/><content type="html">&lt;div&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;/p&gt;&lt;p&gt;引用地址：&amp;nbsp;&lt;a href="http://blog.csdn.net/huangliangjie/article/details/6710188"&gt;http://blog.csdn.net/huangliangjie/article/details/6710188&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;在开发WP7程序过程中，会遇到在UI上使用用大量的Image这种情况。你可能会以为使用Image是一个很简单的事情，不需要用一篇博客的篇幅的介绍：仅仅设置一个Uri给Image的Source属性就完成了？但是，还有其他的事情需要考虑呢。这里有许多的小细节如果你知道到的话，会对的你的程序有帮助，特别是当希望开发出的软件能够有较好的体验和较少的内存使用(移动开发这点很重要)。这些小的提示，不仅适用WP7手机开发，同样也适用SilverLight桌面程序。但是在手机开发中，把握住那些能够把一个好的程序变成一个优秀的程序性能细节是非常重要的技能。为了指出这一点，这里举出一个实现了这些小细节的示例。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; "&gt;JPG&lt;/span&gt;&amp;nbsp;VS&amp;nbsp;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; "&gt;PNG&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 13px; "&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;如果要在JPG和PNG之间做个选择，那为你的所有不透明的图片都使用JPG吧。Window Phone 7操作系统上的JPG解码器相比之下要比PNG解码器快很多。当然，如果你的图片需要是透明的，那PNG是你唯一的选择了。&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 13px; "&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; "&gt;Resource&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 13px; "&gt;&amp;nbsp;vs&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; "&gt;Content&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 13px; "&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;在Visual Studio中把&amp;#8220;Build Type&amp;#8221;设置成&amp;#8220;Resource&amp;#8221;或者&amp;#8220;Content&amp;#8221;，图片都会编译成Window Phone XAP文件的一部分。由于他们都被打包到XAP中，起初可能你看不出他俩有什么区别，貌似都是一路货色。但当你撬开XAP的外壳(重命名为.zip文件并解压缩)：那是你可以看到所有的&amp;#8220;Content&amp;#8221;类型文件，却找不着&amp;#8220;Resource&amp;#8221;类型文件。为什么？因为&amp;#8220;Resource&amp;#8221;类型的文件嵌到了程序集里了(也就是dll文件里)。那么，我们为何又如此关心&amp;#8220;Resource&amp;#8221;文件到底是嵌到哪儿去了。这是因为你的程序的DLL包越大，你的程序启动就会越慢。但另一方面，跟图片从磁盘加载相比，嵌入DLL的图片加载会更快速。&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; "&gt;Summary：&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 13px; "&gt;设置成&amp;#8221;Content&amp;#8220;会让程序启动更快，设置成&amp;#8221;Resource&amp;#8220;会让程序更快的响应。&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 13px; "&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;还有值得一提的就是他们有着不同的URI格式，可以参考下面的例子：&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif; font-size: 9pt; "&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Content:&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Consolas; color: blue; font-size: 9.5pt; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Consolas; color: #a31515; font-size: 9.5pt; "&gt;Image&lt;/span&gt;&amp;nbsp;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 'Times New Roman'; font-size: 13px; "&gt;Source&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Consolas; color: blue; font-size: 9.5pt; "&gt;="/ImagesAsContent/smiley1.png"/&amp;gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 13px; "&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif; font-size: 9pt; "&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Resource:&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Consolas; color: blue; font-size: 9.5pt; "&gt;&amp;lt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Consolas; color: #a31515; font-size: 9.5pt; "&gt;Image&lt;/span&gt;&amp;nbsp;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 'Times New Roman'; font-size: 13px; "&gt;Source&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Consolas; color: blue; font-size: 9.5pt; "&gt;="..\ImagesAsResource\smiley3.png"/&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;img src="http://hi.csdn.net/attachment/201108/26/0_13143696188yTj.gif" alt="" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; "&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; "&gt;Async&lt;/span&gt;&amp;nbsp;vs.&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; "&gt;Sync Loading of images&lt;/span&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; "&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 13px; "&gt;如果你专研过Imaging API 你会发现BitmapImage这个类，在创建一个Image的时候BitmapImage会在幕后做很多的工作。它能以两种模式加载内容：&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: #333333; line-height: 18px; background-color: #ced5db; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Consolas; color: black; font-size: 10pt; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-color: #ffffcc; "&gt;&amp;nbsp; BitmapImage.UriSource = uriSource;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-color: #ffffcc; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Consolas; color: green; font-size: 10pt; "&gt;// loads the image via URI, asynchronously&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Consolas; color: black; line-height: 14px; font-size: 10pt; "&gt;&amp;nbsp; BitmapImage.SetSource(stream);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Consolas; color: green; line-height: 14px; font-size: 10pt; "&gt;// loads the image from stream, synchronously&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;注意到异步加载图片并不意味着完全的off-thread。这是因为有关图片的解码是发生在UI线程上的。关于在保持UI线程响应的情况下，异步加载图片的详细信息参考David Anson的博客.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;下面是一些关于同步vs异步加载的知识：&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;1.如果同步加载一张不正确的图片文件，将会得到一个异常。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;2.如果异步加载一张不正确的图片文件，ImageFailed事件会触发。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;3.如果异步加载一张正确的图片文件，ImageOpened事件会触发。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;4.如果同步加载一张正确的图片文件，ImageOpened事件不会触发。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;它们的不同可以通过我给出的示例代码演示（在Loading页面里）&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;img src="http://hi.csdn.net/attachment/201108/26/0_1314370386dP6j.gif" alt="" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 18px; "&gt;Image Caching&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;这是图片比较重要的一个方面，MSDN对于它的记录也很少。在WP7 Platform中即使清空了Source属性并且把Image从visual tree中去除，Image的内存还是不会释放，其实这时你看到的是图片的缓存。这是一个预留的性能优化，是为了避免一遍又一遍的加载和解码相同的图片。WP7中在内存中开辟了一个缓冲区，我们可以利用它方便快捷的再利用图片资源。这里与浏览器的缓存类似。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;虽然 图片缓存对于提高性能有很大的帮助，但是有时候也会增加不必要的内存消耗。特别是还回收再利用那些不会再显示的图片。在程序的运行过程中，图片缓存会一直占用内存空间。不过也可以通过下列代码删除缓存信息：&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;BitmapImage&amp;nbsp;bitmapImage = image.Source&amp;nbsp;as&amp;nbsp;BitmapImage;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;bitmapImage.UriSource =&amp;nbsp;null;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;image.Source =&amp;nbsp;null;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;合理的利用上述代码可以减少内存使用。而减少内存使用在手机开发中对于性能有较大的帮助。在示例程序里，在&amp;#8220;Caching&amp;#8221;页面中监视了显示和清除缓存的内存使用情况，在示例中可以看到有3MB的内存差异。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;img src="http://hi.csdn.net/attachment/201108/26/0_1314370581hgNX.gif" alt="" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 18px; "&gt;BitmapCreateOptions&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 13px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;这是 一个快速而且很有意思的部分。创建一个BitmapImage的时候，你有可能会有这样的疑问：为什么当你认为已经完成图片创建时仍不会返回图片的大小呢？这是因为CreateOptions 属性默认被设置成了&amp;#8220;DelayCreation&amp;#8221;，也就是说当BitmapImage被设置成一个Image的Source属性上或者是可视化树的ImageBrush上，这个对象只有在真正需要它的时候才会被创建。这里就允许在程序开始运行的时候Creating很多的BitmapImage，却不消耗任何的资源（CPU或者是内存）直到程序需要特定的图片才会真正创建它们。如果你想强制的立即执行创建操作，把CreateOptions设置成&amp;#8220;None&amp;#8221;即可。CreateOptions&amp;nbsp;还有一个值是&amp;#8220;IgnoreImageCache&amp;#8221;，这个值在很多的场景中都不是很有用，而且他还需要和设计工具结合（如Blend）。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 18px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 13px; "&gt;在示例程序里，在&amp;#8220;CreateOptions&amp;#8221;页面中，通过Create/Show/Clear控制&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;CreateOptions的值为&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;DelayCreation&lt;/span&gt;&lt;/span&gt;，None并监视图片大小的变化。&lt;/span&gt;&lt;/span&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;img src="http://hi.csdn.net/attachment/201108/26/0_1314370751eD2e.gif" alt="" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 18px; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 18px; "&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 18px; "&gt;Custom Decoding&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 13px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;在有关图像的API中都是以图片自身的分辨率解码（除了Downsampling缩减像素采样，等会儿会介绍到它）。不管怎样，这已经能满足在手机上的图片显示了。如果下载一批320X320的图片，但只以32X32那么小显示，那么还以原分辨率解码就会浪费很对的内存资源。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 13px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;在 Windows Phone平台上提供给程序员们PictureDecoder的应用程序接口，能够自定义分辨率去解码图片：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 18px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Consolas; font-size: 13px; color: #333333; line-height: 14px; background-color: #ffffcc; "&gt;image.Source =&amp;nbsp;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #2b91af; "&gt;PictureDecoder&lt;/span&gt;.DecodeJpeg(jpgStream, 192, 256);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Note：在当前发布的API中有一个bug，图片的高度和宽度属性值被交换了。因此，得把宽度的值设定到高度上，高度同理。这个问题以后MS肯定会修复，我也是无意间发现的这个问题。&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;为了查看内存增长情况，在示例程序的&amp;#8220;Custom Decoding&amp;#8221;页面中。在两种的分辨率中监视内存使用情况。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;img src="http://hi.csdn.net/attachment/201108/26/0_13143708736kZN.gif" alt="" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 18px; "&gt;Auto Downsampling&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;这是最后一个在处理WP7平台图片我们需要知道的事。background是一个特殊的元素，被限定到2048X2048。超过此大小的会被剪裁，这就意味着使用一个&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;长宽&lt;/span&gt;超过2048像素的的图片，该图片不会完全显示。为了避免这种情况的发生，WP7平台会自动的降低像素是图片去适应2048X2048。这一点不同于桌面Silverlight应用，应为silverlight不存在上述限制。&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;在示例程序中我使用了一张3000X2102分辨率的图片，最终图片被像素缩减为1500X1051。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;img src="http://hi.csdn.net/attachment/201108/26/0_1314370996njm3.gif" alt="" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;事实上，关于图片还有很多值得细细研究的，这里只是起一个抛砖引玉的作用，希望能和大家一起探讨这个问题。谢谢你能阅读这篇文章，希望能对你有所帮助。&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;能力有限，如果有错误的地方请指正。&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/moses/aggbug/2277043.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/moses/archive/2011/12/05/2277043.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/moses/archive/2011/11/09/2243733.html</id><title type="text">windows phone 应用程序退出代码</title><summary type="text">引用相应的DLL即可newMicrosoft.Xna.Framework.Game().Exit(); 当时看到这个本以为只有xna编程有效，其实对于SL也同样有效</summary><published>2011-11-09T14:44:00Z</published><updated>2011-11-09T14:44:00Z</updated><author><name>脚印</name><uri>http://www.cnblogs.com/moses/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moses/archive/2011/11/09/2243733.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moses/archive/2011/11/09/2243733.html"/><content type="html">&lt;p&gt;引用相应的DLL即可&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; color: blue; "&gt;new&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;&amp;nbsp;Microsoft.Xna.Framework.&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; color: #2b91af; "&gt;Game&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;().Exit(); &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;当时看到这个本以为只有xna编程有效，其实对于SL也同样有效&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/moses/aggbug/2243733.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/moses/archive/2011/11/09/2243733.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/moses/archive/2011/11/09/2243731.html</id><title type="text">Windows Phone 页面切换</title><summary type="text">最近做一个webbrowser的项目，经常需要在含有webbrowser控件的页面中弹出一些其他页面，不如弹出一个含有google 地图的层.因为这个webborowser里面的内容我们无法保存（dom结构能保存，bom结构就没办法了），所以又不能导航到含有google地图的页面中，以前我总是把需要弹出的这个层做成一个Usercontrol然后添加到root控件中，把原本的内容用一个panle装起来，并且将Visibility设置成System.Windows.Visibility.Collapsed。今天突发奇想，每个应用程序都有唯一的一个PhoneApplicationFrame页面只不过</summary><published>2011-11-09T14:40:00Z</published><updated>2011-11-09T14:40:00Z</updated><author><name>脚印</name><uri>http://www.cnblogs.com/moses/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moses/archive/2011/11/09/2243731.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moses/archive/2011/11/09/2243731.html"/><content type="html">&lt;p&gt;最近做一个webbrowser的项目，经常需要在含有webbrowser控件的页面中弹出一些其他页面，不如弹出一个含有google 地图的层.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;因为这个webborowser里面的内容我们无法保存（dom结构能保存，bom结构就没办法了），所以又不能导航到含有google地图的页面中，&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;以前我总是把需要弹出的这个层做成一个Usercontrol然后添加到root控件中，把原本的内容用一个panle装起来，并且将&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;Visibility设置成&lt;/span&gt;&lt;span style="font-family: NSimSun; white-space: pre; background-color: #ffffff; "&gt;&amp;nbsp;System.Windows.&lt;/span&gt;&lt;span style="font-family: NSimSun; white-space: pre; background-color: #ffffff; color: #2b91af; "&gt;Visibility&lt;/span&gt;&lt;span style="font-family: NSimSun; white-space: pre; background-color: #ffffff; "&gt;.Collapsed。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;今天突发奇想，每个应用程序都有唯一的一个&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; color: #2b91af; "&gt;PhoneApplicationFrame&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;页面只不过是他的content，我们是不是只需要更换&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; color: #2b91af; "&gt;PhoneApplicationFrame&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt; &lt;/span&gt;&amp;nbsp;的content属性就好了呢，于是做了以下测试：&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;&amp;nbsp;&lt;/span&gt;Global.Page&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;&amp;nbsp;=&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; color: blue; "&gt;this&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;; //用一个全局的变量保存需要返回的页面&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;&amp;nbsp;((&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; color: #2b91af; "&gt;PhoneApplicationFrame&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;)&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; color: #2b91af; "&gt;Application&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;.Current.RootVisual).Content&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; color: blue; "&gt;new &lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; color: #2b91af; "&gt;Page1&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;();//新页面&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;在Page1中 调用下面的这行代码就能回来&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;&amp;nbsp;((&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; color: #2b91af; "&gt;PhoneApplicationFrame&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;)&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; color: #2b91af; "&gt;Application&lt;/span&gt;&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;.Current.RootVisual).Content&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&amp;nbsp;Global.Page&lt;span style="font-family: NSimSun; font-size: 13px; line-height: 19px; white-space: pre; background-color: #ffffff; "&gt;; &lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;不知道大家是否还有更好的方法？ 请赐教。&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/moses/aggbug/2243731.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/moses/archive/2011/11/09/2243731.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/moses/archive/2011/10/31/2229792.html</id><title type="text">Windows Phone的网络连接策略（转）</title><summary type="text">原文链接：http://www.cnblogs.com/procoder/archive/2011/10/28/WIndows-Phone-Idle-Mode.htmlWindows Phone的网络连接策略前言在微薄中“有人”（我记得是谁，^_^）问起Windows Phone在锁屏下是否继续链接WiFi，引起了很多WP微博控在讨论，其实我本来不关心这个问题的，因为这个是不可控的，但是讨论的人太多了，因此我想聊聊我对Windows Phone的网络连接策略的想法。问题定义这个问题可以简单的重新定义为Windows Phone在空闲（idle）情况下，是否进行网络链接。到底使用哪种链接方式，是</summary><published>2011-10-31T01:41:00Z</published><updated>2011-10-31T01:41:00Z</updated><author><name>脚印</name><uri>http://www.cnblogs.com/moses/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moses/archive/2011/10/31/2229792.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moses/archive/2011/10/31/2229792.html"/><content type="html">&lt;div&gt;&lt;p&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;原文链接：&lt;a href="http://www.cnblogs.com/procoder/archive/2011/10/28/WIndows-Phone-Idle-Mode.html"&gt;http://www.cnblogs.com/procoder/archive/2011/10/28/WIndows-Phone-Idle-Mode.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a id="ctl02_TitleUrl" href="http://www.cnblogs.com/procoder/archive/2011/10/28/WIndows-Phone-Idle-Mode.html" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #399ab2; "&gt;Windows Phone的网络连接策略&lt;/a&gt;&lt;/p&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; color: #333333; font-family: verdana, ����, Arial; font-size: 13px; line-height: 24px; background-color: #ffffff; "&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: #333333; font-family: verdana, ����, Arial; background-color: #ffffff; "&gt;&lt;div id="cnblogs_post_body" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;p&gt;&lt;strong&gt;前言&lt;/strong&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;在微薄中&amp;#8220;有人&amp;#8221;（我记得是谁，^_^）问起Windows Phone在锁屏下是否继续链接WiFi，引起了很多WP微博控在讨论，其实我本来不关心这个问题的，因为这个是不可控的，但是讨论的人太多了，因此我想聊聊我对Windows Phone的网络连接策略的想法。&lt;/p&gt;&lt;p&gt;&lt;strong&gt;问题定义&lt;/strong&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;这个问题可以简单的重新定义为&lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; "&gt;Windows Phone在空闲（idle）情况下，是否进行网络链接。&lt;/strong&gt;到底使用哪种链接方式，是由Windows Phone的策略所决定的，这种策略基本上是考虑电池使用量和链接成本（$$$$$$$）等因素。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;多任务之梦&lt;/strong&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;如果有人觉得Windows Phone是单任务，在锁屏的时候会把所有app杀死了，那么他/她可能给水军给忽悠了，Windows Phone从第一天开始就是一个多任务操作系统，所以在锁屏情况下继续保持网络链接，继续完成后台任务是&lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; "&gt;可能的&lt;/strong&gt;。但微软一般不这样做，而且限制app开发者这样做，这些都是为了提供更好的用户体验。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;到底链接or断开？&lt;/strong&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;我的答案是yes and no，呵呵。在Windows Phone锁屏的情况下，到底继续保持链接还是断开链接，不能简单的回答，因为这个操作是根据策略来决定的。这些策略的目的都是为了提供更好的用户体验，这种策略简单可以参考下面的公式：&lt;/p&gt;&lt;blockquote style="margin-right: 0px; "&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;任务类型 + 电源状态 = 是否断开链接&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;根据之前重新定义，公式可以替换为：&lt;/p&gt;&lt;blockquote style="margin-right: 0px; "&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;任务类型 + 电源状态 + 可用网络链接媒体（WiFi/3G） = 是否进行网络链接&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;也就是说在不同的情况下，Windows Phone会相应的保持或者断开链接。这也是现代智能手机系统（WP， Android，iOS）最最基本的功能了。现代的智能手机系统一般都由&lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; "&gt;系统&lt;/strong&gt;来进行电源管理和网络连接管理。请注意我把&amp;#8220;系统&amp;#8221;两个字重点加粗了，因为非现代智能手机系统可能是把主动权交给了应用（app）来管理的（当然最终操作系统保留了最高决定权），例如以前的Windows Mobile是由应用来决定打开和关闭网络连接，打开3G还是WiFi，试问一个app开发者怎么要肩负着OS开发者的责任，需要考虑的情况也太多了。再例如Symbian的app在启动是会提示&amp;#8220;是否打开网络连接，到底打开3G还是WiFi&amp;#8221;，把链接责任推给了用户。这些老系统都极大破坏了用户体验。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;-------------------------貌似合理的跑题-------------------------------------------------------------------------------------&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;下面举一个Agile的例子，讨论一下用户到底要什么：&lt;/p&gt;&lt;blockquote style="margin-right: 0px; "&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;最为一个非技术用户，如果我想看微薄，那么打开微薄app就可以看。&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;这里的&lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; "&gt;非技术用户&lt;/strong&gt;根本就不关心手机的链接状态，关心的是&lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; "&gt;是否能查看和发微薄&lt;/strong&gt;。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;这里用户故事有以下的附加条款（acceptance criteria）：&lt;/p&gt;&lt;blockquote style="margin-right: 0px; "&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;1.如果能接触（这里没有使用链接，其实也是这个意思，connect）到微薄后台服务，直接打开app，显示默认页，例如&amp;#8220;@我的&amp;#8221;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;2.如果不能接触到微薄后台服务，而且没有缓存，提示用户没网络链接，请稍候再试。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;3.如果不能接触到微薄后台服务，而且有缓存，提示用户只能看缓存。&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;这个用户故事有个特点是，不由用户来决定，而是预定动作，&lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; "&gt;强迫&lt;/strong&gt;用户选择或接受，但是假装很尊重用户的样子。&lt;em style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;回到Jobs那句话，给用户最好的选择就是不给他选择。&lt;/em&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;-------------------------跑回到主题上------------------------------------------------------------------------------------&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;em style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;/em&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;由此可以知道关心这种问题的都不是&amp;#8220;&lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; "&gt;非技术用户&lt;/strong&gt;&amp;#8221;，对，我就是说你，0_^。其实Windows Phone已经把管理网络链接的主动权收起来，统一由系统进行管理，作为app开发者不一定要把这个问题查根问底也能写出很优秀的程序，但是如果真的想知道，我下面尽力探讨一下。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;什么时候Windows Phone在空闲状态会进行网络链接&lt;/strong&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;上面讲到网络链接的策略，因此我们开发的app符合这些策略，就会在空闲状态下也进行网络链接。我尽力列出所有可能出现的情况：&lt;/p&gt;&lt;p&gt;&lt;strong&gt;ApplicationIdleDetectionMode设置为disabled&lt;/strong&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Windows Phone的app可以通过修改&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.shell.phoneapplicationservice(v=vs.92).aspx" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #000000; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #333333; "&gt;PhoneApplicationService&lt;/a&gt;的&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.shell.phoneapplicationservice.applicationidledetectionmode(v=vs.92).aspx" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #000000; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #333333; "&gt;ApplicationIdleDetectionMode&lt;/a&gt;强制app在锁屏的时候不会被墓碑化（注意Mango发布后这个功能有时候是鸡肋了），这种程序一般是导航程序，音乐播放程序（mango后有替代方案，会在后面讲述），也就是手机锁屏，app还是继续运行，程序可以继续做一些网络request，这样WiFi链接就会保持（如果有WiFi链接的话）。但是根据微软的文档，在程序锁屏情况下&lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; "&gt;应该&lt;/strong&gt;停止/关闭很多操作，例如Timer，动画（animations ），重力加速计（accelerometer ），地理定位服务（Location Service ），FM收音机，同时断开网络链接等等。但是注意我这里使用了应该，没有说必须，因此app还是可以继续做网络请求的。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Background Audio&lt;/strong&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;使用&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.backgroundaudio.audioplayeragent(v=vs.92).aspx" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #000000; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #333333; "&gt;AudioPlayerAgent&lt;/a&gt;（后台音频播放）的app在锁屏的时候也可以继续播放，如果音频的url指定为网络的url，那么为了能正常播放，Windows Phone继续保持WiFi链接如果WiFi可用的话。&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; "&gt;&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; "&gt;Background File Transfers&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;如果app使用了&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.backgroundtransfer.backgroundtransferservice(v=vs.92).aspx" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #000000; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #333333; "&gt;BackgroundTransferService&lt;/a&gt;（后台传输服务），那么程序会在特定情况下保持链接，继续下载，如果文件小于20M，Windows Phone会继续使用3G下载，如果文件100M以下，那么Windows Phone会继续使用WiFi下载文件，如果文件大于100M，必须外接电源和联通WiFi的情况下Windows Phone才会启动下载。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Background Agents&lt;/strong&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;如果app使用了&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.scheduler.scheduledtask(v=vs.92).aspx" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #000000; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #333333; "&gt;ScheduledTask&lt;/a&gt;（定时任务），那么程序在每隔一段时间会启动执行一下，可能有两种不同的任务如下&lt;/p&gt;&lt;blockquote style="margin-right: 0px; "&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.scheduler.periodictask(v=vs.92).aspx" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #000000; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #333333; "&gt;PeriodicTask&lt;/a&gt;&amp;nbsp;（周期性任务）会每隔30分钟执行一次，每次只能执行25秒。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.scheduler.resourceintensivetask(v=vs.92).aspx" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #000000; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #333333; "&gt;ResourceIntensiveTask&lt;/a&gt;&amp;nbsp;（耗资源的任务）每隔10分钟执行一次，但是需要连接上外接电源。&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;其中两种任务在执行过程都可以链接网络，请求网络资源的。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; "&gt;Schedule Tile&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;如果app使用了&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.shell.shelltileschedule(v=VS.92).aspx" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #000000; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #333333; "&gt;ShellTileSchedule&lt;/a&gt;（信息块更新任务），那么程序每隔一段时间可以更新Live Tile，如果Tile的图片在网络上，会启动网络链接。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Tile Notification&lt;/strong&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;官方没有说明推送任务的实现细节，从系统角度看一般实现方法可能如下：&lt;/p&gt;&lt;blockquote style="margin-right: 0px; "&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;1.通过sms触发手机去请求。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;2.手机定时pull（拉）信息。&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;不管哪种方法，手机最终都是需要通过网络链接来取得推送服务的信息，因此也可能使用到网络链接。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;总结&lt;/strong&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;不管哪种方法，微软试图做的是提供良好的用户体验（包括电源消耗，反映速度，通信资费等等），因此作为app开发者，我们要做的是在现有的限制条件下，提供更好的用户体验，没必要为了数据长链接而破坏用户体验。&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;有任何问题，请留言，或者微博我&amp;nbsp;&lt;a href="http://weibo.com/yongjianlin" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #000000; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #333333; "&gt;@林永坚jake&lt;/a&gt;&amp;nbsp;谢谢！&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/moses/aggbug/2229792.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/moses/archive/2011/10/31/2229792.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/moses/archive/2011/04/07/2008198.html</id><title type="text">XML Schema</title><summary type="text">Restrictions for Datatypes对数据类型的约束Constraint约束Description说明enumerationDefines a list of acceptable values定义了一系列的有效值fractionDigitsSpecifies the maximum number of decimal places allowed. Must be equal to or greater than zero指定了允许的小数位数的最多位数。必须大于等于0lengthSpecifies the exact number of characters or list </summary><published>2011-04-07T09:52:00Z</published><updated>2011-04-07T09:52:00Z</updated><author><name>脚印</name><uri>http://www.cnblogs.com/moses/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moses/archive/2011/04/07/2008198.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moses/archive/2011/04/07/2008198.html"/><content type="html">&lt;p&gt;&lt;strong&gt;Restrictions for Datatypes&lt;br /&gt;对数据类型的约束&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;table  border="1" cellspacing="0" width="100%"&gt;&#xD;
&lt;tbody&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;th valign="top" width="15%" align="left"&gt;Constraint&lt;br /&gt;约束&lt;/th&gt;&#xD;
&lt;th valign="top" width="85%" align="left"&gt;Description&lt;br /&gt;说明&lt;/th&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;enumeration&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;Defines a list of acceptable values&lt;br /&gt;定义了一系列的有效值&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;fractionDigits&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;Specifies the maximum number of decimal places allowed. Must be equal to or greater than zero&lt;br /&gt;指定了允许的小数位数的最多位数。必须大于等于0&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;length&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;Specifies the exact number of characters or list items allowed. Must be equal to or greater than zero&lt;br /&gt;指定了允许的字符或列表项的个数。必须大于等于0&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;maxExclusive&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;Specifies the upper bounds for numeric values (the value must be less than this value)&lt;br /&gt;指定了数值的上限（数值要比这个值小）&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;maxInclusive&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;Specifies the upper bounds for numeric values (the value must be less than or equal to this value)&lt;br /&gt;指定了数值上限（数值必须小于等于这个值）&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;maxLength&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;Specifies the maximum number of characters or list items allowed. Must be equal to or greater than zero&lt;br /&gt;指定了所允许的字符或列表项的最多个数。必须大于等于0&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;minExclusive&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;Specifies the lower bounds for numeric values (the value must be greater than this value)&lt;br /&gt;指定了数值的下限 （数值要比这个值小） &lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;minInclusive&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;Specifies the lower bounds for numeric values (the value must be greater than or equal to this value)&lt;br /&gt;指定了数值的下限（数值必须大于等于这个值）&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;minLength&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;Specifies the minimum number of characters or list items allowed. Must be equal to or greater than zero&lt;br /&gt;指定了所允许的字符或列表的最少个数。必须等于大于0个&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;pattern&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;Defines the exact sequence of characters that are acceptable &lt;br /&gt;定义了符合要求的字符的确切排列顺序&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;totalDigits&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;Specifies the exact number of digits allowed. Must be greater than zero&lt;br /&gt;指定了所允许的字符的确切个数。必须大于0&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;whiteSpace&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;Specifies how white space (line feeds, tabs, spaces, and carriage returns) is handled&lt;br /&gt;指定了空白该怎样被处理（换行符，制表符，空格符和回车符）&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&#xD;
&lt;h2 &gt;String Data Types&lt;br /&gt;字符串数据类型&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p &gt;Note that all of the data types below derive from the String data type (except for string itself)!&lt;br /&gt;要注意下面所有的数据类型都是从字符串数据类型里派生出来的（除了字符串本身）&lt;/p&gt;&#xD;
&lt;div &gt;&#xD;
&lt;table  border="1" cellspacing="0" width="100%"&gt;&#xD;
&lt;tbody&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;th valign="top" width="23%" align="left"&gt;Name&lt;br /&gt;名称&lt;/th&gt;&#xD;
&lt;th valign="top" width="77%" align="left"&gt;Description&lt;br /&gt;解释&lt;/th&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;ENTITIES&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;ENTITY&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;ID&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;A string that represents the ID attribute in XML (only used with schema attributes)&lt;br /&gt;象征XML的ID属性的字符串（只用在schema属性里）&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;IDREF&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;A string that represents the IDREF attribute in XML (only used with schema attributes)&lt;br /&gt;象征XML里的IDREF属性的字符串（只能和schema属性一起使用）&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;IDREFS&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;language&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;A string that contains a valid language id&lt;br /&gt;含有正确的语言ID的字符串&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;Name&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;A string that contains a valid XML name&lt;br /&gt;含有一个有效的XML名称的字符串&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;NCName&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;NMTOKEN&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;A string that represents the NMTOKEN attribute in XML (only used with schema attributes)&lt;br /&gt;象征XML里的NMTOKEN属性的字符串（只能和schema属性一起使用）&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;NMTOKENS&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;normalizedString&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;A string that does not contain line feeds, carriage returns, or tabs&lt;br /&gt;不含有换行符，回车符或制表符的字符串&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;QName&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;string&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;A string&lt;br /&gt;一个字符串&lt;/td&gt;&lt;/tr&gt;&#xD;
&lt;tr&gt;&#xD;
&lt;td valign="top"&gt;token&lt;/td&gt;&#xD;
&lt;td valign="top"&gt;A string that does not contain line feeds, carriage returns, tabs, leading or trailing spaces, or multiple spaces&lt;br /&gt;不含有换行符，回车符，制表符，头尾空格，或重复空格的字符串&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&#xD;
&lt;p&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/moses/aggbug/2008198.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/moses/archive/2011/04/07/2008198.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/moses/archive/2011/02/23/1961916.html</id><title type="text">Init,Load,PreRender事件执行顺序</title><summary type="text">转自：http://www.cnblogs.com/csjackie/archive/2008/11/08/1329599.htmlInit,Load,PreRender事件执行顺序:Init,Load,PreRender事件执行顺序:Init,Load,PreRender事件执行顺序:1）控件的Init事件2）控件所在页面的Init事件3）控件所在页面的Load事件4）控件的Load事件5）控件所在页面的PreRender事件6）控件的PreRender事件规律：1）Init事件从最里面的控件（包括用户控件及普通控件）向最外面的控件（页面）引发，Load及PreRender等其他事件从最外面</summary><published>2011-02-23T01:07:00Z</published><updated>2011-02-23T01:07:00Z</updated><author><name>脚印</name><uri>http://www.cnblogs.com/moses/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moses/archive/2011/02/23/1961916.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moses/archive/2011/02/23/1961916.html"/><content type="html">&lt;span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; line-height: 19px; "&gt;&lt;p&gt;&lt;strong&gt;&lt;font  color="#4B4B4B" size="2"&gt;&lt;span  style="font-size: 13px; color: #000000; font-weight: normal; "&gt;转自：&lt;a href="http://www.cnblogs.com/csjackie/archive/2008/11/08/1329599.html" style="color: #336699; text-decoration: none; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;http://www.cnblogs.com/csjackie/archive/2008/11/08/1329599.html&lt;/a&gt;&lt;/span&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="color: #4b4b4b; font-size: 13px; "&gt;&lt;a id="ctl02_TitleUrl" href="http://www.cnblogs.com/csjackie/archive/2008/11/08/1329599.html" style="text-decoration: none; color: #1a8bc8; "&gt;Init,Load,PreRender事件执行顺序:&lt;/a&gt;&lt;/p&gt;&lt;div id="cnblogs_post_body" style="color: #4b4b4b; font-size: 13px; "&gt;&lt;p&gt;&lt;strong&gt;Init,Load,PreRender事件执行顺序:&lt;/strong&gt;&lt;/p&gt;&lt;div id="msgcns!1BCE7FCDDAB9A6E7!1330"&gt;&lt;div&gt;&lt;strong&gt;Init,Load,PreRender事件执行顺序:&lt;br /&gt;&lt;/strong&gt;1）控件的Init事件&lt;br /&gt;2）控件所在页面的Init事件&lt;br /&gt;3）控件所在页面的Load事件&lt;br /&gt;4）控件的Load事件&lt;br /&gt;5）控件所在页面的PreRender事件&lt;br /&gt;6）控件的PreRender事件&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;规律：&lt;/strong&gt;&lt;br /&gt;1）Init事件从最里面的控件（包括用户控件及普通控件）向最外面的控件（页面）引发，Load及PreRender等其他事件从最外面的控件向最里面的控件引发；&lt;br /&gt;2）控件之间相同事件的执行顺序依控件在页面的位置按从左到右，从上到下的先后顺序执行。&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;注意：&lt;/strong&gt;&lt;br /&gt;1）切记用户控件也被视为页面中的一个控件；&lt;br /&gt;2）把用户控件作为单独的一个特殊页面来看，它本身及其所包含的控件同样遵守相同的规律；&lt;br /&gt;3）有时在客户端程序（如javascript）中会用到客户端body对像的onload事件，注意这个客户端事件是最后执行，即在服务器端所有事件执行完后才执行。&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;img src="http://www.cnblogs.com/moses/aggbug/1961916.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/moses/archive/2011/02/23/1961916.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/moses/archive/2011/01/28/1947279.html</id><title type="text">javascript 继承</title><summary type="text">javascript中继承不像c#中 class B：Ajavascript 中继承通过设置 function super{　　Id:"myid",　　myMethod:funciton(){　　 alert("call myMethod!");　　}}function sub{　　}//sub继承supersub.prototype =new super();var A= new sub();此时 A就包含属性ID 和方法myMethod（）</summary><published>2011-01-28T14:44:00Z</published><updated>2011-01-28T14:44:00Z</updated><author><name>脚印</name><uri>http://www.cnblogs.com/moses/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moses/archive/2011/01/28/1947279.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moses/archive/2011/01/28/1947279.html"/><content type="html">&lt;p&gt;javascript中继承不像c#中 class B：A&lt;/p&gt;&lt;p&gt;javascript 中继承通过设置 &lt;/p&gt;&lt;p&gt;function super{&lt;/p&gt;&lt;p&gt;Id:"myid",&lt;/p&gt;&lt;p&gt;myMethod:funciton(){&lt;/p&gt;&lt;p&gt;alert("call myMethod!");&amp;nbsp;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&lt;/p&gt;&lt;p&gt;function sub{&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;}&amp;nbsp;&lt;/p&gt;&lt;p&gt;//sub继承super&lt;/p&gt;&lt;p&gt;&lt;span style="color: red; "&gt;sub.prototype =new super();&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;var A= new sub();&lt;/p&gt;&lt;p&gt;此时 A就包含属性ID 和方法&amp;nbsp;myMethod（）&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/moses/aggbug/1947279.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/moses/archive/2011/01/28/1947279.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/moses/archive/2010/09/10/1823043.html</id><title type="text">深入浅出理解索引结构（转）</title><summary type="text">深入浅出理解索引结构原文：http://www.cnblogs.com/fanrsh/archive/2006/06/27/436618.html主题:转：（一）作者: freedk (书生)正文内容:（一）深入浅出理解索引结构实际上，您可以把索引理解为一种特殊的目录。微软的SQL SERVER提供了两种索引：聚集索引（clustered index，也称聚类索引、簇集索引）和非聚集索引（nonc...</summary><published>2010-09-10T02:49:00Z</published><updated>2010-09-10T02:49:00Z</updated><author><name>脚印</name><uri>http://www.cnblogs.com/moses/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moses/archive/2010/09/10/1823043.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moses/archive/2010/09/10/1823043.html"/><content type="html">&lt;p&gt;&lt;a id="ctl03_TitleUrl" href="http://www.cnblogs.com/fanrsh/archive/2006/06/27/436618.html"&gt;&lt;font  color="#000000"&gt;深入浅出理解索引结构&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;原文：&lt;a href="http://www.cnblogs.com/fanrsh/archive/2006/06/27/436618.html"&gt;http://www.cnblogs.com/fanrsh/archive/2006/06/27/436618.html&lt;/a&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;主&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;span style="line-height: 1.5; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;题&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;:&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;转：（一）&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;作&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;span style="line-height: 1.5; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;者&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;: freedk (&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;书生&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;正文内容&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（一）深入浅出理解索引结构&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;实际上，您可以把索引理解为一种特殊的目录。微软的&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL SERVER&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;提供了两种索引：聚集索引（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;clustered index&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，也称聚类索引、簇集索引）和非聚集索引（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;nonclustered index&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，也称非聚类索引、非簇集索引）。下面，我们举例来说明一下聚集索引和非聚集索引的区别：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;其实，我们的汉语字典的正文本身就是一个聚集索引。比如，我们要查&amp;#8220;安&amp;#8221;字，就会很自然地翻开字典的前几页，因为&amp;#8220;安&amp;#8221;的拼音是&amp;#8220;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;an&amp;#8221;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，而按照拼音排序汉字的字典是以英文字母&amp;#8220;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;a&amp;#8221;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;开头并以&amp;#8220;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;z&amp;#8221;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;结尾的，那么&amp;#8220;安&amp;#8221;字就自然地排在字典的前部。如果您翻完了所有以&amp;#8220;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;a&amp;#8221;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;开头的部分仍然找不到这个字，那么就说明您的字典中没有这个字；同样的，如果查&amp;#8220;张&amp;#8221;字，那您也会将您的字典翻到最后部分，因为&amp;#8220;张&amp;#8221;的拼音是&amp;#8220;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;zhang&amp;#8221;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;。也就是说，字典的正文部分本身就是一个目录，您不需要再去查其他目录来找到您需要找的内容。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;我们把这种正文内容本身就是一种按照一定规则排列的目录称为&amp;#8220;聚集索引&amp;#8221;。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;如果您认识某个字，您可以快速地从自动中查到这个字。但您也可能会遇到您不认识的字，不知道它的发音，这时候，您就不能按照刚才的方法找到您要查的字，而需要去根据&amp;#8220;偏旁部首&amp;#8221;查到您要找的字，然后根据这个字后的页码直接翻到某页来找到您要找的字。但您结合&amp;#8220;部首目录&amp;#8221;和&amp;#8220;检字表&amp;#8221;而查到的字的排序并不是真正的正文的排序方法，比如您查&amp;#8220;张&amp;#8221;字，我们可以看到在查部首之后的检字表中&amp;#8220;张&amp;#8221;的页码是&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;672&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;页，检字表中&amp;#8220;张&amp;#8221;的上面是&amp;#8220;驰&amp;#8221;字，但页码却是&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;63&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;页，&amp;#8220;张&amp;#8221;的下面是&amp;#8220;弩&amp;#8221;字，页面是&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;390&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;页。很显然，这些字并不是真正的分别位于&amp;#8220;张&amp;#8221;字的上下方，现在您看到的连续的&amp;#8220;驰、张、弩&amp;#8221;三字实际上就是他们在非聚集索引中的排序，是字典正文中的字在非聚集索引中的映射。我们可以通过这种方式来找到您所需要的字，但它需要两个过程，先找到目录中的结果，然后再翻到您所需要的页码。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;我们把这种目录纯粹是目录，正文纯粹是正文的排序方式称为&amp;#8220;非聚集索引&amp;#8221;。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;通过以上例子，我们可以理解到什么是&amp;#8220;聚集索引&amp;#8221;和&amp;#8220;非聚集索引&amp;#8221;。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;进一步引申一下，我们可以很容易的理解：每个表只能有一个聚集索引，因为目录只能按照一种方法进行排序。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（二）何时使用聚集索引或非聚集索引&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;下面的表总结了何时使用聚集索引或非聚集索引（很重要）。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;table cellpadding="0" border="1" style="margin-left: 15pt; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top" width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;strong&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;动作描述&lt;/span&gt;&lt;/strong&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td valign="top" width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;strong&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;使用聚集索引&lt;/span&gt;&lt;/strong&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td valign="top" width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;strong&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;使用非聚集索引&lt;/span&gt;&lt;/strong&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;列经常被分组排序&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;返回某范围内的数据&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;不应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;一个或极少不同值&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;不应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;不应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;小数目的不同值&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;不应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;大数目的不同值&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;不应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;频繁更新的列&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;不应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;外键列&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;主键列&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;应&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;font face="新細明體"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; color: #333333; "&gt;频繁修改索引列&lt;/span&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;font face="新細明體"&gt;不应&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="189" style="border-right-color: #c0c0c0; border-right-width: initial; border-right-style: initial; padding-right: 3.75pt; border-top-color: #c0c0c0; border-top-width: initial; border-top-style: initial; padding-left: 3.75pt; padding-bottom: 3.75pt; border-left-color: #c0c0c0; border-left-width: initial; border-left-style: initial; width: 5cm; padding-top: 3.75pt; border-bottom-color: #c0c0c0; border-bottom-width: initial; border-bottom-style: initial; background-color: transparent; "&gt;&lt;p align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; text-align: center; "&gt;&lt;span style="line-height: 1.5; color: #333333; "&gt;&lt;font face="新細明體"&gt;应&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;事实上，我们可以通过前面聚集索引和非聚集索引的定义的例子来理解上表。如：返回某范围内的数据一项。比如您的某个表有一个时间列，恰好您把聚合索引建立在了该列，这时您查询&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2004&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;年&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;月&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;日至&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2004&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;年&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;10&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;月&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;日之间的全部数据时，这个速度就将是很快的，因为您的这本字典正文是按日期进行排序的，聚类索引只需要找到要检索的所有数据中的开头和结尾数据即可；而不像非聚集索引，必须先查到目录中查到每一项数据对应的页码，然后再根据页码查到具体内容。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（三）结合实际，谈索引使用的误区&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;理论的目的是应用。虽然我们刚才列出了何时应使用聚集索引或非聚集索引，但在实践中以上规则却很容易被忽视或不能根据实际情况进行综合分析。下面我们将根据在实践中遇到的实际问题来谈一下索引使用的误区，以便于大家掌握索引建立的方法。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、主键就是聚集索引&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;这种想法笔者认为是极端错误的，是对聚集索引的一种浪费。虽然&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL SERVER&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;默认是在主键上建立聚集索引的。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;通常，我们会在每个表中都建立一个&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;列，以区分每条数据，并且这个&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;列是自动增大的，步长一般为&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;。我们的这个办公自动化的实例中的列&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;Gid&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;就是如此。此时，如果我们将这个列设为主键，&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL SERVER&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;会将此列默认为聚集索引。这样做有好处，就是可以让您的数据在数据库中按照&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;进行物理排序，但笔者认为这样做意义不大。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;显而易见，聚集索引的优势是很明显的，而每个表中只能有一个聚集索引的规则，这使得聚集索引变得更加珍贵。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;从我们前面谈到的聚集索引的定义我们可以看出，使用聚集索引的最大好处就是能够根据查询要求，迅速缩小查询范围，避免全表扫描。在实际应用中，因为&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;号是自动生成的，我们并不知道每条记录的&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;号，所以我们很难在实践中用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;号来进行查询。这就使让&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;号这个主键作为聚集索引成为一种资源浪费。其次，让每个&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;号都不同的字段作为聚集索引也不符合&amp;#8220;大数目的不同值情况下不应建立聚合索引&amp;#8221;规则；当然，这种情况只是针对用户经常修改记录内容，特别是索引项的时候会负作用，但对于查询速度并没有影响。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;在办公自动化系统中，无论是系统首页显示的需要用户签收的文件、会议还是用户进行文件查询等任何情况下进行数据查询都离不开字段的是&amp;#8220;日期&amp;#8221;还有用户本身的&amp;#8220;用户名&amp;#8221;。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;通常，办公自动化的首页会显示每个用户尚未签收的文件或会议。虽然我们的&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;where&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;语句可以仅仅限制当前用户尚未签收的情况，但如果您的系统已建立了很长时间，并且数据量很大，那么，每次每个用户打开首页的时候都进行一次全表扫描，这样做意义是不大的，绝大多数的用户&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;个月前的文件都已经浏览过了，这样做只能徒增数据库的开销而已。事实上，我们完全可以让用户打开系统首页时，数据库仅仅查询这个用户近&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;个月来未阅览的文件，通过&amp;#8220;日期&amp;#8221;这个字段来限制表扫描，提高查询速度。如果您的办公自动化系统已经建立的&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;年，那么您的首页显示速度理论上将是原来速度&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;8&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;倍，甚至更快。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;在这里之所以提到&amp;#8220;理论上&amp;#8221;三字，是因为如果您的聚集索引还是盲目地建在&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;这个主键上时，您的查询速度是没有这么高的，即使您在&amp;#8220;日期&amp;#8221;这个字段上建立的索引（非聚合索引）。下面我们就来看一下在&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1000&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;万条数据量的情况下各种查询的速度表现（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;个月内的数据为&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;25&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;万条）：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;）仅在主键上建立聚集索引，并且不划分时间段：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;Select gid,fariqi,neibuyonghu,title from tgongwen&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;128470&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒（即：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;128&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;秒）&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;）在主键上建立聚集索引，在&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;fariq&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;上建立非聚集索引：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,title from Tgongwen where fariqi&amp;gt; dateadd(day,-90,getdate())&lt;span style="line-height: 1.5; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;53763&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;54&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;秒）&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;）将聚合索引建立在日期列（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;fariqi&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;）上：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,title from Tgongwen where fariqi&amp;gt; dateadd(day,-90,getdate())&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2423&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;秒）&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;虽然每条语句提取出来的都是&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;25&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;万条数据，各种情况的差异却是巨大的，特别是将聚集索引建立在日期列时的差异。事实上，如果您的数据库真的有&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1000&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;万容量的话，把主键建立在&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;列上，就像以上的第&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;种情况，在网页上的表现就是超时，根本就无法显示。这也是我摒弃&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;列作为聚集索引的一个最重要的因素。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;得出以上速度的方法是：在各个&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;语句前加：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;declare @d datetime set @d=getdate()&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;并在&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;语句后加：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select [&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;语句执行花费时间&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;)]=datediff(ms,@d,getdate())&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、只要建立索引就能显著提高查询速度&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;事实上，我们可以发现上面的例子中，第&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;条语句完全相同，且建立索引的字段也相同；不同的仅是前者在&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;fariqi&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;字段上建立的是非聚合索引，后者在此字段上建立的是聚合索引，但查询速度却有着天壤之别。所以，并非是在任何字段上简单地建立索引就能提高查询速度。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;从建表的语句中，我们可以看到这个有着&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1000&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;万数据的表中&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;fariqi&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;字段有&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;5003&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;个不同记录。在此字段上建立聚合索引是再合适不过了。在现实中，我们每天都会发几个文件，这几个文件的发文日期就相同，这完全符合建立聚集索引要求的：&amp;#8220;既不能绝大多数都相同，又不能只有极少数相同&amp;#8221;的规则。由此看来，我们建立&amp;#8220;适当&amp;#8221;的聚合索引对于我们提高查询速度是非常重要的。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、把所有需要提高查询速度的字段都加进聚集索引，以提高查询速度&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;上面已经谈到：在进行数据查询时都离不开字段的是&amp;#8220;日期&amp;#8221;还有用户本身的&amp;#8220;用户名&amp;#8221;。既然这两个字段都是如此的重要，我们可以把他们合并起来，建立一个复合索引（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;compound index&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;）。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;很多人认为只要把任何字段加进聚集索引，就能提高查询速度，也有人感到迷惑：如果把复合的聚集索引字段分开查询，那么查询速度会减慢吗？带着这个问题，我们来看一下以下的查询速度（结果集都是&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;25&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;万条数据）：（日期列&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;fariqi&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;首先排在复合聚集索引的起始列，用户名&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;neibuyonghu&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;排在后列）&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;）&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,title from Tgongwen where fariqi&amp;gt;'2004-5-5'&lt;span style="line-height: 1.5; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;查询速度：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2513&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;）&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,title from Tgongwen where fariqi&amp;gt;'2004-5-5' and neibuyonghu='&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;办公室&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;'&lt;span style="line-height: 1.5; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;查询速度：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2516&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;）&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,title from Tgongwen where neibuyonghu='&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;办公室&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;'&lt;span style="line-height: 1.5; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;查询速度：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;60280&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;从以上试验中，我们可以看到如果仅用聚集索引的起始列作为查询条件和同时用到复合聚集索引的全部列的查询速度是几乎一样的，甚至比用上全部的复合索引列还要略快（在查询结果集数目一样的情况下）；而如果仅用复合聚集索引的非起始列作为查询条件的话，这个索引是不起任何作用的。当然，语句&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的查询速度一样是因为查询的条目数一样，如果复合索引的所有列都用上，而且查询结果少的话，这样就会形成&amp;#8220;索引覆盖&amp;#8221;，因而性能可以达到最优。同时，请记住：无论您是否经常使用聚合索引的其他列，但其前导列一定要是使用最频繁的列。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（四）其他书上没有的索引使用经验总结&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、用聚合索引比用不是聚合索引的主键速度快&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;下面是实例语句：（都是提取&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;25&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;万条数据）&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where fariqi='2004-9-16'&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;使用时间：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3326&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where gid&amp;lt;=250000&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;使用时间：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;4470&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;这里，用聚合索引比用不是聚合索引的主键速度快了近&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1/4&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、用聚合索引比用一般的主键作&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;order by&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;时速度快，特别是在小数据量情况下&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen order by fariqi&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;12936&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen order by gid&lt;span style="line-height: 1.5; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;18843&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;这里，用聚合索引比用一般的主键作&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;order by&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;时，速度快了&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3/10&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;。事实上，如果数据量很小的话，用聚集索引作为排序列要比使用非聚集索引速度快得明显的多；而数据量如果很大的话，如&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;10&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;万以上，则二者的速度差别不明显。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、使用聚合索引内的时间段，搜索时间会按数据占整个数据表的百分比成比例减少，而无论聚合索引使用了多少个&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where fariqi&amp;gt;'2004-1-1'&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;6343&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒（提取&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;100&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;万条）&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where fariqi&amp;gt;'2004-6-6'&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3170&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒（提取&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;50&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;万条）&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where fariqi='2004-9-16'&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3326&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒（和上句的结果一模一样。如果采集的数量一样，那么用大于号和等于号是一样的）&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where fariqi&amp;gt;'2004-1-1' and fariqi&amp;lt;'2004-6-6'&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3280&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;4&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、日期列不会因为有分秒的输入而减慢查询速度&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;下面的例子中，共有&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;100&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;万条数据，&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2004&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;年&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;月&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;日以后的数据有&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;50&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;万条，但只有两个不同的日期，日期精确到日；之前有数据&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;50&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;万条，有&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;5000&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;个不同的日期，日期精确到秒。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where fariqi&amp;gt;'2004-1-1' order by fariqi&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;6390&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where fariqi&amp;lt;'2004-1-1' order by fariqi&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;6453&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（五）其他注意事项&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;&amp;#8220;水可载舟，亦可覆舟&amp;#8221;，索引也一样。索引有助于提高检索性能，但过多或不当的索引也会导致系统低效。因为用户在表中每加进一个索引，数据库就要做更多的工作。过多的索引甚至会导致索引碎片。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;所以说，我们要建立一个&amp;#8220;适当&amp;#8221;的索引体系，特别是对聚合索引的创建，更应精益求精，以使您的数据库能得到高性能的发挥。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;当然，在实践中，作为一个尽职的数据库管理员，您还要多测试一些方案，找出哪种方案效率最高、最为有效。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;二、改善&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;语句&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;很多人不知道&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;语句在&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL SERVER&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;中是如何执行的，他们担心自己所写的&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;语句会被&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL SERVER&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;误解。比如：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select * from table1 where name='zhangsan' and tID &amp;gt; 10000&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;和执行&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;: select * from table1 where tID &amp;gt; 10000 and name='zhangsan'&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;一些人不知道以上两条语句的执行效率是否一样，因为如果简单的从语句先后上看，这两个语句的确是不一样，如果&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;tID&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;是一个聚合索引，那么后一句仅仅从表的&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;10000&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;条以后的记录中查找就行了；而前一句则要先从全表中查找看有几个&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;name='zhangsan'&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的，而后再根据限制条件条件&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;tID&amp;gt;10000&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;来提出查询结果。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;事实上，这样的担心是不必要的。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL SERVER&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;中有一个&amp;#8220;查询分析优化器&amp;#8221;，它可以计算出&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;where&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;子句中的搜索条件并确定哪个索引能缩小表扫描的搜索空间，也就是说，它能实现自动优化。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;虽然查询优化器可以根据&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;where&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;子句自动的进行查询优化，但大家仍然有必要了解一下&amp;#8220;查询优化器&amp;#8221;的工作原理，如非这样，有时查询优化器就会不按照您的本意进行快速查询。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;在查询分析阶段，查询优化器查看查询的每个阶段并决定限制需要扫描的数据量是否有用。如果一个阶段可以被用作一个扫描参数（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;），那么就称之为可优化的，并且可以利用索引快速获得所需数据。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的定义：用于限制搜索的一个操作，因为它通常是指一个特定的匹配，一个值得范围内的匹配或者两个以上条件的&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;AND&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;连接。形式如下：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;列名&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;操作符&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;常数&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;或&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;变量&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;或&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;常数&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;或&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;变量&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;操作符列名&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;列名可以出现在操作符的一边，而常数或变量出现在操作符的另一边。如：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;Name=&amp;#8217;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;张三&amp;#8217;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;价格&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;gt;5000&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;5000&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;价格&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;Name=&amp;#8217;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;张三&amp;#8217;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;and&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;价格&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;gt;5000&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;如果一个表达式不能满足&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的形式，那它就无法限制搜索的范围了，也就是&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL SERVER&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;必须对每一行都判断它是否满足&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;WHERE&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;子句中的所有条件。所以一个索引对于不满足&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;形式的表达式来说是无用的。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;介绍完&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;后，我们来总结一下使用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;以及在实践中遇到的和某些资料上结论不同的经验：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;Like&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;语句是否属于&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;取决于所使用的通配符的类型&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;如：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;name like &amp;#8216;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;张&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;%&amp;#8217;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，这就属于&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;而：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;name like &amp;#8216;%&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;张&amp;#8217;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;,&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;就不属于&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;原因是通配符&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;%&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;在字符串的开通使得索引无法使用。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;or&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;会引起全表扫描&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;Name=&amp;#8217;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;张三&amp;#8217;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;and&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;价格&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;gt;5000&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;符号&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，而：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;Name=&amp;#8217;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;张三&amp;#8217;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;or&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;价格&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;gt;5000&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;则不符合&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;。使用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;or&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;会引起全表扫描。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、非操作符、函数引起的不满足&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;形式的语句&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;不满足&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;形式的语句最典型的情况就是包括非操作符的语句，如：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;NOT&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;!=&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;lt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;!&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;!&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;NOT EXISTS&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;NOT IN&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;NOT LIKE&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;等，另外还有函数。&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;下面就是几个不满足&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;形式的例子：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;ABS(&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;价格&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;)&amp;lt;5000&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;Name like&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;&amp;#8216;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;%&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;三&amp;#8217;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;有些表达式，如：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;WHERE&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;价格&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;*2&amp;gt;5000&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL SERVER&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;也会认为是&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SARG&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL SERVER&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;会将此式转化为：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;WHERE&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;价格&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;gt;2500/2&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;但我们不推荐这样使用，因为有时&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL SERVER&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;不能保证这种转化与原始表达式是完全等价的。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;4&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;IN&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的作用相当与&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;OR&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;语句：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;Select * from table1 where tid in (2,3)&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;和&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;Select * from table1 where tid=2 or tid=3&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;是一样的，都会引起全表扫描，如果&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;tid&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;上有索引，其索引也会失效。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;5&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、尽量少用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;NOT&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;6&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;exists&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;和&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;in&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的执行效率是一样的&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;很多资料上都显示说，&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;exists&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;要比&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;in&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的执行效率要高，同时应尽可能的用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;not exists&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;来代替&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;not in&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;。&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;但事实上，我试验了一下，发现二者无论是前面带不带&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;not&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，二者之间的执行效率都是一样的。因为涉及子查询，我们试验这次用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL SERVER&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;自带的&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;pubs&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;数据库。运行前我们可以把&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;SQL SERVER&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;statistics I/O&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;状态打开。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 54pt; text-indent: -36pt; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（1）&lt;span style="line-height: 1.5; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;font face="Times New Roman"&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;select title,price from titles where title_id in (select title_id from sales where qty&amp;gt;30)&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 54pt; text-indent: -36pt; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（2）&lt;span style="line-height: 1.5; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;该句的执行结果为：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;表&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;'sales'&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;。扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;18&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;56&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;表&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;'titles'&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;。扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;2&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;）&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select title,price from titles where exists (select * from sales where sales.title_id=titles.title_id and qty&amp;gt;30)&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;第二句的执行结果为：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;表&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;'sales'&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;。扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;18&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;56&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;表&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;'titles'&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;。扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;2&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;我们从此可以看到用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;exists&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;和用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;in&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的执行效率是一样的。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;7&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、用函数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;charindex()&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;和前面加通配符&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;%&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;LIKE&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;执行效率一样&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;前面，我们谈到，如果在&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;LIKE&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;前面加上通配符&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;%&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，那么将会引起全表扫描，所以其执行效率是低下的。但有的资料介绍说，用函数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;charindex()&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;来代替&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;LIKE&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;速度会有大的提升，经我试验，发现这种说明也是错误的：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,title,fariqi,reader from tgongwen where charindex('&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;刑侦支队&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;',reader)&amp;gt;0 and fariqi&amp;gt;'2004-5-5'&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;7&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;秒，另外：扫描计数&lt;/span&gt;&lt;font face="Times New Roman"&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;4&lt;/span&gt;&lt;/font&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;7155&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,title,fariqi,reader from tgongwen where reader like '%' + '&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;刑侦支队&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;' + '%' and fariqi&amp;gt;'2004-5-5'&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;7&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;秒，另外：扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;4&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;7155&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;8&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;union&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;并不绝对比&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;or&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的执行效率高&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;我们前面已经谈到了在&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;where&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;子句中使用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;or&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;会引起全表扫描，一般的，我所见过的资料都是推荐这里用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;union&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;来代替&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;or&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;。事实证明，这种说法对于大部分都是适用的。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where fariqi='2004-9-16' or gid&amp;gt;9990000&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;68&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;秒。扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;404008&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;283&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;392163&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where fariqi='2004-9-16'&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;union&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where gid&amp;gt;9990000&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;9&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;秒。扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;8&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;67489&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;216&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;7499&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;看来，用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;union&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;在通常情况下比用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;or&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的效率要高的多。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;但经过试验，笔者发现如果&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;or&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;两边的查询列是一样的话，那么用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;union&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;则反倒和用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;or&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的执行速度差很多，虽然这里&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;union&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;扫描的是索引，而&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;or&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;扫描的是全表。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where fariqi='2004-9-16' or fariqi='2004-2-5'&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;6423&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒。扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;2&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;14726&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;1&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;7176&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where fariqi='2004-9-16'&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;union&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select gid,fariqi,neibuyonghu,reader,title from Tgongwen where&lt;span style="line-height: 1.5; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;fariqi='2004-2-5'&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;11640&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒。扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;8&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;14806&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;108&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;1144&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;9&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、字段提取要按照&amp;#8220;需多少、提多少&amp;#8221;的原则，避免&amp;#8220;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select *&amp;#8221;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;我们来做一个试验：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select top 10000 gid,fariqi,reader,title from tgongwen order by gid desc&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;4673&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select top 10000 gid,fariqi,title from tgongwen order by gid desc&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1376&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select top 10000 gid,fariqi from tgongwen order by gid desc&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;80&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;由此看来，我们每少提取一个字段，数据的提取速度就会有相应的提升。提升的速度还要看您舍弃的字段的大小来判断。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;10&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;count(*)&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;不比&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;count(&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;字段&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;慢&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;某些资料上说：用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;*&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;会统计所有列，显然要比一个世界的列名效率低。这种说法其实是没有根据的。我们来看：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select count(*) from Tgongwen&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;1500&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;span style="line-height: 1.5; "&gt;&lt;font face="新細明體"&gt;select count(gid) from Tgongwen&amp;nbsp;&lt;span lang="ZH-CN" style="line-height: 1.5; "&gt;用时：&lt;/span&gt;1483&lt;span lang="ZH-CN" style="line-height: 1.5; "&gt;毫秒&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="新細明體"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select count(fariqi) from Tgongwen&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;3140&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;font face="Times New Roman"&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;select count(title) from Tgongwen&lt;span style="line-height: 1.5; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;span style="line-height: 1.5; "&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;52050&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;从以上可以看出，如果用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;count(*)&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;和用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;count(&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;主键&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的速度是相当的，而&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;count(*)&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;却比其他任何除主键以外的字段汇总速度要快，而且字段越长，汇总的速度就越慢。&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;我想，如果用&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;count(*)&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;SQL SERVER&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;可能会自动查找最小字段来汇总的。当然，如果您直接写&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;count(&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;主键&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;将会来的更直接些。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;11&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;、&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;order by&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;按聚集索引列排序效率最高&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;我们来看：（&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;gid&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;是主键，&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;fariqi&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;是聚合索引列）&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select top 10000 gid,fariqi,reader,title from tgongwen&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;196&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒。&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;289&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;1&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;1527&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select top 10000 gid,fariqi,reader,title from tgongwen order by gid asc&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;4720&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒。&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;41956&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;1287&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select top 10000 gid,fariqi,reader,title from tgongwen order by gid desc&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;4736&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒。&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;55350&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;10&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;775&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select top 10000 gid,fariqi,reader,title from tgongwen order by fariqi asc&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;173&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒。&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;290&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;select top 10000 gid,fariqi,reader,title from tgongwen order by fariqi desc&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span  style="font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;font face="Times New Roman"&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;用时：&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;156&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;毫秒。&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;扫描计数&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;1&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;，逻辑读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;289&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，物理读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次，预读&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;0&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-CN" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;次。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p  style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; text-indent: 0px; font-size: 13px; line-height: 19px; font-family: Verdana; "&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;从以上我们可以看出，不排序的速度以及逻辑读次数都是和&amp;#8220;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;order by&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;聚集索引列&amp;#8221;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;的速度是相当的，但这些都比&amp;#8220;&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;font face="Times New Roman"&gt;order by&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span lang="ZH-TW" style="line-height: 1.5; font-size: 9pt; font-family: 新細明體; "&gt;非聚集索引列&amp;#8221;的查询速度是快得多的。&lt;/span&gt;&lt;span style="line-height: 1.5; font-size: 9pt; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-family: Verdana; line-height: 19px; font-size: 13px; "&gt;&lt;/p&gt;&lt;p&gt;&lt;span  style="font-family: 新細明體; line-height: 18px; font-size: 12px; "&gt;同时，按照某个字段进行排序的时候，无论是正序还是倒序，速度是基本相当的。&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/moses/aggbug/1823043.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/moses/archive/2010/09/10/1823043.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/moses/archive/2010/09/10/1823009.html</id><title type="text">如何建立索引</title><summary type="text">为了给一个表建立索引，启动任务栏SQL  Sever程序组中的ISQL/w程序。进入查询窗口后，输入下面的语句：CREATE  INDEX  mycolumn_index  ON  mytable  (myclumn)这个语句建立了一个名为mycolumn_index的索引。你可以给一个索引起任何名字，但你应该在索引名中包含所索引的字段名，这对你将来弄清楚建立该索引的意图是有帮助的。注意在本书中你...</summary><published>2010-09-10T02:18:00Z</published><updated>2010-09-10T02:18:00Z</updated><author><name>脚印</name><uri>http://www.cnblogs.com/moses/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moses/archive/2010/09/10/1823009.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moses/archive/2010/09/10/1823009.html"/><content type="html">&lt;span  style="font-family: simsun; line-height: 23px; "&gt;为了给一个表建立索引，启动任务栏SQL &amp;nbsp; Sever程序组中的ISQL/w程序。进入查询窗口后，输入下面的语句：&amp;nbsp;&lt;br /&gt;&lt;br /&gt;CREATE &amp;nbsp; INDEX &amp;nbsp; mycolumn_index &amp;nbsp; ON &amp;nbsp; mytable &amp;nbsp; (myclumn)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;这个语句建立了一个名为mycolumn_index的索引。你可以给一个索引起任何名字，但你应该在索引名中包含所索引的字段名，这对你将来弄清楚建立该索引的意图是有帮助的。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;注意&amp;nbsp;&lt;br /&gt;&lt;br /&gt;在本书中你执行任何SQL语句，都会收到如下的信息：&amp;nbsp;&lt;br /&gt;&lt;br /&gt;This &amp;nbsp; command &amp;nbsp; did &amp;nbsp; not &amp;nbsp; return &amp;nbsp; data,and &amp;nbsp; it &amp;nbsp; did &amp;nbsp; not &amp;nbsp; return &amp;nbsp; any &amp;nbsp; rows&amp;nbsp;&lt;br /&gt;&lt;br /&gt;这说明该语句执行成功了。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;索引mycolumn_index对表mytable的mycolumn字段进行。这是个非聚簇索引，也是个非唯一索引。（这是一个索引的缺省属性）&amp;nbsp;&lt;br /&gt;&lt;br /&gt;如果你需要改变一个索引的类型，你必须删除原来的索引并重建 &amp;nbsp; 一个。建立了一个索引后，你可以用下面的SQL语句删除它：&amp;nbsp;&lt;br /&gt;&lt;br /&gt;DROP &amp;nbsp; INDEX &amp;nbsp; mytable.mycolumn_index&amp;nbsp;&lt;br /&gt;&lt;br /&gt;注意在DROP &amp;nbsp; INDEX &amp;nbsp; 语句中你要包含表的名字。在这个例子中，你删除的索引是mycolumn_index，它是表mytable的索引。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;要建立一个聚簇索引，可以使用关键字CLUSTERED。）记住一个表只能有一个聚簇索引。（这里有一个如何对一个表建立聚簇索引的例子：&amp;nbsp;&lt;br /&gt;&lt;br /&gt;CREATE &amp;nbsp; CLUSTERED &amp;nbsp; INDEX &amp;nbsp; mycolumn_clust_index &amp;nbsp; ON &amp;nbsp; mytable(mycolumn)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;如果表中有重复的记录，当你试图用这个语句建立索引时，会出现错误。但是有重复记录的表也可以建立索引；你只要使用关键字ALLOW_DUP_ROW把这一点告诉SQL &amp;nbsp; Sever即可：&amp;nbsp;&lt;br /&gt;&lt;br /&gt;CREATE &amp;nbsp; CLUSTERED &amp;nbsp; INDEX &amp;nbsp; mycolumn_cindex &amp;nbsp; ON &amp;nbsp; mytable(mycolumn)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;WITH &amp;nbsp; ALLOW_DUP_ROW&amp;nbsp;&lt;br /&gt;&lt;br /&gt;这个语句建立了一个允许重复记录的聚簇索引。你应该尽量避免在一个表中出现重复记录，但是，如果已经出现了，你可以使用这种方法。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;要对一个表建立唯一索引，可以使用关键字UNIQUE。对聚簇索引和非聚簇索引都可以使用这个关键字。这里有一个例子：&amp;nbsp;&lt;br /&gt;&lt;br /&gt;CREATE &amp;nbsp; UNIQUE &amp;nbsp; COUSTERED &amp;nbsp; INDEX &amp;nbsp; myclumn_cindex &amp;nbsp; ON &amp;nbsp; mytable(mycolumn)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;这是你将经常使用的索引建立语句。无论何时，只要可以，你应该尽量对一个对一个表建立唯一聚簇索引来增强查询操作。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;最后，要建立一个对多个字段的索引&amp;#9472;&amp;#9472;复合索引&amp;#9472;&amp;#9472;在索引建立语句中同时包含多个字段名。下面的例子对firstname和lastname两个字段建立索引：&amp;nbsp;&lt;br /&gt;&lt;br /&gt;CREATE &amp;nbsp; INDEX &amp;nbsp; name_index &amp;nbsp; ON &amp;nbsp; username(firstname,lastname)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;这个例子对两个字段建立了单个索引。在一个复合索引中，你最多可以对16个字段进行索引。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;用事务管理器建立索引&amp;nbsp;&lt;br /&gt;&lt;br /&gt;用事务管理器建立索引比用SQL语句容易的多。使用事务管理器，你可以看到已经建立的索引的列表，并可以通过图形界面选择索引选项。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;使用事务管理器你可以用两种方式建立索引：使用Manage &amp;nbsp; Tables窗口或使用Manage &amp;nbsp; Indexes窗口。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;要用Manage &amp;nbsp; Tables &amp;nbsp; 窗口建立一个新索引，单击按钮Advanced &amp;nbsp; Options(它看起来象一个前面有一加号的表)。这样就打开了Advanced &amp;nbsp; Options对话框。这个对话框有一部分标名为Primary &amp;nbsp; Key&amp;nbsp;&lt;br /&gt;要建立一个新索引，从下拉列表中选择你想对之建立索引的字段名。如果你想建立一个对多字段的索引，你可以选择多个字段名。你还可以选择索引是聚簇的还是非聚簇的。在保存表信息后，索引会自动被建立。在Manage &amp;nbsp; Tables窗口中的字段名旁边，会出现一把钥匙。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;你已经为你的表建立了&amp;#8220;主索引&amp;#8221;。主索引必须对不包含空值的字段建立。另外，主索引强制一个字段成为唯一值字段。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;要建立没有这些限制的索引，你需要使用Manage &amp;nbsp; Indexes窗口。从菜单中选择Manage|Indexes，打开Manage &amp;nbsp; Indexes &amp;nbsp; 窗口。在Manage &amp;nbsp; Indexes &amp;nbsp; 窗口中，你可以通过下拉框选择表和特定的索引。（见图11.2）。要建立一个新索引，从Index下拉框中选择New &amp;nbsp; Index.，然后就可以选择要对之建立索引的字段。单击按钮Add，把字段加人到索引中。 &amp;nbsp;&amp;nbsp;&lt;br /&gt;你可以为你的索引选择许多不同的选项。例如，你可以选择该索引是聚簇的还是非聚簇的。你还可以指定该索引为唯一索引。设计好索引后，单击按钮Build，建立该索引。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;注意&amp;nbsp;&lt;br /&gt;&lt;br /&gt;唯一索引是指该字段不能有重复的值，而不是只能建立这一个索引。&amp;nbsp;&lt;/span&gt;&lt;img src="http://www.cnblogs.com/moses/aggbug/1823009.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/moses/archive/2010/09/10/1823009.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/moses/archive/2010/09/07/1820792.html</id><title type="text">ASP.NET Web Form 的“连续”和“有状态”假象 （转）</title><summary type="text">原文http://www.cnblogs.com/sgsoft/articles/62691.html从根本上说，ASP.NET 并没有改变 Web 页的本质：每次请求 ASP.NET 页时，服务器就会加载一个 ASP.NET 页，并在请求完成时卸载该页。页及其包含的服务器控件负责执行请求并将 HTML 呈现给客户端。ASP.NET 的设计者们，从实际访问者的角度重新考虑了这一过程：访问者打开一个...</summary><published>2010-09-07T09:02:00Z</published><updated>2010-09-07T09:02:00Z</updated><author><name>脚印</name><uri>http://www.cnblogs.com/moses/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moses/archive/2010/09/07/1820792.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moses/archive/2010/09/07/1820792.html"/><content type="html">&lt;span  style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; line-height: normal; "&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;&lt;strong&gt;原文&amp;nbsp;&lt;a href="http://www.cnblogs.com/sgsoft/articles/62691.html"&gt;http://www.cnblogs.com/sgsoft/articles/62691.html&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;从根本上说，ASP.NET 并没有改变 Web 页的本质：每次请求 ASP.NET 页时，服务器就会加载一个 ASP.NET 页，并在请求完成时卸载该页。页及其包含的服务器控件负责执行请求并将 HTML 呈现给客户端。&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;ASP.NET 的设计者们，从实际访问者的角度重新考虑了这一过程：访问者打开一个页面，点击一个按钮，看到新的画面&amp;#8230;&amp;#8230;这一切似乎都是连续的。&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;这种连续性假象是由 ASP.NET 页框架、页及其控件实现的。回发后，控件的行为必须看起来是从上次 Web 请求结束的地方开始的。另一方面，对于 Web Form 中的 TextBox，ASP.NET 也让它们具有了状态，可以知道上一个 loop 和这一个 loop 之间的 TextBox 值的变化；如果变化，可能会触发 TextBox 的 TextChanged 事件。这同样是 ASP.NET 特意实现的一个假象。&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;&lt;strong&gt;ASP.NET 服务器控件的生命周期&lt;/strong&gt;一般如下：&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;1. 初始化&amp;nbsp; -&amp;nbsp;&lt;strong&gt;Init&lt;/strong&gt;&amp;nbsp;事件&amp;nbsp;(OnInit 方法)&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;2. 加载视图状态 -&amp;nbsp;&lt;strong&gt;LoadViewState&lt;/strong&gt;&amp;nbsp;方法&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;3. 处理回发数据 -&amp;nbsp;&lt;strong&gt;LoadPostData&lt;/strong&gt;&amp;nbsp;方法&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 对实现 IPostBackDataHandler 接口的控件，即可以自动加载回发数据的控件，如 TextBox, DropDownList 等。&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;4. 加载 -&amp;nbsp;&lt;strong&gt;Load&amp;nbsp;&lt;/strong&gt;事件&amp;nbsp;(OnLoad 方法)&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;5. 发送回发更改通知 -&amp;nbsp;&lt;strong&gt;RaisePostDataChangedEvent&lt;/strong&gt;&amp;nbsp;方法&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 对实现 IPostBackDataHandler 接口的控件，即可以自动加载回发数据的控件。&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 在第 3 步中加载回发数据，如果回发前后数据发生更改，则在这一步触发相应的服务端事件。&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;6. 处理回发事件 -&amp;nbsp;&lt;strong&gt;RaisePostBackEvent&lt;/strong&gt;&amp;nbsp;方法&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 对实现 IPostBackEventHandler 接口的控件，即能引起回发的控件，如 Button, LinkButton, Calendar&amp;nbsp;等&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;7. 预呈现 -&amp;nbsp;&lt;strong&gt;PreRender&lt;/strong&gt;&amp;nbsp;事件 (OnPreRender 方法)&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;8. 保存视图状态 -&amp;nbsp;&lt;strong&gt;SaveViewState&lt;/strong&gt;&amp;nbsp;方法&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;9. 呈现 -&amp;nbsp;&lt;strong&gt;Render&lt;/strong&gt;&amp;nbsp;方法&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;10. 处置 -&amp;nbsp;&lt;strong&gt;Dispose&lt;/strong&gt;&amp;nbsp;方法&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;11. 卸载 -&amp;nbsp;&lt;strong&gt;UnLoad&lt;/strong&gt;&amp;nbsp;事件 (OnUnLoad 方法)&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;Web Form 的基类 System.Web.UI.Page 从 System.Web.UI.Control 继承，它也是一种特殊的 Control。&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;&lt;strong&gt;ASP.NET 是怎样实现状态的？&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;ASP.NET 使用了 ViewState 视图状态，如果你查看 Web Form 产生的 HTML 代码，可以看到一个名为 __ViewState 的隐藏字段，ASP.NET 将状态信息以 Hash 的方式存储在这里。通过它，可以在下一次回发时知道回发前各控件的状态。&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;比如：一个 TextBox，回发前 Text 属性有值&amp;#8220;hello&amp;#8221;，访问者填写了新的值&amp;#8220;world&amp;#8221;，当这个页面回发到服务器端，服务端代码就可以得知 TextBox 的 Text 属性值发生了改变，TextChanged 事件就被触发了。从生命周期来看，LoadViewState 这一步加载了 TextBox 的原状态，LoadPostData 这一步从 Request.Form 集合中取得了 TextBox 的当前值，过了 Load，在 RaisePostDataChangedEvent 这一步触发 TextBox 的 TextChanged 事件，SaveViewState 将当前值存入 ViewState 作为下一次回发的原状态。&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;&lt;strong&gt;ASP.NET 是怎样实现连续性假象的？&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;对开发者而言，以往对于一个提交按钮的点击回发，或者说 HTML form 提交的处理往往是在另一个页面中处理，将 form 的 target 指向该页面。（当然在一个页面中也是可以完成的，但大部分人习惯于两个页面）&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;在 ASP.NET 中，这一过程被处理成和 Windows 程序类似的过程，Button 的点击、form 被提交这个事件被 ASP.NET &amp;#8220;包装&amp;#8221;成一个服务器事件，也就是 Button 的 Click 事件。从生命周期来看，Button 控件被加载的流程如下：LoadPostData 这一步可以从 Request.Form 集合中找到 Button 的 name 值（只有被点击的 Button 会在 Request.Form 集合中生成一个 name-value 对）；过了 Load，在 RaisePostBackEvent 这一步，将触发 Button 的 Click 事件。&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;我们再分析特别的情况：Button 在 HTML 中是可以引起 form 的提交的，也就是可以引起页面回发；但其他的，如 LinkButton (对应于 HTML 的 A 元素)，DropDownList (对应于 HTML 的 SELECT)等，则并不会自动引起回发。这种情况下，ASP.NET 使用了又一个技巧来保证这一假象继续成立：打开含有&amp;nbsp;LinkButton 的一个&amp;nbsp;ASP.NET 生成的 HTML 页面代码，可以找到两个隐藏字段，一个叫 __EVENTTARGET，一个叫 __EVENTARGUMENT，再往下找到一段脚本：&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-bottom: 0px; "&gt;function __doPostBack(eventTarget, eventArgument) {&#xD;
  var theform;&#xD;
  if (window.navigator.appName.toLowerCase().indexOf("netscape") &amp;gt; -1) {&#xD;
   theform = document.forms["Form1"];&#xD;
  }&#xD;
  else {&#xD;
   theform = document.Form1;&#xD;
  }&#xD;
  theform.__EVENTTARGET.value = eventTarget.split("$").join(":");&#xD;
  theform.__EVENTARGUMENT.value = eventArgument;&#xD;
  theform.submit();&#xD;
 }&#xD;
&#xD;
&lt;/pre&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;再看看 LinkButton 生成的代码：&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-bottom: 0px; "&gt;&amp;lt;A id=LinkButton1 href="javascript:__doPostBack('LinkButton1','')"&amp;gt;LinkButton&amp;lt;/A&amp;gt;&#xD;
&lt;/pre&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;如果你做过网页中的客户端脚本的话，应该知道，当点击这个&amp;#8220;LinkButton&amp;#8221;时，实际上是通过客户端脚本将它的名字和若干参数（比如 Calendar 需要传递一些参数，LinkButton 没有传参数的必要）设置到两个隐藏字段中，并在脚本中提交了表单。&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;继续看服务段的流程：LoadPostData 会看到这两个隐藏字段中的值，但并不马上解析；依然是过了 Load，在 RaisePostBackEvent 这一步解析这两个字段中的值，触发相应控件的事件。&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;我们最后分析一下 CheckBox 或者 DropDownList 之类的 AutoPostBack 属性：如果 AutoPostBack 为 true，则在向客户端输出时，加入上面的 __doPostBack 式的回发；如为 false，则不加入这样的立即回发脚本，而是等待有其他可以引起回发的控件（比如 Button, LinkButton 等）回发后，在 RaisePostDataChanged 中触发 CheckBox 的 CheckedChanged 事件，DropDownList 的 SelectedIndexChanged 事件；在 RaisePostBackEvent 时继续分析其他引起回发的事件。&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; line-height: 21px; text-indent: 0px; "&gt;微软把复杂的 Web 模型简化成一个传统 Windows 程序员易于接受的模型，大大降低了 Web 开发的门槛。但尽管如此，微软无法改变 Web 的&amp;#8220;无状态&amp;#8221;、&amp;#8220;断续&amp;#8221;的实质，所以不要将所有 Windows 程序开发的经验都一古脑运用到 Web 开发当中。了解了其内在机理，有助于 Windows 程序员避免这些&amp;#8220;武断&amp;#8221;的错误。&lt;/p&gt;&lt;/span&gt;&lt;img src="http://www.cnblogs.com/moses/aggbug/1820792.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/moses/archive/2010/09/07/1820792.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry></feed>
