<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_leeolevis_分类_数据库</title><id>http://feed.cnblogs.com/blog/u/51427/category/315264/rss</id><updated>2012-06-03T19:43:56Z</updated><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/category/315264.html"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/51427/category/315264/rss"/><entry><id>http://www.cnblogs.com/leeolevis/archive/2011/04/27/1962552.html</id><title type="text">测试SQL语句执行时间</title><summary type="text">一、第一种测试declare @d datetimeset @d=getdate()select COUNT(0) from Disease--select * from Diseaseselect [语句执行花费时间(毫秒)]=datediff(ms,@d,getdate())http://space.itpub.net/9671084/viewspace-255613聚集索引是如此的重要和珍贵，所以笔者总结了一下，一定要将聚集索引建立在：1、您最频繁使用的、用以缩小查询范围的字段上；2、您最频繁使用的、需要排序的字段上。二、第二种测试set statistics profile onset</summary><published>2011-04-27T01:59:00Z</published><updated>2011-04-27T01:59:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2011/04/27/1962552.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2011/04/27/1962552.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2011/03/03/1970097.html</id><title type="text">关于MongoDB的安装和使用</title><summary type="text">命令帮助： CMD 用DOS命令进入MongoDB文件夹 使用mongod --help可查看MongoDB命令帮助安装命令：mongod -dbpath E:\MongoDB\db -logpath E:\MongoDB\log -install 注册完服务完成后提示：net start "MongoDB" 启动服务。如果出现“服务没有响应控制功能”，请使用以下命令：（使用命令前最好创建logs和data文件夹）mongod --logpath E:\MongoDB\logs\mongodb.log -logappend --dbpath E:\MongoDB\data </summary><published>2011-03-03T08:44:00Z</published><updated>2011-03-03T08:44:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2011/03/03/1970097.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2011/03/03/1970097.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2011/03/03/1969917.html</id><title type="text">【转】Memcache and Mongodb</title><summary type="text">MemcacheMemcache的优势我觉得总结下来主要体现在：1） 分布式。可以由10台拥有4G内存的机器，构成一个40G的内存池，如果觉得还不够大可以增加机器，这样一个大的内存池，完全可以把大部分热点业务数据保存进去，由内存来阻挡大部分对数据库读的请求，对数据库释放可观的压力。2） 单点。如果Web服务器或App服务器做负载均衡的话，在各自内存中保存的缓存可能各不相同，如果数据需要同步的话，比较麻烦（各自自己过期，还是分发数据同步？），即使数据并不需要同步，用户也可能因为数据的不一致而产生用户体验上的不友好。3） 性能强。不用怀疑和数据库相比确实是，根源上还是内存的读写和磁盘读写效率上几个</summary><published>2011-03-03T06:41:00Z</published><updated>2011-03-03T06:41:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2011/03/03/1969917.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2011/03/03/1969917.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2010/12/02/1894775.html</id><title type="text">Subsonic 3, T4 Templates, SQLite</title><summary type="text">I want to start with how the templates will work out in an actual Visual Studio project/solution. T4 templates have a *.tt extension. You can compartmentalize code by splitting it into different include files. That's what all the *.ttinclude files are.Make sure that the project where the templat</summary><published>2010-12-02T10:40:00Z</published><updated>2010-12-02T10:40:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2010/12/02/1894775.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2010/12/02/1894775.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2010/11/19/1882069.html</id><title type="text">SQL Server到Oracle连接服务器</title><summary type="text">1.要求pc机上安装oralce客户端软件和sqlserver软件。2.客户端的配置tnsnames.ora文件，配置所要连接的数据库服务器（windows，unix等平台均可以）eg：tnsnames.ora......TEST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.11.90)(PORT= 1521)) ) (CONNECT_DATA = (sid = blue) (SERVER = DEDICATED) ) )......3.配置windows的ODBC数据源： 开始菜单—》设置—</summary><published>2010-11-19T09:46:00Z</published><updated>2010-11-19T09:46:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2010/11/19/1882069.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2010/11/19/1882069.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2010/08/06/1793591.html</id><title type="text">用存储过程构造一个虚拟日期表发现的趣事</title><summary type="text">Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--&gt;USE[SQL_Test]GO/******Object:StoredProcedure[dbo].[ProcReturnDaysTable]ScriptDate:08/05/201022:45:56******/SETANSI_NULLSONGOSETQUOTED_IDENTIFIERONGOALTERPROCEDURE[dbo].[ProcReturnDaysTable]--Addthepa</summary><published>2010-08-05T16:03:00Z</published><updated>2010-08-05T16:03:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2010/08/06/1793591.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2010/08/06/1793591.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2010/07/09/1774468.html</id><title type="text">Google ProtocolBuffer.net简介与使用</title><summary type="text">protobuf-net是Google的ProtocolBuffer的.net实现。ProtocolBuffer是用于结构化数据串行化的灵活、高效、自动的方法，有如XML，不过它更小、更快、也更简单。你可以定义自己的数据结构，然后使用代码生成器生成的代码来读写这个数据结构。你甚至可以在无需重新部署程序的情况下更新数据结构。 引用protobuf-net.dll组件1、能过特性定义ProtoBuf格式的类[ProtoContract]public class User{ [ProtoMember(1, IsRequired = true)] public int UserID { get; s.</summary><published>2010-07-09T08:27:00Z</published><updated>2010-07-09T08:27:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2010/07/09/1774468.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2010/07/09/1774468.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2010/05/27/1744992.html</id><title type="text">Asp.Net网站优化系列 数据库的优化措施 索引优化</title><summary type="text">索引的作用就类似于书的目录，书的目录会按照章节的顺序排列，会指想某一张的位置。这样如果在一本数百页的书里面查找某个章节位置的时候，我们就可以只扫描书的目录，扫描的范围缩小了n倍，查询的效率自然就提高了。另外在sql server内存够用的情况下索引会被放到内存中，在内存中查找自然又会提高效率；所以我们必须得合理利用索引。1）对什么列建索引数据库默认情况下会对主键建聚集索引，除了这个索引之外还需要在哪些列上建索引呢？这个问题只能具体情况具体分析，要看需要优化的sql语句（通常是查询次数多，查询相应想要高的语句），根据什么列的条件进行查询。例如：在论坛的数据库中有一张表是帖子回复表，在论坛的应用中</summary><published>2010-05-27T02:13:00Z</published><updated>2010-05-27T02:13:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2010/05/27/1744992.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2010/05/27/1744992.html"/><content type="text">索引的作用就类似于书的目录，书的目录会按照章节的顺序排列，会指想某一张的位置。这样如果在一本数百页的书里面查找某个章节位置的时候，我们就可以只扫描书的目录，扫描的范围缩小了n倍，查询的效率自然就提高了。另外在sql server内存够用的情况下索引会被放到内存中，在内存中查找自然又会提高效率；所以我们必须得合理利用索引。1）对什么列建索引数据库默认情况下会对主键建聚集索引，除了这个索引之外还需要在哪些列上建索引呢？这个问题只能具体情况具体分析，要看需要优化的sql语句（通常是查询次数多，查询相应想要高的语句），根据什么列的条件进行查询。例如：在论坛的数据库中有一张表是帖子回复表，在论坛的应用中</content></entry><entry><id>http://www.cnblogs.com/leeolevis/archive/2010/01/22/1654418.html</id><title type="text">SQLite 内建函数表和使用心得</title><summary type="text">算术函数 abs(X) 返回给定数字表达式的绝对值。 max(X,Y[,...]) 返回表达式的最大值。 min(X,Y[,...]) 返回表达式的最小值。 random(*) 返回随机数。 round(X[,Y]) 返回数字表达式并四舍五入为指定的长度或精度。 字符处理函数 length(X) 返回给定字符串表达式的字符个数。 lower(X) 将大写字符数据转换为小写字符数据后返回字符表达式。 upper(X) 返回将小写字符数据转换为大写的字符表达式。 substr(X,Y,Z) 返回表达式的一部分。 randstr() quote(A) like(A,B) 确定给定的字符串是否与指定的</summary><published>2010-01-22T11:32:00Z</published><updated>2010-01-22T11:32:00Z</updated><author><name>leeolevis</name><uri>http://www.cnblogs.com/leeolevis/</uri></author><link rel="alternate" href="http://www.cnblogs.com/leeolevis/archive/2010/01/22/1654418.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/leeolevis/archive/2010/01/22/1654418.html"/><content type="text">算术函数 abs(X) 返回给定数字表达式的绝对值。 max(X,Y[,...]) 返回表达式的最大值。 min(X,Y[,...]) 返回表达式的最小值。 random(*) 返回随机数。 round(X[,Y]) 返回数字表达式并四舍五入为指定的长度或精度。 字符处理函数 length(X) 返回给定字符串表达式的字符个数。 lower(X) 将大写字符数据转换为小写字符数据后返回字符表达式。 upper(X) 返回将小写字符数据转换为大写的字符表达式。 substr(X,Y,Z) 返回表达式的一部分。 randstr() quote(A) like(A,B) 确定给定的字符串是否与指定的</content></entry></feed>
