Fork the pg_repack extension
This commit is contained in:
@ -8,20 +8,20 @@
|
||||
<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>
|
||||
<title>pg_repack: 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>
|
||||
<h1>pg_repack ホームページへようこそ</h1>
|
||||
<hr />
|
||||
</center>
|
||||
|
||||
<p>このプロジェクトでは <strong>pg_reorg</strong> と <strong>pg_batch</strong> の2つのツールを頒布しています。</p>
|
||||
<p>このプロジェクトでは <strong>pg_repack</strong> と <strong>pg_batch</strong> の2つのツールを頒布しています。</p>
|
||||
|
||||
<p>
|
||||
<strong>pg_reorg</strong> は PostgreSQL のテーブルを再編成するシェルコマンドです。
|
||||
<strong>pg_repack</strong> は PostgreSQL のテーブルを再編成するシェルコマンドです。
|
||||
共有ロックや排他ロックを取得しないため、再編成中であっても行の参照や更新を行うことができます。
|
||||
このモジュールは CLUSTER や VACUUM FULL コマンドのより良い代替になります。
|
||||
</p>
|
||||
@ -32,7 +32,7 @@
|
||||
VACUUM を行うスクリプトが付属しており、"より良い vacuumdb" として利用できます。
|
||||
</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>
|
||||
<p>この pg_repack プロジェクトは <a href="http://www.postgresql.org">PostgreSQL</a> コミュニティによる <a href="http://pgfoundry.org">pgFoundry</a> の中の<a href="http://pgfoundry.org/projects/repack">プロジェクト</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>
|
||||
@ -46,15 +46,15 @@ VACUUM を行うスクリプトが付属しており、"より良い vacuumdb"
|
||||
<h2>ドキュメント</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="pg_reorg-ja.html">pg_reorg 1.1 ドキュメント</a></li>
|
||||
<li><a href="pg_repack-ja.html">pg_repack 1.1 ドキュメント</a></li>
|
||||
<li><a href="pg_batch-ja.html">pg_batch 1.2 ドキュメント</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>実行時間</h2>
|
||||
<p>
|
||||
pg_reorg とclusterdb の比較に示します。
|
||||
断片化のないソートされた状態 (not fragmented) では clusterdb のほうが高速ですが、完全に断片化した状態 (fully fragmented) では pg_reorg が大幅に高速です。
|
||||
一般的に、再編成は断片化が進行した状態で実施されることを考えると、pg_reorg は clusterdb よりも実行時間が短いと言えます。
|
||||
pg_repack とclusterdb の比較に示します。
|
||||
断片化のないソートされた状態 (not fragmented) では clusterdb のほうが高速ですが、完全に断片化した状態 (fully fragmented) では pg_repack が大幅に高速です。
|
||||
一般的に、再編成は断片化が進行した状態で実施されることを考えると、pg_repack は clusterdb よりも実行時間が短いと言えます。
|
||||
</p>
|
||||
|
||||
<center>
|
||||
@ -92,7 +92,7 @@ pg_reorg とclusterdb の比較に示します。
|
||||
<td>PostgreSQL 8.3.3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pg_reorg</td>
|
||||
<td>pg_repack</td>
|
||||
<td>1.0.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -8,22 +8,22 @@
|
||||
<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>
|
||||
<title>pg_repack: 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>Welcome to the pg_reorg Project Home Page</h1>
|
||||
<h1>Welcome to the pg_repack Project Home Page</h1>
|
||||
<hr />
|
||||
</center>
|
||||
|
||||
<p>
|
||||
This project provides two tools for PostgreSQL; <strong>pg_reorg</strong> and <strong>pg_batch</strong>.
|
||||
This project provides two tools for PostgreSQL; <strong>pg_repack</strong> and <strong>pg_batch</strong>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>pg_reorg</strong> can re-organize tables on a postgres database without any locks so that you can retrieve or update rows in tables being reorganized.
|
||||
<strong>pg_repack</strong> can re-organize tables on a postgres database without any locks so that you can retrieve or update rows in tables being reorganized.
|
||||
The module is developed to be a better alternative of CLUSTER and VACUUM FULL.
|
||||
</p>
|
||||
|
||||
@ -34,10 +34,10 @@ It can be used as "a better vacuumdb" with the attached script to run VACUUM.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The pg_reorg project is a <a href="http://www.postgresql.org">PostgreSQL</a> Community project that is a part of the <a href="http://pgfoundry.org">pgFoundry</a>.
|
||||
The pg_repack project is a <a href="http://www.postgresql.org">PostgreSQL</a> Community project that is a part of the <a href="http://pgfoundry.org">pgFoundry</a>.
|
||||
</p>
|
||||
<p>
|
||||
The pgFoundry page for the project is at <a href="http://pgfoundry.org/projects/reorg">http://pgfoundry.org/projects/reorg</a>,
|
||||
The pgFoundry page for the project is at <a href="http://pgfoundry.org/projects/repack">http://pgfoundry.org/projects/repack</a>,
|
||||
where you can find <a href="http://pgfoundry.org/frs/?group_id=1000411">downloads</a>, documentation, bug reports, mailing lists, and a whole lot more.
|
||||
</p>
|
||||
<div>
|
||||
@ -48,15 +48,15 @@ where you can find <a href="http://pgfoundry.org/frs/?group_id=1000411">download
|
||||
<h2>Documentation</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="pg_reorg.html">pg_reorg 1.1 documentation</a></li>
|
||||
<li><a href="pg_repack.html">pg_repack 1.1 documentation</a></li>
|
||||
<li><a href="pg_batch.html">pg_batch 1.2 documentation</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Execution time</h2>
|
||||
<p>
|
||||
Here is a comparison between pg_reorg and clusterdb.
|
||||
Clusterdb is faster on not fragmented conditions, but pg_reorg is faster on fully fragmented conditions.
|
||||
Since reorganization is needed only if tables are fragmented, pg_reorg should be faster than clusterdb.
|
||||
Here is a comparison between pg_repack and clusterdb.
|
||||
Clusterdb is faster on not fragmented conditions, but pg_repack is faster on fully fragmented conditions.
|
||||
Since reorganization is needed only if tables are fragmented, pg_repack should be faster than clusterdb.
|
||||
</p>
|
||||
|
||||
<center>
|
||||
@ -94,7 +94,7 @@ Since reorganization is needed only if tables are fragmented, pg_reorg should be
|
||||
<td>PostgreSQL 8.3.3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pg_reorg</td>
|
||||
<td>pg_repack</td>
|
||||
<td>1.0.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>pg_reorg</title>
|
||||
<link rel="home" title="pg_reorg " href="index.html">
|
||||
<title>pg_repack</title>
|
||||
<link rel="home" title="pg_repack " href="index.html">
|
||||
<link rel="stylesheet" TYPE="text/css" href="style.css">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1 id="pg_reorg">pg_reorg 1.1.7</h1>
|
||||
<h1 id="pg_repack">pg_repack 1.1.7</h1>
|
||||
<div class="navigation">
|
||||
<a href="index-ja.html">Top</a> >
|
||||
<a href="pg_reorg-ja.html">pg_reorg</a>
|
||||
<a href="pg_repack-ja.html">pg_repack</a>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
@ -33,11 +33,11 @@
|
||||
</div>
|
||||
|
||||
<h2 id="name">名前</h2>
|
||||
pg_reorg -- PostgreSQLデータベース内のテーブルに対して、参照/更新処理をブロックせずに再編成を行います。
|
||||
pg_repack -- PostgreSQLデータベース内のテーブルに対して、参照/更新処理をブロックせずに再編成を行います。
|
||||
|
||||
<h2 id="synopsis">概要</h2>
|
||||
<p>
|
||||
pg_reorg [OPTIONS]
|
||||
pg_repack [OPTIONS]
|
||||
</p>
|
||||
|
||||
<p>オプション OPTIONS には以下を指定できます。
|
||||
@ -68,7 +68,7 @@ pg_reorg [OPTIONS]
|
||||
</ul>
|
||||
|
||||
<h2 id="description">説明</h2>
|
||||
<p>pg_reorg は、PostgreSQLデータベース内のテーブルを再編成(行の並び替え)するユーティリティです。
|
||||
<p>pg_repack は、PostgreSQLデータベース内のテーブルを再編成(行の並び替え)するユーティリティです。
|
||||
<a href="http://www.postgresql.jp/document/current/html/app-clusterdb.html">clusterdb</a> と異なり、参照/更新処理をブロックしません。
|
||||
再編成の方式として、以下のいずれか1つを選択できます。</p>
|
||||
<ul>
|
||||
@ -84,16 +84,16 @@ pg_reorg [OPTIONS]
|
||||
|
||||
<h2 id="examples">例</h2>
|
||||
<p>testというデータベースをオンライン CLUSTER するには、下記のコマンドを実行します。</p>
|
||||
<PRE><SAMP>$ </SAMP><KBD>pg_reorg test</KBD></PRE>
|
||||
<PRE><SAMP>$ </SAMP><KBD>pg_repack test</KBD></PRE>
|
||||
<p>testという名前のデータベースのfooという1つのテーブルに対してオンライン VACUUM FULL を行うには、下記のコマンドを実行します。</p>
|
||||
<PRE><SAMP>$ </SAMP><KBD>pg_reorg --no-order --table foo -d test</KBD></PRE><p>
|
||||
<PRE><SAMP>$ </SAMP><KBD>pg_repack --no-order --table foo -d test</KBD></PRE><p>
|
||||
</p>
|
||||
|
||||
<h2 id="options">オプション</h2>
|
||||
<p>pg_reorg では、下記のコマンドライン引数を指定できます。</p>
|
||||
<p>pg_repack では、下記のコマンドライン引数を指定できます。</p>
|
||||
|
||||
<h3>固有オプション</h3>
|
||||
<p>pg_reorg を実行する対象と並び替えの基準を指定するパラメータです。
|
||||
<p>pg_repack を実行する対象と並び替えの基準を指定するパラメータです。
|
||||
何も指定されていない場合は、cluster index順にオンライン CLUSTER を行います。
|
||||
この2つを同時に指定することはできません。
|
||||
</p>
|
||||
@ -210,19 +210,19 @@ DEBUG, INFO, NOTICE, WARNING, ERROR, LOG, FATAL, PANIC から選択します。
|
||||
</p>
|
||||
|
||||
<h2 id="diagnostics">トラブルシューティング</h2>
|
||||
<p>pg_reorg の実行に失敗した場合にエラーが表示されます。
|
||||
<p>pg_repack の実行に失敗した場合にエラーが表示されます。
|
||||
想像されるエラー原因と対処を示します。</p>
|
||||
<p>致命的なエラーで終了した場合、手動によるクリーンアップを行う必要があります。
|
||||
クリーンアップは、エラーが発生したデータベースに対して、$PGHOME/share/contrib/uninstall_pg_reorg.sql を実行し、その後、$PGHOME/share/contrib/pg_reorg.sql を実行します。</p>
|
||||
クリーンアップは、エラーが発生したデータベースに対して、$PGHOME/share/contrib/uninstall_pg_repack.sql を実行し、その後、$PGHOME/share/contrib/pg_repack.sql を実行します。</p>
|
||||
|
||||
<dl>
|
||||
<dt>pg_reorg : reorg database "template1" ... skipped</dt>
|
||||
<dd>--allオプションを指定した際に、pg_reorg がインストールされていないデータベースに対して表示されます。</dd>
|
||||
<dd>pg_reorg スキーマのインストールを行ってください。</dd>
|
||||
<dt>pg_repack : repack database "template1" ... skipped</dt>
|
||||
<dd>--allオプションを指定した際に、pg_repack がインストールされていないデータベースに対して表示されます。</dd>
|
||||
<dd>pg_repack スキーマのインストールを行ってください。</dd>
|
||||
|
||||
<dt>ERROR: pg_reorg is not installed</dt>
|
||||
<dd>--dbnameで指定したデータベースにpg_reorg がインストールされていません。</dd>
|
||||
<dd>pg_reorg のインストールを行ってください。</dd>
|
||||
<dt>ERROR: pg_repack is not installed</dt>
|
||||
<dd>--dbnameで指定したデータベースにpg_repack がインストールされていません。</dd>
|
||||
<dd>pg_repack のインストールを行ってください。</dd>
|
||||
|
||||
<dt>ERROR: relation "table" has no primary key</dt>
|
||||
<dd>指定したテーブルにPRIMARY KEYが存在していません。</dd>
|
||||
@ -232,45 +232,45 @@ DEBUG, INFO, NOTICE, WARNING, ERROR, LOG, FATAL, PANIC から選択します。
|
||||
<dd>指定したテーブルに CLUSTER KEYが存在していません。</dd>
|
||||
<dd>対象のテーブルに CLUSTER KEYの作成を行ってください。(ALTER TABLE CLUSTER)</dd>
|
||||
|
||||
<dt>pg_reorg : query failed: ERROR: column "col" does not exist</dt>
|
||||
<dt>pg_repack : query failed: ERROR: column "col" does not exist</dt>
|
||||
<dd>--order-by で指定したカラムが対象のテーブルに存在していません。</dd>
|
||||
<dd>対象のテーブルに存在するカラムを指定してください。</dd>
|
||||
|
||||
<dt>ERROR: permission denied for schema reorg</dt>
|
||||
<dt>ERROR: permission denied for schema repack</dt>
|
||||
<dd>操作を行おうとした対象に権限がありません。</dd>
|
||||
<dd>スーパーユーザで操作を行ってください。</dd>
|
||||
|
||||
<dt>pg_reorg : query failed: ERROR: trigger "z_reorg_trigger" for relation "tbl" already exists</dt>
|
||||
<dd>操作を行おうとした対象にpg_reorg が処理のために作成するトリガと同名のものが存在しています。</dd>
|
||||
<dt>pg_repack : query failed: ERROR: trigger "z_repack_trigger" for relation "tbl" already exists</dt>
|
||||
<dd>操作を行おうとした対象にpg_repack が処理のために作成するトリガと同名のものが存在しています。</dd>
|
||||
<dd>トリガの改名か削除を行ってください。</dd>
|
||||
|
||||
<dt>pg_reorg : trigger conflicted for tbl</dt>
|
||||
<dd>操作を行おうとした対象にpg_reorg が処理のために作成するトリガより後に実行されるトリガが存在しています。</dd>
|
||||
<dt>pg_repack : trigger conflicted for tbl</dt>
|
||||
<dd>操作を行おうとした対象にpg_repack が処理のために作成するトリガより後に実行されるトリガが存在しています。</dd>
|
||||
<dd>トリガの改名か削除を行ってください。</dd>
|
||||
</dl>
|
||||
|
||||
<h2 id="restrictions">使用上の注意と制約</h2>
|
||||
<p>pg_reorg を使用する際には、以下の制約があります。以下の制約に関する操作を行った場合の動作は保証されません。注意してください。</p>
|
||||
<p>pg_repack を使用する際には、以下の制約があります。以下の制約に関する操作を行った場合の動作は保証されません。注意してください。</p>
|
||||
|
||||
<h3>一時テーブルへの操作</h3>
|
||||
<p>pg_reorg では、一時テーブルは操作の対象外です。</p>
|
||||
<p>pg_repack では、一時テーブルは操作の対象外です。</p>
|
||||
|
||||
<h3>GiSTインデックスの使用</h3>
|
||||
<p>インデックス種別がGiSTとなっているインデックスがクラスタインデックスとなっている
|
||||
テーブルはpg_reorg コマンドを使用して操作を行うことはできません。
|
||||
テーブルはpg_repack コマンドを使用して操作を行うことはできません。
|
||||
これは、GiSTインデックスのソート順序は一意ではないため、ORDER BYによる
|
||||
ソートが行えないためです。</p>
|
||||
|
||||
<h3>DDLコマンドの発行</h3>
|
||||
<p>
|
||||
pg_reorg の実行中には、VACUUM と ANALYZE <STRONG>以外</STRONG> のDDL操作は行わないでください。
|
||||
多くの場合、pg_reorg は失敗しロールバックされます。
|
||||
pg_repack の実行中には、VACUUM と ANALYZE <STRONG>以外</STRONG> のDDL操作は行わないでください。
|
||||
多くの場合、pg_repack は失敗しロールバックされます。
|
||||
しかし、以下の操作ではデータが破損するため、非常に危険です。
|
||||
</p>
|
||||
|
||||
<dl>
|
||||
<dt>TRUNCATE</dt>
|
||||
<dd>削除した行が pg_reorg 実行後には復元しています。操作結果が消失します。</dd>
|
||||
<dd>削除した行が pg_repack 実行後には復元しています。操作結果が消失します。</dd>
|
||||
|
||||
<dt>CREATE INDEX</dt>
|
||||
<dd>スワップされない索引が残る可能性があります。データの不整合が生じます。</dd>
|
||||
@ -282,11 +282,11 @@ pg_reorg の実行中には、VACUUM と ANALYZE <STRONG>以外</STRONG> のDDL
|
||||
<dd>実行するとスキーマで定義された型と実際の格納状態に齟齬をきたします。データの不整合が生じます。</dd>
|
||||
|
||||
<dt>ALTER TABLE ... SET TABLESPACE</dt>
|
||||
<dd>pg_reorg 実行後にrelfilenodeとの不整合が起こるため、対象のテーブルに対する参照/更新操作時にエラーが発生します。</dd>
|
||||
<dd>pg_repack 実行後にrelfilenodeとの不整合が起こるため、対象のテーブルに対する参照/更新操作時にエラーが発生します。</dd>
|
||||
</dl>
|
||||
|
||||
<h2 id="details">詳細</h2>
|
||||
<p>pg_reorg は reorg スキーマに作業用テーブルを作成し、そこでデータの並び替えを行います。
|
||||
<p>pg_repack は repack スキーマに作業用テーブルを作成し、そこでデータの並び替えを行います。
|
||||
最後にシステムカタログを直接書き換えることで、元のテーブルと名前を交換しています。</p>
|
||||
|
||||
<h2 id="install">インストール方法</h2>
|
||||
@ -294,7 +294,7 @@ pg_reorg の実行中には、VACUUM と ANALYZE <STRONG>以外</STRONG> のDDL
|
||||
UNIX や Linux では、make を実行すると自動的に pgxs を使ってビルドできます。
|
||||
前もって PostgreSQL 開発用パッケージ (postgresql-devel 等) をインストールし、pg_config にパスを通してください。
|
||||
</p>
|
||||
<pre>$ cd pg_reorg
|
||||
<pre>$ cd pg_repack
|
||||
$ make
|
||||
$ su
|
||||
$ make install</pre>
|
||||
@ -305,7 +305,7 @@ msvc フォルダ内にプロジェクトファイルがあります。
|
||||
|
||||
<p>その後、データベースに関数を登録します。</p>
|
||||
<pre>$ pg_ctl start
|
||||
$ psql -f $PGSHARE/contrib/pg_reorg.sql -d your_database</pre>
|
||||
$ psql -f $PGSHARE/contrib/pg_repack.sql -d your_database</pre>
|
||||
|
||||
<p>(注意: <code>CREATE EXTENSION</code> はまだサポートしていません。)</p>
|
||||
|
||||
@ -334,7 +334,7 @@ $ psql -f $PGSHARE/contrib/pg_reorg.sql -d your_database</pre>
|
||||
<hr>
|
||||
<div class="navigation">
|
||||
<a href="index-ja.html">Top</a> >
|
||||
<a href="pg_reorg-ja.html">pg_reorg</a>
|
||||
<a href="pg_repack-ja.html">pg_repack</a>
|
||||
</div>
|
||||
<p class="footer">
|
||||
Portions Copyright (c) 2008-2011, NIPPON TELEGRAPH AND TELEPHONE CORPORATION<br>
|
@ -1,17 +1,17 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>pg_reorg</title>
|
||||
<link rel="home" title="pg_reorg " href="index.html">
|
||||
<title>pg_repack</title>
|
||||
<link rel="home" title="pg_repack " href="index.html">
|
||||
<link rel="stylesheet" TYPE="text/css" href="style.css">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1 id="pg_reorg">pg_reorg 1.1.7</h1>
|
||||
<h1 id="pg_repack">pg_repack 1.1.7</h1>
|
||||
<div class="navigation">
|
||||
<a href="index.html">Top</a> >
|
||||
<a href="pg_reorg.html">pg_reorg</a>
|
||||
<a href="pg_repack.html">pg_repack</a>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
@ -33,11 +33,11 @@
|
||||
</div>
|
||||
|
||||
<h2 id="name">Name</h2>
|
||||
pg_reorg -- Reorganize tables in PostgreSQL databases without any locks.
|
||||
pg_repack -- Reorganize tables in PostgreSQL databases without any locks.
|
||||
|
||||
<h2 id="synopsis">Synopsis</h2>
|
||||
<p>
|
||||
pg_reorg [OPTIONS]
|
||||
pg_repack [OPTIONS]
|
||||
</p>
|
||||
|
||||
<p>The following options can be specified in OPTIONS.
|
||||
@ -68,7 +68,7 @@ See also "<a href="#options">Options</a>" for details.</p>
|
||||
</ul>
|
||||
|
||||
<h2 id="description">Description</h2>
|
||||
<p>pg_reorg is an utility program to reorganize tables in PostgreSQL databases.
|
||||
<p>pg_repack is an utility program to reorganize tables in PostgreSQL databases.
|
||||
Unlike <a href="http://developer.postgresql.org/pgdocs/postgres/app-clusterdb.html">clusterdb</a>, it doesn't block any selections and updates during reorganization.
|
||||
You can choose one of the following methods to reorganize.</p>
|
||||
<ul>
|
||||
@ -84,17 +84,17 @@ You can choose one of the following methods to reorganize.</p>
|
||||
|
||||
<h2 id="examples">Examples</h2>
|
||||
<p>Execute the following command to perform an online CLUSTER of all tables in test database.</p>
|
||||
<PRE><SAMP>$ </SAMP><KBD>pg_reorg test</KBD></PRE>
|
||||
<PRE><SAMP>$ </SAMP><KBD>pg_repack test</KBD></PRE>
|
||||
<p>Execute the following command to perform an online VACUUM FULL to foo table in test database.</p>
|
||||
<PRE><SAMP>$ </SAMP><KBD>pg_reorg --no-order --table foo -d test</KBD></PRE><p>
|
||||
<PRE><SAMP>$ </SAMP><KBD>pg_repack --no-order --table foo -d test</KBD></PRE><p>
|
||||
</p>
|
||||
|
||||
<h2 id="options">Options</h2>
|
||||
<p>pg_reorg has the following command line options:</p>
|
||||
<p>pg_repack has the following command line options:</p>
|
||||
|
||||
<h3>Reorg Options</h3>
|
||||
<p>Options to order rows.
|
||||
If not specified, pg_reorg performs an online CLUSTER using cluster indexes.
|
||||
If not specified, pg_repack performs an online CLUSTER using cluster indexes.
|
||||
Only one option can be specified.
|
||||
|
||||
You may also specify target tables or databases.
|
||||
@ -119,10 +119,10 @@ You may also specify target tables or databases.
|
||||
--wait-timeout=seconds
|
||||
</dt>
|
||||
<dd>
|
||||
pg_reorg needs to take an exclusive lock at the end of the reorganization.
|
||||
pg_repack needs to take an exclusive lock at the end of the reorganization.
|
||||
This setting controls how long it wait for acquiring the lock in seconds.
|
||||
If the lock cannot be taken even after the duration, pg_reorg forces to cancel conflicted queries.
|
||||
Also, if the server version is 8.4 or newer, pg_reorg forces to disconnect conflicted backends after twice time passed.
|
||||
If the lock cannot be taken even after the duration, pg_repack forces to cancel conflicted queries.
|
||||
Also, if the server version is 8.4 or newer, pg_repack forces to disconnect conflicted backends after twice time passed.
|
||||
The default is 60 seconds.
|
||||
</dd>
|
||||
|
||||
@ -171,7 +171,7 @@ This option can be useful in batch jobs and scripts where no user is present to
|
||||
<dt>-W<br>
|
||||
--password</dt>
|
||||
<dd>Force the program to prompt for a password before connecting to a database.</dd>
|
||||
<dd>This option is never essential, since the program will automatically prompt for a password if the server demands password authentication. However, pg_reorg will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt. </dd>
|
||||
<dd>This option is never essential, since the program will automatically prompt for a password if the server demands password authentication. However, pg_repack will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt. </dd>
|
||||
</dl>
|
||||
|
||||
<h3>Generic Options</h3>
|
||||
@ -200,19 +200,19 @@ The default is INFO.</dd>
|
||||
<p>This utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see <a href="http://developer.postgresql.org/pgdocs/postgres/libpq-envars.html">Environment Variables</a>).</p>
|
||||
|
||||
<h2 id="diagnostics">Diagnostics</h2>
|
||||
<p>Error messages are reported when pg_reorg fails.
|
||||
<p>Error messages are reported when pg_repack fails.
|
||||
The following list shows the cause of errors.</p>
|
||||
<p>You need to cleanup by hand after fatal errors.
|
||||
To cleanup, execute $PGHOME/share/contrib/uninstall_pg_reorg.sql to the database where the error occured and then execute $PGHOME/share/contrib/pg_reorg.sql. (Do uninstall and reinstall.)</p>
|
||||
To cleanup, execute $PGHOME/share/contrib/uninstall_pg_repack.sql to the database where the error occured and then execute $PGHOME/share/contrib/pg_repack.sql. (Do uninstall and reinstall.)</p>
|
||||
|
||||
<dl>
|
||||
<dt>pg_reorg : reorg database "template1" ... skipped</dt>
|
||||
<dd>pg_reorg is not installed in the database when --all option is specified.</dd>
|
||||
<dd>Do register pg_reorg to the database.</dd>
|
||||
<dt>pg_repack : repack database "template1" ... skipped</dt>
|
||||
<dd>pg_repack is not installed in the database when --all option is specified.</dd>
|
||||
<dd>Do register pg_repack to the database.</dd>
|
||||
|
||||
<dt>ERROR: pg_reorg is not installed</dt>
|
||||
<dd>pg_reorg is not installed in the database specified by --dbname.</dd>
|
||||
<dd>Do register pg_reorg to the database.</dd>
|
||||
<dt>ERROR: pg_repack is not installed</dt>
|
||||
<dd>pg_repack is not installed in the database specified by --dbname.</dd>
|
||||
<dd>Do register pg_repack to the database.</dd>
|
||||
|
||||
<dt>ERROR: relation "table" has no primary key</dt>
|
||||
<dd>The target table doesn't have PRIMARY KEY.</dd>
|
||||
@ -222,40 +222,40 @@ To cleanup, execute $PGHOME/share/contrib/uninstall_pg_reorg.sql to the database
|
||||
<dd>The target table doesn't have CLUSTER KEY.</dd>
|
||||
<dd>Define CLUSTER KEY to the table. (ALTER TABLE CLUSTER)</dd>
|
||||
|
||||
<dt>pg_reorg : query failed: ERROR: column "col" does not exist</dt>
|
||||
<dt>pg_repack : query failed: ERROR: column "col" does not exist</dt>
|
||||
<dd>The target table doesn't have columns specified by --order-by option.</dd>
|
||||
<dd>Specify existing columns.</dd>
|
||||
|
||||
<dt>ERROR: permission denied for schema reorg</dt>
|
||||
<dt>ERROR: permission denied for schema repack</dt>
|
||||
<dd>Permission error.</dd>
|
||||
<dd>pg_reorg must be executed by superusers.</dd>
|
||||
<dd>pg_repack must be executed by superusers.</dd>
|
||||
|
||||
<dt>pg_reorg : query failed: ERROR: trigger "z_reorg_trigger" for relation "tbl" already exists</dt>
|
||||
<dd>The target table already has a trigger named "z_reorg_trigger".</dd>
|
||||
<dt>pg_repack : query failed: ERROR: trigger "z_repack_trigger" for relation "tbl" already exists</dt>
|
||||
<dd>The target table already has a trigger named "z_repack_trigger".</dd>
|
||||
<dd>Delete or rename the trigger.</dd>
|
||||
|
||||
<dt>pg_reorg : trigger conflicted for tbl</dt>
|
||||
<dd>The target table already has a trigger which follows by "z_reorg_trigger" in alphabetical order.</dd>
|
||||
<dt>pg_repack : trigger conflicted for tbl</dt>
|
||||
<dd>The target table already has a trigger which follows by "z_repack_trigger" in alphabetical order.</dd>
|
||||
<dd>Delete or rename the trigger.</dd>
|
||||
</dl>
|
||||
|
||||
<h2 id="restrictions">Restrictions</h2>
|
||||
<p>pg_reorg has the following restrictions.
|
||||
<p>pg_repack has the following restrictions.
|
||||
Be careful to avoid data corruptions.</p>
|
||||
|
||||
<h3>Temp tables</h3>
|
||||
<p>pg_reorg cannot reorganize temp tables.</p>
|
||||
<p>pg_repack cannot reorganize temp tables.</p>
|
||||
|
||||
<h3>GiST indexes</h3>
|
||||
<p>pg_reorg cannot reorganize tables using GiST indexes.</p>
|
||||
<p>pg_repack cannot reorganize tables using GiST indexes.</p>
|
||||
|
||||
<h3>DDL commands</h3>
|
||||
<p>You cannot do DDL commands <strong>except</strong> VACUUM and ANALYZE during pg_reorg.
|
||||
In many cases pg_reorg will fail and rollback collectly, but there are some cases which may result in data-corruption .</p>
|
||||
<p>You cannot do DDL commands <strong>except</strong> VACUUM and ANALYZE during pg_repack.
|
||||
In many cases pg_repack will fail and rollback collectly, but there are some cases which may result in data-corruption .</p>
|
||||
|
||||
<dl>
|
||||
<dt>TRUNCATE</dt>
|
||||
<dd>TRUNCATE is lost. Deleted rows still exist after pg_reorg.</dd>
|
||||
<dd>TRUNCATE is lost. Deleted rows still exist after pg_repack.</dd>
|
||||
|
||||
<dt>CREATE INDEX</dt>
|
||||
<dd>It causes index corruptions.</dd>
|
||||
@ -271,17 +271,17 @@ In many cases pg_reorg will fail and rollback collectly, but there are some case
|
||||
</dl>
|
||||
|
||||
<h2 id="details">Details</h2>
|
||||
<p>pg_reorg creates a work table in the reorg schema and sorts the rows in this table.
|
||||
<p>pg_repack creates a work table in the repack schema and sorts the rows in this table.
|
||||
Then, it updates the system catalogs directly to swap the work table and the original one.</p>
|
||||
|
||||
<h2 id="install">Installations</h2>
|
||||
<p>
|
||||
pg_reorg can be built with "make" on UNIX or Linux.
|
||||
pg_repack can be built with "make" on UNIX or Linux.
|
||||
pgxs build framework is used automatically.
|
||||
Before building, you might need to install postgres packages for developer (postgresql-devel, etc.)
|
||||
and add <code>pg_config</code> to your $PATH.
|
||||
</p>
|
||||
<pre>$ cd pg_reorg
|
||||
<pre>$ cd pg_repack
|
||||
$ make
|
||||
$ su
|
||||
$ make install</pre>
|
||||
@ -292,7 +292,7 @@ There are project files in the msvc folder.
|
||||
|
||||
<p>Start PostgreSQL and execute the script to register functions to your database.</p>
|
||||
<pre>$ pg_ctl start
|
||||
$ psql -f $PGSHARE/contrib/pg_reorg.sql -d your_database</pre>
|
||||
$ psql -f $PGSHARE/contrib/pg_repack.sql -d your_database</pre>
|
||||
|
||||
<p>(NOTE: <code>CREATE EXTENSION</code> is not supported yet.)</p>
|
||||
|
||||
@ -322,7 +322,7 @@ required.</dd>
|
||||
<hr>
|
||||
<div class="navigation">
|
||||
<a href="index.html">Top</a> >
|
||||
<a href="pg_reorg.html">pg_reorg</a>
|
||||
<a href="pg_repack.html">pg_repack</a>
|
||||
</div>
|
||||
|
||||
<div>
|
Reference in New Issue
Block a user