[Groonga-commit] pgroonga/pgroonga.github.io at 1329fdc [master] Document pgroonga.flush

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Aug 31 12:03:17 JST 2016


Kouhei Sutou	2016-08-31 12:03:17 +0900 (Wed, 31 Aug 2016)

  New Revision: 1329fdcf4b47f779a533bcf1103ec4d6c72ee38b
  https://github.com/pgroonga/pgroonga.github.io/commit/1329fdcf4b47f779a533bcf1103ec4d6c72ee38b

  Message:
    Document pgroonga.flush

  Added files:
    _po/ja/reference/functions/pgroonga-flush.po
    ja/reference/functions/pgroonga-flush.md
    reference/functions/pgroonga-flush.md
  Modified files:
    ja/reference/functions/pgroonga-score.md
    reference/functions/pgroonga-score.md

  Added: _po/ja/reference/functions/pgroonga-flush.po (+134 -0) 100644
===================================================================
--- /dev/null
+++ _po/ja/reference/functions/pgroonga-flush.po    2016-08-31 12:03:17 +0900 (d5a4476)
@@ -0,0 +1,134 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-08-31 12:03+0900\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+msgid ""
+"---\n"
+"title: pgroonga.flush function\n"
+"---"
+msgstr ""
+"---\n"
+"title: pgroonga.flush関数\n"
+"---"
+
+msgid "# `pgroonga.flush` function"
+msgstr "# `pgroonga.flush`関数"
+
+msgid "## Summary"
+msgstr "## 概要"
+
+msgid ""
+"`pgroonga.flush` function ensuring writing changes only in memory into disk. N"
+"ormally, you don't need to this function because it's done automatically. But "
+"you may need to use this function when you want to prevent breaking PGroonga i"
+"ndexes on crash or force shutdown."
+msgstr ""
+"`pgroonga.flush`関数はメモリー上にだけある変更を確実にディスクに書き込みます。この処理は自動的に行われるので、通常、この関数を使う必要はあり"
+"ません。しかし、クラッシュ・強制終了によるPGroongaインデックスの破損を防ぎたい場合はこの関数を使う必要があるかもしれません。"
+
+msgid ""
+"Normally, users shouldn't shut down server forcibly but some users do in some "
+"cases. For example, Windows update may restart Windows server unexpectedly."
+msgstr ""
+"通常、ユーザーはサーバーを強制終了してはいけません。しかし、いくつか強制終了してしまうケースがあります。たとえば、Windowsアップデートにより意図せずに"
+"Windowsサーバーが再起動することがあるかもしれません。"
+
+msgid ""
+"If PostgreSQL with PGroonga is shut down forcibly, changes only in memory may "
+"be lost. If you call `pgroonga.flush` function before force shutdown, there ar"
+"e no changes only in memory. It means that PGroonga indexes aren't broken even"
+" if users shut down PostgreSQL with PGroonga forcibly."
+msgstr ""
+"もし、PGroongaを使っているPostgreSQLが強制終了したらメモリー上にだけある変更が失われるかもしれません。強制終了の前に`pgroonga.f"
+"lush`関数を呼べばメモリー上にだけある変更がなくなります。つまり、ユーザーがPGroongaを使っているPostgreSQLを強制終了してもPGroon"
+"gaのインデックスは壊れないということです。"
+
+msgid ""
+"If there are many changes only in memory, `pgroonga.flush` may take a long tim"
+"e. It's depend on write performance of your disk."
+msgstr ""
+"もし、メモリー上にだけある変更が多い場合、`pgroonga.flush`の実行時間が長くなるかもしれません。これは使用しているディスクの書き込み性能に依存"
+"します。"
+
+msgid "## Syntax"
+msgstr "## 構文"
+
+msgid "Here is the syntax of this function:"
+msgstr "この関数の構文は次の通りです。"
+
+msgid ""
+"```text\n"
+"bool pgroonga.flush(pgroonga_index_name)\n"
+"```"
+msgstr ""
+
+msgid ""
+"`pgroonga_index_name` is a `text` type value. It's an index name to be flushed"
+". The index should be created with `USING pgroonga`."
+msgstr ""
+"`pgroonga_index_name`は`text`型の値です。フラッシュ対象のインデックス名です。このインデックスは`USING pgroonga`付"
+"きで作成してある必要があります。"
+
+msgid ""
+"`pgroonga.flush` returns always `true`. Because if `pgroonga.flush` is failed,"
+" it raises an error instead of returning result."
+msgstr ""
+"`pgroonga.flush`は常に`true`を返します。なぜなら、もし`pgroonga.flush`が失敗したら値を返すのではなくエラーになるからで"
+"す。"
+
+msgid "## Usage"
+msgstr "## 使い方"
+
+msgid ""
+"Here are sample schema and data. In the schema, both search target data and ou"
+"tput data are index target columns:"
+msgstr "以下はサンプルのスキーマとデータです。このスキーマでは、検索対象のデータと出力対象のデータはどちらもインデックス対象のカラムです。"
+
+msgid ""
+"```sql\n"
+"CREATE TABLE terms (\n"
+"  id integer,\n"
+"  title text,\n"
+"  content text\n"
+");"
+msgstr ""
+
+msgid ""
+"CREATE INDEX pgroonga_terms_index\n"
+"          ON terms\n"
+"       USING pgroonga (title, content);\n"
+"```"
+msgstr ""
+
+msgid ""
+"You can flush `pgroonga_terms_index` related changes only in memory by the fol"
+"lowing `pgroonga.flush` call:"
+msgstr ""
+"以下のように`pgroonga.flush`を呼び出すことでメモリー上にだけある`pgroonga_terms_index`関連の変更をディスクに書き出すこ"
+"とができます。"
+
+msgid ""
+"```sql\n"
+"SELECT pgroonga.flush('pgroonga_terms_index');\n"
+"--  flush \n"
+"-- -------\n"
+"--  t\n"
+"-- (1 row)\n"
+"```"
+msgstr ""
+
+msgid "If you specify nonexistent index name, `pgroonga.flush` raises an error:"
+msgstr "存在しないインデックス名を指定すると`pgroonga.flush`はエラーになります。"
+
+msgid ""
+"```sql\n"
+"SELECT pgroonga.flush('nonexistent');\n"
+"-- ERROR:  relation \"nonexistent\" does not exist\n"
+"```"
+msgstr ""

  Added: ja/reference/functions/pgroonga-flush.md (+60 -0) 100644
