<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>银河星尘 &#187; SQL</title>
	<atom:link href="http://galaxy.ourkernel.com/blog/category/computer/programming-computer/sql-programming-computer-computer/feed" rel="self" type="application/rss+xml" />
	<link>http://galaxy.ourkernel.com/blog</link>
	<description>Galaxy's World</description>
	<lastBuildDate>Mon, 26 Jul 2010 06:58:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>[ZT]以后谁再跟我说MySQL性能好我跟谁急……</title>
		<link>http://galaxy.ourkernel.com/blog/200912/721</link>
		<comments>http://galaxy.ourkernel.com/blog/200912/721#comments</comments>
		<pubDate>Sun, 20 Dec 2009 13:13:36 +0000</pubDate>
		<dc:creator>Galaxy</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[优化]]></category>
		<category><![CDATA[速度]]></category>

		<guid isPermaLink="false">http://galaxy.ourkernel.com/blog/200912/721</guid>
		<description><![CDATA[性能测试, 数据库 http://obmem.com/?p=317 TNND，今天浪费了一天的时间在Mysql上面，先是改代码，然后是转换sqlite3数据库到mysql，然后发现原来好好的网站跑不起来了。 @。@ 然后就这么折腾了半天，基本上确定了，在select语句上，mysql的性能平均落后sqlite十倍左右，内存消耗超过sqlite则是三倍左右。 - 实际上mysql更灵活点，我的意思是：给mysql三倍的内存，那么他的表现只比sqlite慢十倍而已，如果你给他很抠门的内存？那么超时是唯一的结果。就像我一开始网站挂掉那样。 - 不过今天这么折腾的好处是： 1.对数据库的命令行操作有了全面的认识，现在我已经完全不需要phpmyadmin这种土货了 2.对数据库的优化有了全面的认识，我今天起码看了100篇以上的mysql索引优化方法，官方文档翻了个底朝天，看得吐血 - 结论是： 1.mysql太过傻X，order by怎么样都用不上index，而这应该是用膝盖想都要用index的（如果我错了，请指出，我实在是找遍网上资料，mysql官网文档都快犁了一遍了，还是没找到如何让order by用index的方法（我是指没有where语句，只有order by，至少sqlite是会去用index的，这从explain语句可以看出）） 2.即使用fulltext全文索引，用where加limit搜索同样的内容，如果分页很大(例如limit 10000,1)的话，mysql的执行速度还是比sqlite慢十倍左右。 3.where加order by加limit，其中where和order by的关键字组成索引对，明显可以看出sqlite的性能提升很大，而mysql的性能则毫无多大变化。 - 有人说sqlite不开事务很悲剧，insert时间是别人的十几倍，我靠谁吃饱了撑的有事没事去insert？数据库到底是insert时间多还是select的时间多，哪怕insert时间比mysql慢一百倍，就冲它select时间比mysql快一百倍以上我就不会用mysql了。(真的有一百倍，如果用order by关键字的话，因为mysql怎么都教不会它用索引，用force index语句都不行，它就是顽固地要进行filesort，太无语了) - 有人不信的话我可以提供数据库和测试语句，自己去折腾去 ========================== 一些比较： mysql设置：默认的large配置文件，修改sort相关的buff到16M以上 sqlite设置：无设置 数据库：verycd，表项有id，title，content，updatetime,category等，id是primary integer，数据表项有16万 索引都是三个，updatetime，(updatetime,title),(category,updatetime,title) 语句一： SELECT title FROM verycd LIMIT 150000,1; mysql=1 row in set (4.64 sec) sqlite3=CPU Time: user 0.116007 sys 0.144009 [...]]]></description>
		<wfw:commentRss>http://galaxy.ourkernel.com/blog/200912/721/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[SQL]在AutoCommit=0时执行VACUUM</title>
		<link>http://galaxy.ourkernel.com/blog/200908/625</link>
		<comments>http://galaxy.ourkernel.com/blog/200908/625#comments</comments>
		<pubDate>Fri, 21 Aug 2009 01:59:56 +0000</pubDate>
		<dc:creator>Galaxy</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[stackoverflow]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://galaxy001.3322.org/blog/200908/625</guid>
		<description><![CDATA[http://stackoverflow.com/questions/1303514/why-does-dbh-dovacuum-fail-with-perls-dbdsqlite/1303537 这网站不错…… Why does $dbh->do(’VACUUM’) fail with Perl’s DBD::SQLite? I want to do VACUUM at a certain time on a SQLite database under Perl, but it always says DBD::SQLite::db do failed: cannot VACUUM from within a transaction So how do I do this? my %attr = &#40; RaiseError =&#62; 0, PrintError =&#62; 1, AutoCommit =&#62; [...]]]></description>
		<wfw:commentRss>http://galaxy.ourkernel.com/blog/200908/625/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
