<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>我的2007 - 数据库</title><link>http://blog.csdn.net/zhijie435/category/342468.aspx</link><description>Mysql Oracle 的文章和性能优化</description><dc:language>zh-CN</dc:language><lastUpdateTime>Mon, 14 Apr 2008 18:59:46 GMT</lastUpdateTime><ttl>60</ttl><item><dc:creator>zhijie435</dc:creator><title>写了个15位身份证号升级为18位的SQL语句</title><link>http://blog.csdn.net/zhijie435/archive/2007/12/11/1928566.aspx</link><pubDate>Tue, 11 Dec 2007 08:27:00 GMT</pubDate><guid>http://blog.csdn.net/zhijie435/archive/2007/12/11/1928566.aspx</guid><wfw:comment>http://blog.csdn.net/zhijie435/comments/1928566.aspx</wfw:comment><comments>http://blog.csdn.net/zhijie435/archive/2007/12/11/1928566.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhijie435/comments/commentRss/1928566.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1928566</trackback:ping><description>	导读：　　SQL code　　　　--15位身份证号升级为18位，适用于18xx年出生的公民　　UPDATE员工表 SET身份证号=　　SUBSTRING(身份证号,1,6)+'18'+SUBSTRING(身份证号,7,9)+　　SUBSTRING('10X98765432',　　(　　CAST(SUBSTRING(身份证号, 1,1) ASINT)*7　　+CAST(SUBSTRING(身份证号, 2,1) ASINT)*9　　+CAST(SUBSTRING(身份证号, 3,1) ASINT)*10　　+CAST(SUBSTRING(身份证号, 4,1) ASINT)*5　　+CAST(SUBSTRING(身份证号, 5,1) ASINT)*8　　+CAST(SUBSTRING(身份证号, 6,1) ASINT)*4　　+1*2　　+8*1　　+CAST(SUBSTRING(身份证号, 7,1) ASINT)*6　　+CAST(SUBSTRING(身份证号, 8,1) ASINT)*3　　+CAST(SUBSTRING(身份证号, 9,1)&lt;img src ="http://blog.csdn.net/zhijie435/aggbug/1928566.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>yoyo</dc:creator><title>MySQL LIMIT 的性能问题</title><link>http://blog.csdn.net/zhijie435/archive/2007/11/06/1869359.aspx</link><pubDate>Tue, 06 Nov 2007 12:47:00 GMT</pubDate><guid>http://blog.csdn.net/zhijie435/archive/2007/11/06/1869359.aspx</guid><wfw:comment>http://blog.csdn.net/zhijie435/comments/1869359.aspx</wfw:comment><comments>http://blog.csdn.net/zhijie435/archive/2007/11/06/1869359.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhijie435/comments/commentRss/1869359.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1869359</trackback:ping><description>看样子对于 all, mysql 就使用比较笨的方法，那就改用 range 方式？

因为 id 是递增的，也很好修改 sql

select * from mytable where id &gt; offset and id &lt; offset + limit and index_col = xxx

explain 显示 type = range, 结果速度非常理想，返回结果快了几十倍。 &lt;img src ="http://blog.csdn.net/zhijie435/aggbug/1869359.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>yoyo</dc:creator><title>提高mysql性能的方法!</title><link>http://blog.csdn.net/zhijie435/archive/2007/10/26/1844760.aspx</link><pubDate>Fri, 26 Oct 2007 12:27:00 GMT</pubDate><guid>http://blog.csdn.net/zhijie435/archive/2007/10/26/1844760.aspx</guid><wfw:comment>http://blog.csdn.net/zhijie435/comments/1844760.aspx</wfw:comment><comments>http://blog.csdn.net/zhijie435/archive/2007/10/26/1844760.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhijie435/comments/commentRss/1844760.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1844760</trackback:ping><description>ORDER BY语句决定了Oracle如何将返回的查询结果排序。Order by语句对要排序的列没有什么特别的限制，也可以将函数加入列中（象联接或者附加等）。任何在Order by语句的非索引项或者有计算表达式都将降低查询速度。

仔细检查order by语句以找出非索引项或者表达式，它们会降低性能。解决这个问题的办法就是重写order by语句以使用索引，也可以为所使用的列建立另外一个索引，同时应绝对避免在order by子句中使用表达式。
&lt;img src ="http://blog.csdn.net/zhijie435/aggbug/1844760.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>yoyo</dc:creator><title> MySQL各存储引擎的区别及其启动方法</title><link>http://blog.csdn.net/zhijie435/archive/2007/10/19/1832526.aspx</link><pubDate>Fri, 19 Oct 2007 12:10:00 GMT</pubDate><guid>http://blog.csdn.net/zhijie435/archive/2007/10/19/1832526.aspx</guid><wfw:comment>http://blog.csdn.net/zhijie435/comments/1832526.aspx</wfw:comment><comments>http://blog.csdn.net/zhijie435/archive/2007/10/19/1832526.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhijie435/comments/commentRss/1832526.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1832526</trackback:ping><description>不同的存储引擎在不同的对象级别支持锁定，而且这些级别将影响可以同时访问的信息。得到支持的级别有三种:表锁定、块锁定和行锁定。支持最多的是表锁定，这种锁定是在MyISAM中提供的。在数据更新时，它锁定了整个表。这就防止了许多应用程序同时更新一个具体的表。这对应用很多的多用户数据库有很大的影响，因为它延迟了更新的过程。

　　页级锁定使用Berkeley DB引擎，并且根据上载的信息页(8KB)锁定数据。当在数据库的很多地方进行更新的时候，这种锁定不会出现什么问题。但是，由于增加几行信息就要锁定数据结构的最后8KB，当需要增加大量的行，也别是大量的小型数据，就会带来问题。

　　行级锁定提供了最佳的并行访问功能，一个表中只有一行数据被锁定。这就意味着很多应用程序能够更新同一个表中的不同行的数据，而不会引起锁定的问题。只有InnoDB存储引擎支持行级锁定。
&lt;img src ="http://blog.csdn.net/zhijie435/aggbug/1832526.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>