<!-- Free Hosting WebNG.com --> 
<center>
<script type="text/javascript" charset="utf-8">

  var redvase_ad = { version: 1.5 };

  redvase_ad.publisher = 'webng';

  redvase_ad.kind      = 'leaderboard';

  redvase_ad.content   = 'creative'

  redvase_ad.refurl    = encodeURI('**URL_HERE**');

  </script>

<script src="http://redvase.bravenet.com/javascripts/redvase.js" type="text/javascript" charset="utf-8"></script>

</center>
<!-- Free Hosting WebNG.com --> 
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:wfw="http://wellformedweb.org/CommentAPI/">
  <channel>
    <title><![CDATA[○白子○ 的Blog]]></title> 
    <link>http://www6.webng.com/seaboat/</link> 
    <description><![CDATA[关注互联网，拥抱开源，记录工作和生活的点点滴滴]]></description> 
    <language>zh-cn</language> 
    <copyright><![CDATA[Copyright 2009, ○白子○ 的Blog]]></copyright> 
    <webMaster><![CDATA[ouzhiwei@gmail.com (Jlake Ou)]]></webMaster> 
    <generator>LBS v2.0.313</generator> 
    <pubDate>Mon, 23 Nov 2009 04:34:08 -0500</pubDate> 
    <ttl>60</ttl>
  
    <item>
      <title><![CDATA[让 Zend_Db 支持 MySQL 的 SQL_CALC_FOUND_ROWS]]></title> 
      <link><![CDATA[http://www6.webng.com/seaboat/article.asp?id=768]]></link> 
      <category><![CDATA[DB&SQL]]></category> 
      <author><![CDATA[seaboat <null@null.com>]]></author> 
      <pubDate>Tue, 10 Nov 2009 05:23:23 -0500</pubDate> 
      <description><![CDATA[修改 Zend/Db/Select.php， 增加以下代码<br /><div class="code">const FOUND_ROWS     = &#39;foundrows&#39;; <br />const SQL_FOUND_ROWS = &#39;SQL_CALC_FOUND_ROWS&#39;; <br /><br />protected static $_partsInit = array(<br />&nbsp;self::FOUND_ROWS   =&gt; false,  <br />&nbsp;... ...<br />);<br /><br />/**<br />&nbsp;* Makes the query SELECT SQL_CALC_FOUND_ROWS.  <br />&nbsp;*<br />&nbsp;* @param bool $flag Whether or not add SQL_CALC_FOUND_ROWS to SELECT.<br />&nbsp;* @return Zend_Db_Select This Zend_Db_Select object.</div>]]></description>
      <wfw:commentRss><![CDATA[http://www6.webng.com/seaboat/feed.asp?q=comment&id=768]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[SQL 关键字 → Zend_Db_Select 函数]]></title> 
      <link><![CDATA[http://www6.webng.com/seaboat/article.asp?id=736]]></link> 
      <category><![CDATA[DB&SQL]]></category> 
      <author><![CDATA[seaboat <null@null.com>]]></author> 
      <pubDate>Fri, 10 Apr 2009 04:37:36 -0400</pubDate> 
      <description><![CDATA[今天用 Zend_Db 碰上 having 关键字，一开始写在 group() 中，没成功，后来发现有 having() 方法，问题解决了。<br /><br />顺便总结一下 SQL 关键字与 Zend_Db_Select 函数的对应关系：<div class="code">FROM → from()<br />DISTINCT → distinct()<br />JOIN → join()<br />LEFT OUTER JOIN → joinLeft()<br />RIGHT OUTER JOIN → joinRight()<br />FULL OUTER JOIN → joinFULL()<br />WHERE → where()、orWhere()<br />GROUP BY → group()<br />HAVING → having()<br />ORDER BY → order()</div>]]></description>
      <wfw:commentRss><![CDATA[http://www6.webng.com/seaboat/feed.asp?q=comment&id=736]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[MySQL下复制表格的方法]]></title> 
      <link><![CDATA[http://www6.webng.com/seaboat/article.asp?id=727]]></link> 
      <category><![CDATA[DB&SQL]]></category> 
      <author><![CDATA[seaboat <null@null.com>]]></author> 
      <pubDate>Fri, 27 Feb 2009 00:36:20 -0500</pubDate> 
      <description><![CDATA[两步走：<div class="code">CREATE TABLE new_table LIKE original_table;<br />INSERT INTO new_table SELECT * FROM original_table;</div>这样做的好处是同时复制表格的主键等。<br /><br />如果只是复制数据：<div class="code">CREATE TABLE new_table AS SELECT * FROM original_table;</div>即可。]]></description>
      <wfw:commentRss><![CDATA[http://www6.webng.com/seaboat/feed.asp?q=comment&id=727]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[获取 PostgreSQL 数据库之 sequence 名称列表的 SQL]]></title> 
      <link><![CDATA[http://www6.webng.com/seaboat/article.asp?id=700]]></link> 
      <category><![CDATA[DB&SQL]]></category> 
      <author><![CDATA[seaboat <null@null.com>]]></author> 
      <pubDate>Wed, 12 Mar 2008 22:30:35 -0400</pubDate> 
      <description><![CDATA[较低版本（1.0 ?） <a href="http://www.cakephp.org/" title="http://www.cakephp.org/" target="_blank">CakePHP</a> 的文件<br /><span style="color:darkred">cake/libs/model/dbo/dbo_postgres.php</span><br />中，有一句 SQL：<br /><div class="code">SELECT sequence_name FROM information_schema.sequences</div>在 PostgreSQL 8 中，以上 SQL 运行出错。<br /><br />根据原意修改如下：<br /><div class="code">SELECT c.relname as sequence_name FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n WHERE c.relnamespace = n.oid AND c.relkind=&#39;S&#39; and n.nspname = &#39;public&#39;</div>]]></description>
      <wfw:commentRss><![CDATA[http://www6.webng.com/seaboat/feed.asp?q=comment&id=700]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[简明 PostgreSQL 建库步骤]]></title> 
      <link><![CDATA[http://www6.webng.com/seaboat/article.asp?id=689]]></link> 
      <category><![CDATA[DB&SQL]]></category> 
      <author><![CDATA[seaboat <null@null.com>]]></author> 
      <pubDate>Fri, 15 Feb 2008 01:07:11 -0500</pubDate> 
      <description><![CDATA[1.切换至 PostgreSQL 超级用户<br /><span style="color:blue">$ su - postgres</span><br /><br />2.初始化数据库 (仅在数据库未初始化时需要此步骤)<br /><span style="color:blue">$ initdb --no-locale --encoding=EUC_JP</span><br /><br />3.创建用户和数据库<br /><span style="color:blue">$ createuser -d -P user1<br />$ createdb -U user1 -O user1 userdb1</span><br /><br />4.数据库连接测试<br /><span style="color:blue">$ psql -U user1 -W userdb1</span>]]></description>
      <wfw:commentRss><![CDATA[http://www6.webng.com/seaboat/feed.asp?q=comment&id=689]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[关于优化MySQL应对高访问网站的讨论]]></title> 
      <link><![CDATA[http://www6.webng.com/seaboat/article.asp?id=686]]></link> 
      <category><![CDATA[DB&SQL]]></category> 
      <author><![CDATA[seaboat <null@null.com>]]></author> 
      <pubDate>Sun, 10 Feb 2008 03:34:00 -0500</pubDate> 
      <description><![CDATA[原文: <a href="http://www-css.fnal.gov/dsg/external/freeware/mysqlTuning.html" title="http://www-css.fnal.gov/dsg/external/freeware/mysqlTuning.html" target="_blank">http://www-css.fnal.gov/dsg/external/freeware/mysqlTuning.html</a><br />翻译: <a href="http://baibai1984.spaces.live.com/" title="http://baibai1984.spaces.live.com/" target="_blank">小白</a>（又名 风子） <br /><br /><b>MySQL优化<br />关于优化MySQL应对高访问网站的讨论</b><br />Tim,<br />首席技术长官，DCS<br /><br /><b>MySQL设置，高并发连接</b><br />本人有一网站每天需要负责大约3000用户，每天长达5到7小时的在线工作。所以在繁忙时段，我们要为2000多并发用户提供服务。在PHP和MySQL的设置比较合理的前提下，即使是入门级的Intel平台的服务器，MySQL一样可以应对的很好。<br /><br /><b>首先是硬件需求</b><br />1. 最好可以将Apache/PHP和MySQL分开跑在两台独立的服务器上，Linux版本及分发不限<br />]]></description>
      <wfw:commentRss><![CDATA[http://www6.webng.com/seaboat/feed.asp?q=comment&id=686]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[查看PostgreSQL数据表格和索引的大小]]></title> 
      <link><![CDATA[http://www6.webng.com/seaboat/article.asp?id=623]]></link> 
      <category><![CDATA[DB&SQL]]></category> 
      <author><![CDATA[seaboat <null@null.com>]]></author> 
      <pubDate>Tue, 31 Jul 2007 21:30:11 -0400</pubDate> 
      <description><![CDATA[-- 随机顺序<br /><span style="color:#0094BB">SELECT relname, reltuples, relpages FROM pg_class ;</span><br /><br />-- 按 relpages（磁盘使用量）排序（降序）<br /><span style="color:#0094BB">SELECT relname, reltuples, relpages FROM pg_class ORDER BY relpages DESC ;</span><br /><br />-- 按 reltuples（记录数）排序（降序）<br /><span style="color:#0094BB">SELECT relname, reltuples, relpages FROM pg_class ORDER BY reltuples DESC ;</span><br /><br />参考：[URL=http://www.ffnn.nl/pages/articles/linux/postgre]]></description>
      <wfw:commentRss><![CDATA[http://www6.webng.com/seaboat/feed.asp?q=comment&id=623]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[PostgreSQL： 避免重复插入的SQL语句]]></title> 
      <link><![CDATA[http://www6.webng.com/seaboat/article.asp?id=612]]></link> 
      <category><![CDATA[DB&SQL]]></category> 
      <author><![CDATA[seaboat <null@null.com>]]></author> 
      <pubDate>Fri, 06 Jul 2007 00:07:24 -0400</pubDate> 
      <description><![CDATA[避免重复数据，可以给表格建索引，做主键，或者建表的时候给其附加制约。<br /><br />有了制约条件的表格，插入重复数据的时候，自然会报错而插入失败，有的时候，还想避免报错，这时候，下面的SQL语句就有用了：<div class="code">INSERT INTO table (a, b)<br />&nbsp;&nbsp;SELECT &#39;1&#39; AS a, &#39;2&#39; AS b <br />&nbsp;&nbsp;FROM table <br />&nbsp;&nbsp;WHERE NOT EXISTS (<br />&nbsp;&nbsp;&nbsp;&nbsp;SELECT 1 FROM table WHERE a=&#39;1&#39; AND b=&#39;2&#39;<br />&nbsp;&nbsp;)</div>]]></description>
      <wfw:commentRss><![CDATA[http://www6.webng.com/seaboat/feed.asp?q=comment&id=612]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[PostgreSQL之rule设定查询方法]]></title> 
      <link><![CDATA[http://www6.webng.com/seaboat/article.asp?id=604]]></link> 
      <category><![CDATA[DB&SQL]]></category> 
      <author><![CDATA[seaboat <null@null.com>]]></author> 
      <pubDate>Fri, 22 Jun 2007 03:51:27 -0400</pubDate> 
      <description><![CDATA[在PostgreSQL的提示符下，用&quot;<span style="color:blue">\d</span>&quot;或是&quot;<span style="color:blue">\d&lt;头字母&gt;</span>&quot;命令可以很方便的查询各种对象的定义。今天发现有一个叫<span style="color:red">rule</span>的东西不能用这个命令，在网上搜索了一下才在PostgreSQL的官方网站上找到方法。原来，各种<span style="color:red">rule</span>的定义保存在<span style="color:darkred">pg_rules</span>之中，通过查询这个表格即可得到<span style="color:red">rule</span>的定义，如：<br /><br /><span style="color:blue">select * from pg_rules;<br /><br />select * from pg_rules where rulename=&#39;RULE_NAME&#39;;  <br /><br />select * from pg_rules where tablename=&#39;TABLE_NAME&#39;; </span> <br />]]></description>
      <wfw:commentRss><![CDATA[http://www6.webng.com/seaboat/feed.asp?q=comment&id=604]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[几条常用的Mysql命令]]></title> 
      <link><![CDATA[http://www6.webng.com/seaboat/article.asp?id=599]]></link> 
      <category><![CDATA[DB&SQL]]></category> 
      <author><![CDATA[seaboat <null@null.com>]]></author> 
      <pubDate>Wed, 13 Jun 2007 23:08:15 -0400</pubDate> 
      <description><![CDATA[<b>建库</b><br /><span style="color:chocolate">mysql&gt;create database `mydb` default character set utf8 collate utf8_general_ci;<br />mysql&gt;grant all privileges on mydb.* to mydb_user@&#39;localhost&#39; identified by &quot;mydb_pass&quot;;<br />mysql&gt;grant all privileges on mydb.* to mydb_user@&#39;%&#39; identified by &quot;mydb_pass&quot;;<br /></span><br /><b>设置密码</b><br /><span style="color:chocolate">mysql&gt;set password for &#39;root&#39;@&#39;localhost&#39; = old_password(&#39;root_pass&#39;);<br />mysql&gt;set </span>]]></description>
      <wfw:commentRss><![CDATA[http://www6.webng.com/seaboat/feed.asp?q=comment&id=599]]></wfw:commentRss>
    </item>
      
  </channel>
</rss>