===================================================================
--- /dev/null
+++ ja/reference/functions/pgroonga-flush.md    2016-08-31 12:03:17 +0900 (11a19d1)
@@ -0,0 +1,60 @@
+---
+title: pgroonga.flush関数
+---
+
+# `pgroonga.flush`関数
+
+## 概要
+
+`pgroonga.flush`関数はメモリー上にだけある変更を確実にディスクに書き込みます。この処理は自動的に行われるので、通常、この関数を使う必要はありません。しかし、クラッシュ・強制終了によるPGroongaインデックスの破損を防ぎたい場合はこの関数を使う必要があるかもしれません。
+
+通常、ユーザーはサーバーを強制終了してはいけません。しかし、いくつか強制終了してしまうケースがあります。たとえば、Windowsアップデートにより意図せずにWindowsサーバーが再起動することがあるかもしれません。
+
+もし、PGroongaを使っているPostgreSQLが強制終了したらメモリー上にだけある変更が失われるかもしれません。強制終了の前に`pgroonga.flush`関数を呼べばメモリー上にだけある変更がなくなります。つまり、ユーザーがPGroongaを使っているPostgreSQLを強制終了してもPGroongaのインデックスは壊れないということです。
+
+もし、メモリー上にだけある変更が多い場合、`pgroonga.flush`の実行時間が長くなるかもしれません。これは使用しているディスクの書き込み性能に依存します。
+
+## 構文
+
+この関数の構文は次の通りです。
+
+```text
+bool pgroonga.flush(pgroonga_index_name)
+```
+
+`pgroonga_index_name`は`text`型の値です。フラッシュ対象のインデックス名です。このインデックスは`USING pgroonga`付きで作成してある必要があります。
+
+`pgroonga.flush`は常に`true`を返します。なぜなら、もし`pgroonga.flush`が失敗したら値を返すのではなくエラーになるからです。
+
+## 使い方
+
+以下はサンプルのスキーマとデータです。このスキーマでは、検索対象のデータと出力対象のデータはどちらもインデックス対象のカラムです。
+
+```sql
+CREATE TABLE terms (
+  id integer,
+  title text,
+  content text
+);
+
+CREATE INDEX pgroonga_terms_index
+          ON terms
+       USING pgroonga (title, content);
+```
+
+以下のように`pgroonga.flush`を呼び出すことでメモリー上にだけある`pgroonga_terms_index`関連の変更をディスクに書き出すことができます。
+
+```sql
+SELECT pgroonga.flush('pgroonga_terms_index');
+--  flush 
+-- -------
+--  t
+-- (1 row)
+```
+
+存在しないインデックス名を指定すると`pgroonga.flush`はエラーになります。
+
+```sql
+SELECT pgroonga.flush('nonexistent');
+-- ERROR:  relation "nonexistent" does not exist
+```

  Modified: ja/reference/functions/pgroonga-score.md (+0 -2)
