<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_LiuJiang</title><subtitle type="text">welcome to my blog!</subtitle><id>http://feed.cnblogs.com/blog/u/36516/rss</id><updated>2012-04-20T01:15:13Z</updated><author><name>John.Lau</name><uri>http://www.cnblogs.com/liujiang/</uri></author><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/liujiang/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/36516/rss"/><entry><id>http://www.cnblogs.com/liujiang/archive/2012/04/20/2458741.html</id><title type="text">SQLServer Full text 第一次使用会 timeout的问题</title><summary type="text">最近遇到一个比较奇怪的问题，为了提升一个Search Function的性能，为此建立了全文索引，然后用Contains语句来降低查询时间。SELECT * FROMTABLE_AWHERE CONTAINS(Field1,'ABC|DFD|FD')使用Contains查询确实比较很快。不过问题是每过约20分钟左右的时间；再次使用contains查询会很慢，甚至会超时，第2次,第3次..则又非常快。如此的重复着。开始的时候我怀疑是因为SQLServer的 Data Cache问题，所以用WITH Recomplie Option等方式去解决不使用Cache的，但仍然没有任何效果</summary><published>2012-04-20T00:05:00Z</published><updated>2012-04-20T00:05:00Z</updated><author><name>John.Lau</name><uri>http://www.cnblogs.com/liujiang/</uri></author><link rel="alternate" href="http://www.cnblogs.com/liujiang/archive/2012/04/20/2458741.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/liujiang/archive/2012/04/20/2458741.html"/><content type="html">&lt;p&gt;最近遇到一个比较奇怪的问题，为了提升一个Search Function的性能，为此建立了全文索引，然后用Contains语句来降低查询时间。&lt;/p&gt;&lt;p&gt;&amp;nbsp;SELECT * FROM&amp;nbsp;&amp;nbsp;TABLE_A&amp;nbsp;WHERE CONTAINS(Field1,'ABC|DFD|FD')&lt;/p&gt;&lt;p&gt;使用Contains查询确实比较很快。不过问题是每过约20分钟左右的时间；再次使用contains查询会很慢，甚至会超时，第2次,第3次..则又非常快。如此的重复着。&amp;nbsp;开始的时候我怀疑是因为SQLServer的 Data Cache问题，所以用WITH Recomplie Option等方式去解决不使用Cache的，但仍然没有任何效果，问题还是继续出现。且这个问题只是出现在某一个环境下。&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;最后证实问题的罪魁祸首是一个SQLServer的一个配置(&lt;em&gt;&lt;strong&gt;VerifySignature&lt;/strong&gt;&lt;/em&gt;). 唯独在这个环境中&lt;em&gt;&lt;strong&gt;VerifySignature&lt;/strong&gt;&lt;/em&gt;属性被设为了1,其他的环境都是0.&lt;/p&gt;&lt;p&gt;查询配置的语句：&lt;/p&gt;&lt;p&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: small;"&gt;SELECT&lt;/span&gt;&lt;span style="color: #ff00ff; font-family: 'Courier New'; font-size: small;"&gt;fulltextserviceproperty&lt;/span&gt;&lt;span style="color: #808080; font-family: 'Courier New'; font-size: small;"&gt;(&lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New'; font-size: small;"&gt;'VerifySignature'&lt;/span&gt;&lt;span style="color: #808080; font-family: 'Courier New'; font-size: small;"&gt;)&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;当&lt;em&gt;&lt;strong&gt;VerifySignature&lt;/strong&gt;&lt;/em&gt;被设置成1时。&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;当第一次query的时候，SQLServer 会尝试连到Internet 上 验证word breaker证书. 接下来的第二次则不会再去验证。&lt;/p&gt;&lt;p&gt;验证需要花一些时间，尤其当SQLServer没有网络连接的时候。&lt;/p&gt;&lt;p&gt;如果在5分钟里并没有其他的Full text search被行的话, the word breaker会被Unload掉，然后再次执行证书验证。这就是为什么我会遇到这样奇怪的问题.&lt;/p&gt;&lt;p&gt;解决办法:&lt;/p&gt;&lt;code style="border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #eeeeee; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; border-width: 0px; padding: 0px; margin: 0px;"&gt;&lt;span class="pln" style="border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; color: #000000; border-width: 0px; padding: 0px; margin: 0px;"&gt;sp_fulltext_service &lt;/span&gt;&lt;span class="str" style="border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; color: #800000; border-width: 0px; padding: 0px; margin: 0px;"&gt;'verify_signature'&lt;/span&gt;&lt;span class="pun" style="border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; color: #000000; border-width: 0px; padding: 0px; margin: 0px;"&gt;,&lt;/span&gt;&lt;span class="lit" style="border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; color: #800000; border-width: 0px; padding: 0px; margin: 0px;"&gt;0&lt;/span&gt;&lt;span class="pun" style="border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; color: #000000; border-width: 0px; padding: 0px; margin: 0px;"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;img src="http://www.cnblogs.com/liujiang/aggbug/2458741.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/liujiang/archive/2012/04/20/2458741.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/liujiang/archive/2009/06/03/1495180.html</id><title type="text">C# 复制指定文件夹下的所有文件和文件夹</title><summary type="text">C# 复制指定文件夹下的所有文件和文件夹</summary><published>2009-06-03T02:59:00Z</published><updated>2009-06-03T02:59:00Z</updated><author><name>John.Lau</name><uri>http://www.cnblogs.com/liujiang/</uri></author><link rel="alternate" href="http://www.cnblogs.com/liujiang/archive/2009/06/03/1495180.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/liujiang/archive/2009/06/03/1495180.html"/><content type="text">C# 复制指定文件夹下的所有文件和文件夹</content></entry><entry><id>http://www.cnblogs.com/liujiang/archive/2009/05/31/1493071.html</id><title type="text">SQL 复制硬盘文件．</title><summary type="text">有时候我们需要通过SQL语句来拷贝服务器上的文件，这时我们可以通过执行xp_cmdshell  来达到拷贝文件的效果如下：</summary><published>2009-05-31T09:20:00Z</published><updated>2009-05-31T09:20:00Z</updated><author><name>John.Lau</name><uri>http://www.cnblogs.com/liujiang/</uri></author><link rel="alternate" href="http://www.cnblogs.com/liujiang/archive/2009/05/31/1493071.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/liujiang/archive/2009/05/31/1493071.html"/><content type="text">有时候我们需要通过SQL语句来拷贝服务器上的文件，这时我们可以通过执行xp_cmdshell  来达到拷贝文件的效果如下：</content></entry><entry><id>http://www.cnblogs.com/liujiang/archive/2009/03/10/1407578.html</id><title type="text">C# 存取SqlServer中的Image类型</title><summary type="text">有时候我们需要将图片存到数库中的Imgae类型的字段下,以下是存取的两种方法:</summary><published>2009-03-10T02:12:00Z</published><updated>2009-03-10T02:12:00Z</updated><author><name>John.Lau</name><uri>http://www.cnblogs.com/liujiang/</uri></author><link rel="alternate" href="http://www.cnblogs.com/liujiang/archive/2009/03/10/1407578.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/liujiang/archive/2009/03/10/1407578.html"/><content type="text">有时候我们需要将图片存到数库中的Imgae类型的字段下,以下是存取的两种方法:</content></entry><entry><id>http://www.cnblogs.com/liujiang/archive/2009/03/03/1402467.html</id><title type="text">C# EventLog 类</title><summary type="text">EventLog 类提供了C#与Windows事件日志交互的功能。 很多时候我们可以把日志写到windows事件日志中. 说明:EventLog 使您可以访问或自定义 Windows 事件日志。通过C#提供的EventLog类，可以读取现有日志，向日志中写入项，创建或删除事件源，删除日志，以及响应日志项。也可在创建事件源时创建新日志。</summary><published>2009-03-03T10:15:00Z</published><updated>2009-03-03T10:15:00Z</updated><author><name>John.Lau</name><uri>http://www.cnblogs.com/liujiang/</uri></author><link rel="alternate" href="http://www.cnblogs.com/liujiang/archive/2009/03/03/1402467.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/liujiang/archive/2009/03/03/1402467.html"/><content type="text">EventLog 类提供了C#与Windows事件日志交互的功能。 很多时候我们可以把日志写到windows事件日志中. 说明:EventLog 使您可以访问或自定义 Windows 事件日志。通过C#提供的EventLog类，可以读取现有日志，向日志中写入项，创建或删除事件源，删除日志，以及响应日志项。也可在创建事件源时创建新日志。</content></entry><entry><id>http://www.cnblogs.com/liujiang/archive/2009/02/26/1398985.html</id><title type="text">SQL 列数据随机排列</title><summary type="text">有时我们在查询的时候,为了让某些字段随机排列,不得不写一些复杂的function,还好,SQL2005为我们提供了一个函数(newid())来实现这样的功能,</summary><published>2009-02-26T10:07:00Z</published><updated>2009-02-26T10:07:00Z</updated><author><name>John.Lau</name><uri>http://www.cnblogs.com/liujiang/</uri></author><link rel="alternate" href="http://www.cnblogs.com/liujiang/archive/2009/02/26/1398985.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/liujiang/archive/2009/02/26/1398985.html"/><content type="text">有时我们在查询的时候,为了让某些字段随机排列,不得不写一些复杂的function,还好,SQL2005为我们提供了一个函数(newid())来实现这样的功能,</content></entry><entry><id>http://www.cnblogs.com/liujiang/archive/2009/02/24/1397251.html</id><title type="text">C#可空类型,int可以为null.</title><summary type="text">在.net framework 2.0中,由于泛型的引入,所以我们可以使用System.Nullable创建可空的值类型,这非常适合于创建int类型的null值,在这之前,我们很难创建这相的可以null的int型.要创建int 类型的可空类型,可以使用下面语法:System.Nullable x=new System.Nullable;</summary><published>2009-02-24T07:03:00Z</published><updated>2009-02-24T07:03:00Z</updated><author><name>John.Lau</name><uri>http://www.cnblogs.com/liujiang/</uri></author><link rel="alternate" href="http://www.cnblogs.com/liujiang/archive/2009/02/24/1397251.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/liujiang/archive/2009/02/24/1397251.html"/><content type="text">在.net framework 2.0中,由于泛型的引入,所以我们可以使用System.Nullable创建可空的值类型,这非常适合于创建int类型的null值,在这之前,我们很难创建这相的可以null的int型.要创建int 类型的可空类型,可以使用下面语法:System.Nullable x=new System.Nullable;</content></entry><entry><id>http://www.cnblogs.com/liujiang/archive/2009/02/13/1390064.html</id><title type="text">DataTable已经属于另外一个DataSet的问题</title><summary type="text">DataTable已经属于另外一个DataSet的问题</summary><published>2009-02-13T07:05:00Z</published><updated>2009-02-13T07:05:00Z</updated><author><name>John.Lau</name><uri>http://www.cnblogs.com/liujiang/</uri></author><link rel="alternate" href="http://www.cnblogs.com/liujiang/archive/2009/02/13/1390064.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/liujiang/archive/2009/02/13/1390064.html"/><content type="text">DataTable已经属于另外一个DataSet的问题</content></entry><entry><id>http://www.cnblogs.com/liujiang/archive/2009/01/19/1378471.html</id><title type="text">奥巴马就职典礼采用微软Silverlight技术</title><summary type="text">每一位使用Mac PPC、Linux和FreeBSD的用户被抛弃了，因为美国新总统就职典礼的在线视频采用了微软Silverlight技术，Windows用户必须安装Silverlight 2才能观看</summary><published>2009-01-19T10:10:00Z</published><updated>2009-01-19T10:10:00Z</updated><author><name>John.Lau</name><uri>http://www.cnblogs.com/liujiang/</uri></author><link rel="alternate" href="http://www.cnblogs.com/liujiang/archive/2009/01/19/1378471.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/liujiang/archive/2009/01/19/1378471.html"/><content type="text">每一位使用Mac PPC、Linux和FreeBSD的用户被抛弃了，因为美国新总统就职典礼的在线视频采用了微软Silverlight技术，Windows用户必须安装Silverlight 2才能观看</content></entry><entry><id>http://www.cnblogs.com/liujiang/archive/2009/01/19/1378099.html</id><title type="text">C#读取Excel文档</title><summary type="text">有时候我们会使用C#里读取excel文档,其实读取excel文档是很简单的,下面是代码:</summary><published>2009-01-19T01:39:00Z</published><updated>2009-01-19T01:39:00Z</updated><author><name>John.Lau</name><uri>http://www.cnblogs.com/liujiang/</uri></author><link rel="alternate" href="http://www.cnblogs.com/liujiang/archive/2009/01/19/1378099.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/liujiang/archive/2009/01/19/1378099.html"/><content type="text">有时候我们会使用C#里读取excel文档,其实读取excel文档是很简单的,下面是代码:</content></entry></feed>
