| 
									
										
										
										
											2009-04-16 06:01:01 +00:00
										 |  |  |  | <?xml version="1.0" encoding="utf-8"?> | 
					
						
							|  |  |  |  | <!DOCTYPE html | 
					
						
							|  |  |  |  | 	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | 
					
						
							|  |  |  |  | 	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> | 
					
						
							|  |  |  |  | 	<head> | 
					
						
							|  |  |  |  | 	<link rel="icon" type="image/png" href="http://pgfoundry.org/images/elephant-icon.png" /> | 
					
						
							|  |  |  |  | 	<link rel="stylesheet" type="text/css" href="style.css" /> | 
					
						
							|  |  |  |  | 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | 
					
						
							|  |  |  |  | 	<title>pg_reorg: Project Home Page</title> | 
					
						
							|  |  |  |  | </head> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <body> | 
					
						
							|  |  |  |  | <center><img style="border: none; margin-left: auto; margin-right: auto; " src="http://pgfoundry.org/images/elephantSmall.png" height="75" width="75" /> | 
					
						
							|  |  |  |  | <hr /> | 
					
						
							|  |  |  |  | <h1>pg_reorg ホームページへようこそ</h1> | 
					
						
							|  |  |  |  | <hr /> | 
					
						
							|  |  |  |  | </center> | 
					
						
							|  |  |  |  | <p> | 
					
						
							|  |  |  |  | pg_reorg は PostgreSQL のテーブルを再編成するシェルコマンドです。 | 
					
						
							|  |  |  |  | 共有ロックや排他ロックを取得しないため、再編成中であっても行の参照や更新を行うことができます。 | 
					
						
							|  |  |  |  | このモジュールは CLUSTER や VACUUM FULL コマンドのより良い代替になります。 | 
					
						
							|  |  |  |  | </p> | 
					
						
							|  |  |  |  | <p>この pg_reorg プロジェクトは <a href="http://www.postgresql.org">PostgreSQL</a> コミュニティによる <a href="http://pgfoundry.org">pgFoundry</a> の中の<a href="http://pgfoundry.org/projects/reorg">プロジェクト</a>です。</p> | 
					
						
							|  |  |  |  | <ul> | 
					
						
							|  |  |  |  | 	<li><a href="http://pgfoundry.org/frs/?group_id=1000411">ダウンロード</a> : ソースコードのほか、Windows 用バイナリもダウンロードできます。</li> | 
					
						
							|  |  |  |  | 	<li><a href="http://pgfoundry.org/tracker/?group_id=1000411">バグレポート</li></li> | 
					
						
							|  |  |  |  | 	<li><a href="http://pgfoundry.org/mail/?group_id=1000411">メーリングリスト</a> への参加</li> | 
					
						
							|  |  |  |  | </ul> | 
					
						
							|  |  |  |  | <div> | 
					
						
							|  |  |  |  | <a href="index.html">Here is an English page.</a> | 
					
						
							|  |  |  |  | </div> | 
					
						
							|  |  |  |  | <hr /> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <h2>ドキュメント</h2> | 
					
						
							|  |  |  |  | <p> | 
					
						
							|  |  |  |  | <a href="pg_reorg-ja.html">ドキュメントはこちら</a>。 | 
					
						
							|  |  |  |  | </p> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <h2>実行時間</h2> | 
					
						
							|  |  |  |  | <p> | 
					
						
							|  |  |  |  | pg_reorg とclusterdb の比較に示します。 | 
					
						
							|  |  |  |  | 断片化のないソートされた状態 (not fragmented) では clusterdb のほうが高速ですが、完全に断片化した状態 (fully fragmented) では pg_reorg が大幅に高速です。 | 
					
						
							|  |  |  |  | 一般的に、再編成は断片化が進行した状態で実施されることを考えると、pg_reorg は clusterdb よりも実行時間が短いと言えます。 | 
					
						
							|  |  |  |  | </p> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <center> | 
					
						
							|  |  |  |  | <div style="margin: 2em"> | 
					
						
							|  |  |  |  | <img src="result.png" /> | 
					
						
							|  |  |  |  | </div> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <table border="1"> | 
					
						
							|  |  |  |  | <caption>測定環境</caption> | 
					
						
							|  |  |  |  | <tr> | 
					
						
							|  |  |  |  | 	<th>大項目</th> | 
					
						
							|  |  |  |  | 	<th>小項目</th> | 
					
						
							|  |  |  |  | 	<th>環境</th> | 
					
						
							|  |  |  |  | </tr> | 
					
						
							|  |  |  |  | <tr> | 
					
						
							|  |  |  |  | 	<td rowspan="3">ハードウェア</td> | 
					
						
							|  |  |  |  | 	<td>CPU</td> | 
					
						
							|  |  |  |  | 	<td>2 × Xeon 5160 3.00GHz (Dual core)</td> | 
					
						
							|  |  |  |  | </tr> | 
					
						
							|  |  |  |  | <tr> | 
					
						
							|  |  |  |  | 	<td>メモリ</td> | 
					
						
							|  |  |  |  | 	<td>2GB</td> | 
					
						
							|  |  |  |  | </tr> | 
					
						
							|  |  |  |  | <tr> | 
					
						
							|  |  |  |  | 	<td>ストレージ</td> | 
					
						
							|  |  |  |  | 	<td>Ultra320 SCSI, 15000rpm (220GB)</td> | 
					
						
							|  |  |  |  | </tr> | 
					
						
							|  |  |  |  | <tr> | 
					
						
							|  |  |  |  | 	<td rowspan="4">ソフトウェア</td> | 
					
						
							|  |  |  |  | 	<td>OS</td> | 
					
						
							|  |  |  |  | 	<td>RHEL 5.2 (64bit) 2.6.18-92.el5</td> | 
					
						
							|  |  |  |  | </tr> | 
					
						
							|  |  |  |  | <tr> | 
					
						
							|  |  |  |  | 	<td>DB</td> | 
					
						
							|  |  |  |  | 	<td>PostgreSQL 8.3.3</td> | 
					
						
							|  |  |  |  | </tr> | 
					
						
							|  |  |  |  | <tr> | 
					
						
							|  |  |  |  | 	<td>pg_reorg</td> | 
					
						
							|  |  |  |  | 	<td>1.0.0</td> | 
					
						
							|  |  |  |  | </tr> | 
					
						
							|  |  |  |  | <tr> | 
					
						
							|  |  |  |  | 	<td>clusterdb</td> | 
					
						
							|  |  |  |  | 	<td>clusterdb (PostgreSQL) 8.3.3</td> | 
					
						
							|  |  |  |  | </tr> | 
					
						
							|  |  |  |  | <tr> | 
					
						
							|  |  |  |  | 	<td rowspan="2">データ</td> | 
					
						
							|  |  |  |  | 	<td>スキーマ</td> | 
					
						
							|  |  |  |  | 	<td><code><pre>CREATE TABLE tbl ( | 
					
						
							|  |  |  |  |  id bigserial PRIMARY KEY, | 
					
						
							|  |  |  |  |  seqkey timestamp NOT NULL, | 
					
						
							|  |  |  |  |  rndkey timestamp NOT NULL, | 
					
						
							|  |  |  |  |  filler char(75) NOT NULL | 
					
						
							|  |  |  |  | ); | 
					
						
							|  |  |  |  | CREATE INDEX idx_seq ON tbl (seqkey); | 
					
						
							|  |  |  |  | CREATE INDEX idx_rnd ON tbl (rndkey);</pre></code></td> | 
					
						
							|  |  |  |  | </tr> | 
					
						
							|  |  |  |  | <tr> | 
					
						
							|  |  |  |  | 	<td>件数</td> | 
					
						
							|  |  |  |  | 	<td>1650万件 (約2GB)</td> | 
					
						
							|  |  |  |  | </tr> | 
					
						
							|  |  |  |  | </table> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | </center> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <hr /> | 
					
						
							|  |  |  |  | <div align="right"> | 
					
						
							|  |  |  |  | Copyright (c) 2008-2009, NIPPON TELEGRAPH AND TELEPHONE CORPORATION | 
					
						
							|  |  |  |  | </div> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <!-- PLEASE LEAVE "Powered By GForge" on your site --> | 
					
						
							|  |  |  |  | <br /> | 
					
						
							|  |  |  |  | <center> | 
					
						
							|  |  |  |  | <a href="http://gforge.org/"><img src="http://gforge.org/images/pow-gforge.png"  | 
					
						
							|  |  |  |  | alt="Powered By GForge Collaborative Development Environment" border="0" /></a> | 
					
						
							|  |  |  |  | </center> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | </body> | 
					
						
							|  |  |  |  | </html> |