===================================================================
--- ja/reference/functions/pgroonga-score.md    2016-08-30 23:47:17 +0900 (c6a5dbd)
+++ ja/reference/functions/pgroonga-score.md    2016-08-31 12:03:17 +0900 (a303653)
@@ -54,8 +54,6 @@ SELECT *, pgroonga.score(score_memos)
 
 現在のところ、スコアーの値は「何個キーワードが含まれていたか」(TF、Term Frequency)です。Groongaはどのようにスコアーを計算するかをカスタマイズすることができます。しかし、PGroongaはまだその機能をサポートしていません。
 
-## 使い方
-
 [チュートリアルの中の例](../../tutorial/#score)を参考にしてください。
 
 ## 参考

  Added: reference/functions/pgroonga-flush.md (+60 -0) 100644
===================================================================
--- /dev/null
+++ reference/functions/pgroonga-flush.md    2016-08-31 12:03:17 +0900 (f85cee2)
@@ -0,0 +1,60 @@
+---
+title: pgroonga.flush function
+---
+
+# `pgroonga.flush` function
+
+## Summary
+
+`pgroonga.flush` function ensuring writing changes only in memory into disk. Normally, you don't need to this function because it's done automatically. But you may need to use this function when you want to prevent breaking PGroonga indexes on crash or force shutdown.
+
+Normally, users shouldn't shut down server forcibly but some users do in some cases. For example, Windows update may restart Windows server unexpectedly.
+
+If PostgreSQL with PGroonga is shut down forcibly, changes only in memory may be lost. If you call `pgroonga.flush` function before force shutdown, there are no changes only in memory. It means that PGroonga indexes aren't broken even if users shut down PostgreSQL with PGroonga forcibly.
+
+If there are many changes only in memory, `pgroonga.flush` may take a long time. It's depend on write performance of your disk.
+
+## Syntax
+
+Here is the syntax of this function:
+
+```text
+bool pgroonga.flush(pgroonga_index_name)
+```
+
+`pgroonga_index_name` is a `text` type value. It's an index name to be flushed. The index should be created with `USING pgroonga`.
+
+`pgroonga.flush` returns always `true`. Because if `pgroonga.flush` is failed, it raises an error instead of returning result.
+
+## Usage
+
+Here are sample schema and data. In the schema, both search target data and output data are index target columns:
+
+```sql
+CREATE TABLE terms (
+  id integer,
+  title text,
+  content text
+);
+
+CREATE INDEX pgroonga_terms_index
+          ON terms
+       USING pgroonga (title, content);
+```
+
+You can flush `pgroonga_terms_index` related changes only in memory by the following `pgroonga.flush` call:
+
+```sql
+SELECT pgroonga.flush('pgroonga_terms_index');
+--  flush 
+-- -------
+--  t
+-- (1 row)
+```
+
+If you specify nonexistent index name, `pgroonga.flush` raises an error:
+
+```sql
+SELECT pgroonga.flush('nonexistent');
+-- ERROR:  relation "nonexistent" does not exist
+```

  Modified: reference/functions/pgroonga-score.md (+0 -2)
===================================================================
--- reference/functions/pgroonga-score.md    2016-08-30 23:47:17 +0900 (80052be)
+++ reference/functions/pgroonga-score.md    2016-08-31 12:03:17 +0900 (d0418b2)
@@ -54,8 +54,6 @@ If `pgroonga.score` function returns `0.0` unexpectedly, confirm the followings:
 
 Score is "how many keywords are included" (TF, Term Frequency) for now. Groonga supports customizing how to score. But PGroonga doesn't support yet it for now.
 
-## Usage
-
 See [examples in tutorial](../../tutorial/#score).
 
 ## See also
-------------- next part --------------
HTML����������������������������...
下載 



More information about the Groonga-commit mailing list
Back to archive index