Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add release announce about Groonga 4.1.1
- Loading branch information
Showing
1 changed file
with
162 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| --- | ||
| layout: post.ja | ||
| title: Groonga 4.1.1リリース | ||
| description: Groonga 4.1.1をリリースしました! | ||
| --- | ||
|
|
||
| ## Groonga 4.1.1リリース | ||
|
|
||
| 今日は今年最初の肉の日ですね をリリースしました! | ||
|
|
||
| それぞれの環境毎のインストール方法: [インストール](/ja/docs/install.html) | ||
|
|
||
| ### 変更内容 | ||
|
|
||
| 今回の主な変更点は次の通りです。 | ||
|
|
||
| * 改良 | ||
| * drilldownで集計しやすくなりました | ||
| * groonga-httpdでdumpをストリーム処理できるように | ||
|
|
||
| * 実験的な変更 | ||
| * Windowsでデータベースの初期サイズをよりコンパクトに | ||
| * マルチスレッドでのパフォーマンス改善 | ||
|
|
||
| それでは、いくつか簡単に紹介します。 | ||
|
|
||
| #### 改良 - drilldownで集計しやすくなりました | ||
|
|
||
| 今回のリリースでは、drilldownで集計しやすくなりました。 | ||
|
|
||
| drilldownの構文には以下の2つの種類がありますが、 | ||
|
|
||
| * drilldown | ||
| * drilldown(ラベルつき) | ||
|
|
||
| 今回機能拡張したのはdrilldown(ラベルつき)についてです。 | ||
| drilldownした結果をグループごとにSUM (合計)、 MIN (最小値)、 MAX (最大値)、 AVG (平均) を | ||
| 算出できるようになりました。 | ||
|
|
||
| 次の引数をselectコマンドに渡します。 | ||
|
|
||
| --drilldown[${LABEL}].calc_types=(算出方法) --drilldown[${LABEL}].calc_target=(対象カラム) | ||
|
|
||
| 具体的な例をみてみましょう。MAXを使ってグループごとの最大値を取得する例です。 | ||
|
|
||
| table_create Tags TABLE_PAT_KEY ShortText | ||
|
|
||
| table_create Memos TABLE_HASH_KEY ShortText | ||
| column_create Memos tag COLUMN_SCALAR Tags | ||
| column_create Memos priority COLUMN_SCALAR Int64 | ||
|
|
||
| load --table Memos | ||
| [ | ||
| {"_key": "Groonga1", "tag": "Groonga", "priority": 10}, | ||
| {"_key": "Groonga2", "tag": "Groonga", "priority": 20}, | ||
| {"_key": "Groonga3", "tag": "Groonga", "priority": 40}, | ||
| {"_key": "Mroonga1", "tag": "Mroonga", "priority": 50}, | ||
| {"_key": "Mroonga2", "tag": "Mroonga", "priority": 25}, | ||
| {"_key": "Mroonga3", "tag": "Mroonga", "priority": 10}, | ||
| {"_key": "Rroonga1", "tag": "Rroonga", "priority": 25}, | ||
| {"_key": "Rroonga2", "tag": "Rroonga", "priority": -25}, | ||
| {"_key": "Rroonga3", "tag": "Rroonga", "priority": 0} | ||
| ] | ||
|
|
||
| select Memos \ | ||
| --limit 0 \ | ||
| --drilldown[tag].keys tag \ | ||
| --drilldown[tag].calc_types MAX \ | ||
| --drilldown[tag].calc_target priority \ | ||
| --drilldown[tag].output_columns _key,_max | ||
|
|
||
| 結果は次のようになります。 | ||
|
|
||
| { | ||
| "tag": [ | ||
| [ | ||
| 3 | ||
| ], | ||
| [ | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_max", | ||
| "Int64" | ||
| ] | ||
| ], | ||
| [ | ||
| "Groonga", | ||
| 40 | ||
| ], | ||
| [ | ||
| "Mroonga", | ||
| 50 | ||
| ], | ||
| [ | ||
| "Rroonga", | ||
| 25 | ||
| ] | ||
| ] | ||
| } | ||
|
|
||
| 3つにグループ化され、タグとグループごとの最大値が返ってくるのがわかります。 | ||
| 最大値だけでなく最小値も取得したいなら、`calc_types`に複数カンマ区切りで指定します。 | ||
|
|
||
| --drilldown[tag].calc_types MAX,MIN | ||
|
|
||
| `output_columns` に `_min` 疑似カラムの指定も忘れないようにしましょう。 | ||
|
|
||
| --drilldown[tag].output_columns _key,_max,_min | ||
|
|
||
| これで、最大値と最小値をグループ化した結果ごとに取得できます。 | ||
|
|
||
| #### 改良 - groonga-httpdでdumpをストリーム処理できるように | ||
|
|
||
| 今回のリリースでは、groonga-httpdでdumpをストリーム処理できるようになりました。 | ||
|
|
||
| [Groongaのdumpとgrndumpのメモリ消費の違い](http://qiita.com/orangain/items/6abb3e3b4e0353419fde) | ||
|
|
||
| 上記はgroongaコマンドとgrndumpの比較ですが、groonga-httpdでストリーム処理ができるようになったので、メモリが足りなくなってdumpできないという状況は改善されました。 | ||
|
|
||
| 単にdumpしたいだけならgroonga-httpdでもできます。もっとdumpする内容をカスタマイズしたいというときにはgrndumpがおすすめです。 | ||
|
|
||
| #### 実験的な改良 - Windowsでデータベースの初期サイズをよりコンパクトに | ||
|
|
||
| 今回のリリースでは、データベースの初期サイズを小さくできるようにしました。 | ||
|
|
||
| これまで、WindowsではUNIXとは異なりかなりサイズが大きい初期ファイル(128MiB)をデフォルトで使っていました。 | ||
| このデータベースファイルはカラムを作れば作るだけ増えていくので、登録しているデータが少ない場合にはかなり無駄な領域があることになります。 | ||
| これはあまり嬉しくないので、WindowsでもGNU/Linux環境と同じように必要に応じて追加していくように挙動を変更できるようにしました。 | ||
|
|
||
| 以下のメールに詳しいことが書いてあります。 | ||
|
|
||
| * [[groonga-dev,03036] Windowsでの動作確認のお願い](http://sourceforge.jp/projects/groonga/lists/archive/dev/2014-December/003038.html) | ||
|
|
||
| ただし、デフォルトでは有効にしていません。まだ実験的な機能だからです。この機能を有効にするには `GRN_IO_VERSION=1` 環境変数を指定してください。 | ||
|
|
||
| Windowsを使っている人は、この機能を有効にして使ってみてどうだったかを教えてもらえると嬉しいです。安定して動いているよ、という声が増えてきたら、デフォルトで有効にします。 | ||
|
|
||
| 試す際、`GRN_IO_VERSION=1`を有効にすると古いGroongaではそのデータベースを開けなくなることにだけ注意してください。 | ||
|
|
||
| #### 実験的な改良 - マルチスレッドでのパフォーマンス改善 | ||
|
|
||
| 今回のリリースでは、マルチスレッドでのパフォーマンス改善のための仕組みを実験的に入れました。 | ||
|
|
||
| 具体的には、`--with-jemalloc`をつけてGroongaをビルドするとメモリアロケーションの実装にjemallocを使うようにしました。 | ||
|
|
||
| これを有効にすると、groongaコマンド や Mroonga でパフォーマンスを改善できるでしょう。ただし、groonga-httpd は別です。groonga-httpd はマルチスレッドではなく、マルチプロセスモデルで動作しているためです。 | ||
|
|
||
| Groongaをビルドしなおすのはつらい、という人はLD_PRELOAD環境変数にjemallocのパスを明示的に指定してGroongaを実行してみてください。 | ||
| 例えば次のように指定します。 | ||
|
|
||
| LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 groonga | ||
|
|
||
| 試してみて、どれくらいパフォーマンスを改善できたかレポートしてくれると嬉しいです。 | ||
|
|
||
| ### さいごに | ||
|
|
||
| 4.1.0からの詳細な変更点は [4.1.1リリース 2015-01-29](/ja/docs/news.html#release-4-1-1) を確認してください。 | ||
|
|
||
| それでは、Groongaでガンガン検索してください! |