From c248cad205375d25f814fccf3fc05a0f2099c465 Mon Sep 17 00:00:00 2001 From: KaiGai Kohei Date: Tue, 9 Jul 2024 13:47:10 +0900 Subject: [PATCH] documentation update: CUDA version for Volta/Pascal GPU issue at #807 --- docs/index.html | 2 +- docs/install/index.html | 4 ++-- docs/ja/index.html | 2 +- docs/ja/install/index.html | 4 ++-- docs/ja/search/search_index.json | 2 +- docs/search/search_index.json | 2 +- man/install.md | 8 ++++---- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/index.html b/docs/index.html index 668557b9..2d6a32d7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -248,5 +248,5 @@

Support Policy

diff --git a/docs/install/index.html b/docs/install/index.html index b4a581b8..a343e79d 100644 --- a/docs/install/index.html +++ b/docs/install/index.html @@ -397,8 +397,8 @@

CUDA Toolkit Installation

Tips

Use of Volta or former GPUs

The open source edition of the nvidia driver does not support Volta generation GPUs or former. -Therefore, if you want to use PG-Strom with Volta or Pascal generation GPUs, you need to use CUDA 12.2, whose proprietary driver supports GPUDirect Storage. -The CUDA 12.2 package can be obtained here.

+Therefore, if you want to use PG-Strom with Volta or Pascal generation GPUs, you need to use CUDA 12.2 Update 1, whose proprietary driver supports GPUDirect Storage. +The CUDA 12.2 Update 1 package can be obtained here.

Next, install the driver module nvidia-gds for the GPU-Direct Storage (GDS). Please specify the same version name as the CUDA Toolkit version after the package name.

diff --git a/docs/ja/index.html b/docs/ja/index.html index 1a22fb2c..0fb487df 100644 --- a/docs/ja/index.html +++ b/docs/ja/index.html @@ -240,5 +240,5 @@

サポートポリシー

diff --git a/docs/ja/install/index.html b/docs/ja/install/index.html index d632c85b..b6276e6e 100644 --- a/docs/ja/install/index.html +++ b/docs/ja/install/index.html @@ -397,8 +397,8 @@

CUDA Toolkitのインストール

Tips

Volta以前のGPUの利用について

オープンソース版nvidiaドライバは、Volta世代以前のGPUには対応していません。 -したがって、VoltaまたはPascal世代のGPUでPG-Stromを利用する場合は、プロプラエタリ版のドライバがGPUDirect Storageに対応しているCUDA 12.2を利用する必要があります。 -CUDA 12.2のパッケージはこちらから入手する事ができます。

+したがって、VoltaまたはPascal世代のGPUでPG-Stromを利用する場合は、プロプラエタリ版のドライバであってもGPUDirect Storageに対応しているCUDA 12.2 Update 1を利用する必要があります。 +CUDA 12.2 Update 1のパッケージはこちらから入手する事ができます。

続いて、GPU-Direct Storage(GDS)を利用するためのドライバモジュールnvidia-gdsをインストールします。 パッケージ名に続いてCUDA Toolkitのバージョンと同一のバージョン名を指定してください。

diff --git a/docs/ja/search/search_index.json b/docs/ja/search/search_index.json index ea4938ab..5de0067f 100644 --- a/docs/ja/search/search_index.json +++ b/docs/ja/search/search_index.json @@ -1 +1 @@ -{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"\u306f\u3058\u3081\u306b \u672c\u7ae0\u3067\u306fPG-Strom\u306e\u6982\u8981\u3001\u304a\u3088\u3073\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 PG-Strom\u3068\u306f? PG-Strom\u306fPostgreSQL v15\u304a\u3088\u3073\u4ee5\u964d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u5411\u3051\u306b\u8a2d\u8a08\u3055\u308c\u305f\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3001\u30c1\u30c3\u30d7\u3042\u305f\u308a\u6570\u5343\u500b\u306e\u30b3\u30a2\u3092\u6301\u3064GPU(Graphic Processor Unit)\u30c7\u30d0\u30a4\u30b9\u3092\u5229\u7528\u3059\u308b\u4e8b\u3067\u3001\u5927\u898f\u6a21\u306a\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u5bfe\u3059\u308b\u96c6\u8a08\u30fb\u89e3\u6790\u51e6\u7406\u3084\u30d0\u30c3\u30c1\u51e6\u7406\u5411\u3051\u306eSQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002 PG-Strom\u306e\u4e2d\u6838\u3068\u306a\u308b\u6a5f\u80fd\u306f\u3001SQL\u547d\u4ee4\u304b\u3089\u81ea\u52d5\u7684\u306bGPU\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u751f\u6210\u3059\u308b\u30b3\u30fc\u30c9\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3068\u3001SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPU\u4e0a\u3067\u975e\u540c\u671f\u304b\u3064\u4e26\u5217\u306b\u5b9f\u884c\u3059\u308b\u5b9f\u884c\u30a8\u30f3\u30b8\u30f3\u3067\u3059\u3002\u73fe\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306fSCAN\uff08WHERE\u53e5\u306e\u8a55\u4fa1\uff09\u3001JOIN\u304a\u3088\u3073GROUP BY\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001GPU\u51e6\u7406\u306b\u30a2\u30c9\u30d0\u30f3\u30c6\u30fc\u30b8\u304c\u3042\u308b\u5834\u5408\u306b\u306fPostgreSQL\u6a19\u6e96\u306e\u5b9f\u88c5\u3092\u7f6e\u304d\u63db\u3048\u308b\u4e8b\u3067\u3001\u30e6\u30fc\u30b6\u3084\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u306f\u900f\u904e\u7684\u306b\u52d5\u4f5c\u3057\u307e\u3059\u3002 PG-Strom\u306f\uff12\u3064\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u4e00\u3064\u306f\u884c\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308bPostgreSQL\u306eheap\u30b9\u30c8\u30ec\u30fc\u30b8\u30b7\u30b9\u30c6\u30e0\u3067\u3001\u3053\u308c\u306f\u5fc5\u305a\u3057\u3082\u96c6\u8a08\u30fb\u89e3\u6790\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u6700\u9069\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u4e00\u65b9\u3067\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u7cfb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092\u79fb\u52d5\u3059\u308b\u4e8b\u306a\u304f\u96c6\u8a08\u51e6\u7406\u3092\u5b9f\u884c\u3067\u304d\u308b\u3068\u3044\u3046\u30a2\u30c9\u30d0\u30f3\u30c6\u30fc\u30b8\u304c\u3042\u308a\u307e\u3059\u3002\u3082\u3046\u4e00\u3064\u306f\u3001\u5217\u5f62\u5f0f\u306e\u69cb\u9020\u5316\u30c7\u30fc\u30bf\u5f62\u5f0f\u3067\u3042\u308b Apache Arrow \u30d5\u30a1\u30a4\u30eb\u3067\u3001\u884c\u5358\u4f4d\u306e\u30c7\u30fc\u30bf\u66f4\u65b0\u306b\u306f\u4e0d\u5411\u304d\u3067\u3042\u308b\u3082\u306e\u306e\u3001\u52b9\u7387\u7684\u306b\u5927\u91cf\u30c7\u30fc\u30bf\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u5916\u90e8\u30c7\u30fc\u30bf\u30e9\u30c3\u30d1(FDW)\u3092\u901a\u3057\u3066\u52b9\u7387\u7684\u306a\u30c7\u30fc\u30bf\u306e\u691c\u7d22\u30fb\u96c6\u8a08\u304c\u53ef\u80fd\u3067\u3059\u3002 PG-Strom\u306e\u7279\u5fb4\u7684\u306a\u6a5f\u80fd\u306e\u4e00\u3064\u304c\u3001NVME/NVME-oF\u30c7\u30d0\u30a4\u30b9\u304b\u3089CPU/RAM\u3092\u30d0\u30a4\u30d1\u30b9\u3057\u3066GPU\u306b\u76f4\u63a5\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3057\u3001GPU\u3067SQL\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u3067\u30c7\u30d0\u30a4\u30b9\u306e\u5e2f\u57df\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u3067\u3059\u3002v3.0\u3067\u306f\u65b0\u305f\u306bNVIDIA GPUDirect Storage\u306b\u3082\u5bfe\u5fdc\u3057\u3001\u30ed\u30fc\u30ab\u30ebNVME-SSD\u3060\u3051\u3067\u306a\u304f\u3001NVME-oF\u3092\u4ecb\u3057\u305fSDS(Software Defined Storage)\u30c7\u30d0\u30a4\u30b9\u3084\u3001\u5171\u6709\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u306e\u8aad\u307f\u51fa\u3057\u306b\u3082\u5bfe\u5fdc\u3057\u307e\u3059\u3002 v3.0\u3067\u306f\u4e00\u90e8\u306ePostGIS\u95a2\u6570\u3068\u3001\u30b8\u30aa\u30e1\u30c8\u30ea\u30c7\u30fc\u30bf\u306eGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u63a2\u7d22\u3092GPU\u5074\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u66f4\u65b0\u306e\u591a\u3044\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092\u4e88\u3081GPU\u306b\u8907\u88fd\u3057\u3066\u304a\u304fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u6a5f\u80fd\u3068\u4f75\u305b\u3066\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306a\u4f4d\u7f6e\u60c5\u5831\u306b\u57fa\u3065\u304f\u691c\u7d22\u3001\u5206\u6790\u51e6\u7406\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002 v5.0\u3067\u306f\u30d7\u30ed\u30bb\u30b9\u30e2\u30c7\u30eb\u306e\u66f4\u65b0\uff08\u30de\u30eb\u30c1\u30d7\u30ed\u30bb\u30b9\u21d2\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\uff09\u3084\u3001\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u304b\u3089\u7591\u4f3c\u30b3\u30fc\u30c9\u3078\u306e\u5207\u308a\u66ff\u3048\u306a\u3069\u3001\u6839\u672c\u7684\u306a\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u8a2d\u8a08\u306e\u5909\u66f4\u304c\u884c\u308f\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5168\u822c\u7684\u306a\u51e6\u7406\u901f\u5ea6\u3084\u5b89\u5b9a\u6027\u306e\u6539\u5584\u304c\u56f3\u3089\u308c\u307e\u3057\u305f\u3002 \u30e9\u30a4\u30bb\u30f3\u30b9\u3068\u8457\u4f5c\u6a29 PG-Strom\u306fPostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u306b\u57fa\u3065\u3044\u3066\u516c\u958b\u30fb\u914d\u5e03\u3055\u308c\u3066\u3044\u308b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3059\u3002 \u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u8a73\u7d30\u306f LICENSE \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30b3\u30df\u30e5\u30cb\u30c6\u30a3 PG-Strom\u306b\u95a2\u3059\u308b\u8cea\u554f\u3084\u8981\u671b\u3001\u969c\u5bb3\u5831\u544a\u306a\u3069\u306f\u3001 GitHub\u306eDiscussion \u30da\u30fc\u30b8\u306b\u6295\u7a3f\u3059\u308b\u3088\u3046\u304a\u9858\u3044\u3057\u307e\u3059\u3002 \u672c\u63b2\u793a\u677f\u306f\u3001\u4e16\u754c\u4e2d\u306b\u516c\u958b\u3055\u308c\u305f\u30d1\u30d6\u30ea\u30c3\u30af\u306e\u63b2\u793a\u677f\u3067\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3064\u307e\u308a\u3001\u81ea\u5df1\u8cac\u4efb\u306e\u4e0b\u3001\u79d8\u5bc6\u60c5\u5831\u304c\u8aa4\u3063\u3066\u6295\u7a3f\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u672c\u63b2\u793a\u677f\u306e\u512a\u5148\u8a00\u8a9e\u306f\u82f1\u8a9e\u3067\u3059\u3002\u305f\u3060\u4e00\u65b9\u3067\u3001\u6b74\u53f2\u7684\u7d4c\u7def\u306b\u3088\u308aPG-Strom\u30e6\u30fc\u30b6\u306e\u591a\u304f\u306e\u5272\u5408\u304c\u65e5\u672c\u4eba\u3067\u3042\u308b\u4e8b\u306f\u627f\u77e5\u3057\u3066\u304a\u308a\u3001Discussion\u4e0a\u3067\u65e5\u672c\u8a9e\u3092\u5229\u7528\u3057\u305f\u8b70\u8ad6\u304c\u884c\u308f\u308c\u308b\u3053\u3068\u3082\u53ef\u80fd\u3068\u3057\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u3001Subject(\u4ef6\u540d)\u306b (JP) \u3068\u3044\u3046\u63a5\u982d\u53e5\u3092\u4ed8\u3051\u308b\u4e8b\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u975e\u65e5\u672c\u8a9e\u8a71\u8005\u304c\u4e0d\u8981\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8aad\u307f\u98db\u3070\u3059\u305f\u3081\u306b\u6709\u7528\u3067\u3059\u3002 \u30d0\u30b0\u3084\u969c\u5bb3\u306e\u5831\u544a \u7d50\u679c\u4e0d\u6b63\u3084\u30b7\u30b9\u30c6\u30e0\u30af\u30e9\u30c3\u30b7\u30e5/\u30ed\u30c3\u30af\u30a2\u30c3\u30d7\u3001\u305d\u306e\u4ed6\u306e\u7591\u308f\u3057\u3044\u52d5\u4f5c\u3092\u767a\u898b\u3057\u305f\u5834\u5408\u306f\u3001 PG-Strom Issue Tracker \u3067\u65b0\u3057\u3044\u30a4\u30b7\u30e5\u30fc\u3092\u30aa\u30fc\u30d7\u30f3\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30d0\u30b0\u30ec\u30dd\u30fc\u30c8\u306e\u4f5c\u6210\u306b\u969b\u3057\u3066\u306f\u3001\u4e0b\u8a18\u306e\u70b9\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 - \u540c\u3058\u554f\u984c\u3092\u6700\u65b0\u7248\u3067\u518d\u73fe\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u304b\u3069\u3046\u304b? - PG-Strom\u306e\u6700\u65b0\u7248\u3060\u3051\u3067\u306a\u304f\u3001OS\u3001CUDA\u3001PostgreSQL\u304a\u3088\u3073\u95a2\u9023\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u6700\u65b0\u7248\u3067\u30c6\u30b9\u30c8\u3059\u308b\u4e8b\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002 - PG-Strom\u304c\u7121\u52b9\u5316\u3055\u308c\u305f\u72b6\u614b\u3067\u3082\u540c\u3058\u554f\u984c\u3092\u518d\u73fe\u3067\u304d\u308b\u304b\u3069\u3046\u304b? - GUC\u30d1\u30e9\u30e1\u30fc\u30bf pg_strom.enabled \u306b\u3088\u3063\u3066PG-Strom\u306e\u6709\u52b9/\u7121\u52b9\u3092\u5207\u308a\u66ff\u3048\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 - \u540c\u3058\u65e2\u77e5\u554f\u984c\u304c\u65e2\u306bGitHub\u306e\u30a4\u30b7\u30e5\u30fc\u30c8\u30e9\u30c3\u30ab\u30fc\u306b\u5b58\u5728\u3059\u308b\u304b\u3069\u3046\u304b\uff1f - close \u72b6\u614b\u306e\u30a4\u30b7\u30e5\u30fc\u3092\u691c\u7d22\u3059\u308b\u306e\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306a\u60c5\u5831\u306f\u30d0\u30b0\u5831\u544a\u306b\u304a\u3044\u3066\u6709\u7528\u3067\u3059\u3002 \u554f\u984c\u3092\u518d\u73fe\u3059\u308b\u624b\u9806\uff08\u30c7\u30fc\u30bf\u304a\u3088\u3073\u30af\u30a8\u30ea\uff09 \u554f\u984c\u30af\u30a8\u30ea\u306e EXPLAIN VERBOSE \u51fa\u529b \u95a2\u9023\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u69cb\u9020\uff08 psql \u4e0a\u3067 \\d+ \u3092\u5b9f\u884c\u3057\u3066\u5f97\u3089\u308c\u308b\uff09 \u51fa\u529b\u3055\u308c\u305f\u30ed\u30b0\u30e1\u30c3\u30bb\u30fc\u30b8\uff08verbose\u51fa\u529b\u304c\u671b\u307e\u3057\u3044\uff09 \u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u304b\u3089\u5909\u66f4\u3057\u3066\u3044\u308bGUC\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u5024 \u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u8a2d\u5b9a\uff08\u7279\u306bGPU\u306e\u578b\u756a\u3068RAM\u5bb9\u91cf\uff09 \u3042\u306a\u305f\u306e\u74b0\u5883\u3067\u767a\u751f\u3057\u305f\u7591\u308f\u3057\u3044\u52d5\u4f5c\u304c\u30d0\u30b0\u304b\u3069\u3046\u304b\u5b9a\u304b\u3067\u306f\u306a\u3044\u5834\u5408\u3001\u65b0\u3057\u3044\u30a4\u30b7\u30e5\u30fc\u306e\u30c1\u30b1\u30c3\u30c8\u3092\u30aa\u30fc\u30d7\u30f3\u3059\u308b\u524d\u306bDiscussion\u63b2\u793a\u677f\u3078\u5831\u544a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u8ffd\u52a0\u7684\u306a\u60c5\u5831\u63a1\u53d6\u306e\u4f9d\u983c\u306a\u3069\u3001\u958b\u767a\u8005\u306f\u6b21\u306b\u53d6\u308b\u3079\u304d\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u63d0\u6848\u3057\u3066\u304f\u308c\u308b\u3067\u3057\u3087\u3046\u3002 \u65b0\u6a5f\u80fd\u306e\u63d0\u6848 \u4f55\u304b\u65b0\u6a5f\u80fd\u306e\u30a2\u30a4\u30c7\u30a2\u304c\u3042\u308b\u5834\u5408\u3001 PG-Strom Issue Tracker \u3067\u65b0\u3057\u3044\u30a4\u30b7\u30e5\u30fc\u3092\u30aa\u30fc\u30d7\u30f3\u3057 feature \u30bf\u30b0\u3092\u4ed8\u3051\u3066\u304f\u3060\u3055\u3044\u3002\u7d9a\u3044\u3066\u3001\u4ed6\u306e\u958b\u767a\u8005\u3068\u8b70\u8ad6\u3092\u884c\u3044\u307e\u3057\u3087\u3046\u3002 \u671b\u307e\u3057\u3044\u65b0\u6a5f\u80fd\u63d0\u6848\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8981\u7d20\u3092\u542b\u3093\u3067\u3044\u307e\u3059\u3002 \u3042\u306a\u305f\u306f\u3069\u306e\u3088\u3046\u306a\u554f\u984c\u3092\u89e3\u6c7a/\u6539\u5584\u3057\u305f\u3044\u306e\u304b\uff1f \u3042\u306a\u305f\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9/\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306b\u3068\u3063\u3066\u3069\u306e\u7a0b\u5ea6\u6df1\u523b\u306a\u306e\u304b\uff1f \u3069\u306e\u3088\u3046\u306b\u305d\u308c\u3092\u5b9f\u88c5\u3059\u308b\u306e\u304b\uff1f \uff08\u3082\u3057\u3042\u308c\u3070\uff09\u4e88\u60f3\u3055\u308c\u308b\u6b20\u70b9\u30fb\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5 \u958b\u767a\u8005\u306e\u9593\u3067\u305d\u306e\u5fc5\u8981\u6027\u306b\u95a2\u3057\u3066\u30b3\u30f3\u30bb\u30f3\u30b5\u30b9\u304c\u5f97\u3089\u308c\u308b\u3068\u3001\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u30fc\u306f\u30a4\u30b7\u30e5\u30fc\u30c1\u30b1\u30c3\u30c8\u306b accepted \u30bf\u30b0\u3092\u4ed8\u3051\u3001\u305d\u306e\u30c1\u30b1\u30c3\u30c8\u306f\u305d\u306e\u5f8c\u306e\u958b\u767a\u4f5c\u696d\u306e\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u306e\u305f\u3081\u306b\u5229\u7528\u3055\u308c\u307e\u3059\u3002\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u3001\u30a4\u30b7\u30e5\u30fc\u30c1\u30b1\u30c3\u30c8\u306b\u306f rejected \u30bf\u30b0\u3092\u4ed8\u3051\u3066\u30af\u30ed\u30fc\u30ba\u3055\u308c\u307e\u3059\u3002 \u4e00\u5ea6\u30d7\u30ed\u30dd\u30fc\u30b6\u30eb\u304c\u5374\u4e0b\u3055\u308c\u305f\u3068\u3057\u3066\u3082\u3001\u5c06\u6765\u306b\u304a\u3044\u3066\u307e\u305f\u7570\u306a\u3063\u305f\u6c7a\u5b9a\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u5468\u8fba\u72b6\u6cc1\u304c\u5909\u308f\u3063\u305f\u5834\u5408\u3001\u65b0\u6a5f\u80fd\u306e\u518d\u63d0\u6848\u3092\u8e8a\u8e87\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u958b\u767a\u6bb5\u968e\u3067\u306f\u3001\u30d1\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30b7\u30e5\u30fc\u30c1\u30b1\u30c3\u30c8\u306b\u6dfb\u4ed8\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002pull-request\u306f\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002 \u30b5\u30dd\u30fc\u30c8\u30dd\u30ea\u30b7\u30fc PG-Strom development team\u306fHeteroDB Software Distribution Center\u304b\u3089\u914d\u5e03\u3055\u308c\u305f\u6700\u65b0\u7248\u306e\u307f\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002 \u30c8\u30e9\u30d6\u30eb\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u3001\u307e\u305a\u305d\u306e\u554f\u984c\u306f\u6700\u65b0\u7248\u306e\u30ea\u30ea\u30fc\u30b9\u3067\u518d\u73fe\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u304b\u3081\u3066\u304f\u3060\u3055\u3044\u3002 \u307e\u305f\u3001\u3053\u308c\u306f\u30dc\u30e9\u30f3\u30c6\u30a3\u30a2\u30d9\u30fc\u30b9\u306e\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u30b5\u30dd\u30fc\u30c8\u306e\u30dd\u30ea\u30b7\u30fc\u3067\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3064\u307e\u308a\u3001\u30b5\u30dd\u30fc\u30c8\u306f\u30d9\u30b9\u30c8\u30a8\u30d5\u30a9\u30fc\u30c8\u3067\u304b\u3064\u3001SLA\u306e\u5b9a\u7fa9\u3082\u3042\u308a\u307e\u305b\u3093\u3002 \u3082\u3057\u5546\u7528\u306e\u30b5\u30dd\u30fc\u30c8\u304c\u5fc5\u8981\u3067\u3042\u308b\u5834\u5408\u3001HeteroDB\u793e\uff08contact@heterodbcom\uff09\u306b\u30b3\u30f3\u30bf\u30af\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u306f\u3058\u3081\u306b"},{"location":"#_1","text":"\u672c\u7ae0\u3067\u306fPG-Strom\u306e\u6982\u8981\u3001\u304a\u3088\u3073\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"\u306f\u3058\u3081\u306b"},{"location":"#pg-strom","text":"PG-Strom\u306fPostgreSQL v15\u304a\u3088\u3073\u4ee5\u964d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u5411\u3051\u306b\u8a2d\u8a08\u3055\u308c\u305f\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3001\u30c1\u30c3\u30d7\u3042\u305f\u308a\u6570\u5343\u500b\u306e\u30b3\u30a2\u3092\u6301\u3064GPU(Graphic Processor Unit)\u30c7\u30d0\u30a4\u30b9\u3092\u5229\u7528\u3059\u308b\u4e8b\u3067\u3001\u5927\u898f\u6a21\u306a\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u5bfe\u3059\u308b\u96c6\u8a08\u30fb\u89e3\u6790\u51e6\u7406\u3084\u30d0\u30c3\u30c1\u51e6\u7406\u5411\u3051\u306eSQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002 PG-Strom\u306e\u4e2d\u6838\u3068\u306a\u308b\u6a5f\u80fd\u306f\u3001SQL\u547d\u4ee4\u304b\u3089\u81ea\u52d5\u7684\u306bGPU\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u751f\u6210\u3059\u308b\u30b3\u30fc\u30c9\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3068\u3001SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPU\u4e0a\u3067\u975e\u540c\u671f\u304b\u3064\u4e26\u5217\u306b\u5b9f\u884c\u3059\u308b\u5b9f\u884c\u30a8\u30f3\u30b8\u30f3\u3067\u3059\u3002\u73fe\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306fSCAN\uff08WHERE\u53e5\u306e\u8a55\u4fa1\uff09\u3001JOIN\u304a\u3088\u3073GROUP BY\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001GPU\u51e6\u7406\u306b\u30a2\u30c9\u30d0\u30f3\u30c6\u30fc\u30b8\u304c\u3042\u308b\u5834\u5408\u306b\u306fPostgreSQL\u6a19\u6e96\u306e\u5b9f\u88c5\u3092\u7f6e\u304d\u63db\u3048\u308b\u4e8b\u3067\u3001\u30e6\u30fc\u30b6\u3084\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u306f\u900f\u904e\u7684\u306b\u52d5\u4f5c\u3057\u307e\u3059\u3002 PG-Strom\u306f\uff12\u3064\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u4e00\u3064\u306f\u884c\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308bPostgreSQL\u306eheap\u30b9\u30c8\u30ec\u30fc\u30b8\u30b7\u30b9\u30c6\u30e0\u3067\u3001\u3053\u308c\u306f\u5fc5\u305a\u3057\u3082\u96c6\u8a08\u30fb\u89e3\u6790\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u6700\u9069\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u4e00\u65b9\u3067\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u7cfb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092\u79fb\u52d5\u3059\u308b\u4e8b\u306a\u304f\u96c6\u8a08\u51e6\u7406\u3092\u5b9f\u884c\u3067\u304d\u308b\u3068\u3044\u3046\u30a2\u30c9\u30d0\u30f3\u30c6\u30fc\u30b8\u304c\u3042\u308a\u307e\u3059\u3002\u3082\u3046\u4e00\u3064\u306f\u3001\u5217\u5f62\u5f0f\u306e\u69cb\u9020\u5316\u30c7\u30fc\u30bf\u5f62\u5f0f\u3067\u3042\u308b Apache Arrow \u30d5\u30a1\u30a4\u30eb\u3067\u3001\u884c\u5358\u4f4d\u306e\u30c7\u30fc\u30bf\u66f4\u65b0\u306b\u306f\u4e0d\u5411\u304d\u3067\u3042\u308b\u3082\u306e\u306e\u3001\u52b9\u7387\u7684\u306b\u5927\u91cf\u30c7\u30fc\u30bf\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u5916\u90e8\u30c7\u30fc\u30bf\u30e9\u30c3\u30d1(FDW)\u3092\u901a\u3057\u3066\u52b9\u7387\u7684\u306a\u30c7\u30fc\u30bf\u306e\u691c\u7d22\u30fb\u96c6\u8a08\u304c\u53ef\u80fd\u3067\u3059\u3002 PG-Strom\u306e\u7279\u5fb4\u7684\u306a\u6a5f\u80fd\u306e\u4e00\u3064\u304c\u3001NVME/NVME-oF\u30c7\u30d0\u30a4\u30b9\u304b\u3089CPU/RAM\u3092\u30d0\u30a4\u30d1\u30b9\u3057\u3066GPU\u306b\u76f4\u63a5\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3057\u3001GPU\u3067SQL\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u3067\u30c7\u30d0\u30a4\u30b9\u306e\u5e2f\u57df\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u3067\u3059\u3002v3.0\u3067\u306f\u65b0\u305f\u306bNVIDIA GPUDirect Storage\u306b\u3082\u5bfe\u5fdc\u3057\u3001\u30ed\u30fc\u30ab\u30ebNVME-SSD\u3060\u3051\u3067\u306a\u304f\u3001NVME-oF\u3092\u4ecb\u3057\u305fSDS(Software Defined Storage)\u30c7\u30d0\u30a4\u30b9\u3084\u3001\u5171\u6709\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u306e\u8aad\u307f\u51fa\u3057\u306b\u3082\u5bfe\u5fdc\u3057\u307e\u3059\u3002 v3.0\u3067\u306f\u4e00\u90e8\u306ePostGIS\u95a2\u6570\u3068\u3001\u30b8\u30aa\u30e1\u30c8\u30ea\u30c7\u30fc\u30bf\u306eGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u63a2\u7d22\u3092GPU\u5074\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u66f4\u65b0\u306e\u591a\u3044\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092\u4e88\u3081GPU\u306b\u8907\u88fd\u3057\u3066\u304a\u304fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u6a5f\u80fd\u3068\u4f75\u305b\u3066\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306a\u4f4d\u7f6e\u60c5\u5831\u306b\u57fa\u3065\u304f\u691c\u7d22\u3001\u5206\u6790\u51e6\u7406\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002 v5.0\u3067\u306f\u30d7\u30ed\u30bb\u30b9\u30e2\u30c7\u30eb\u306e\u66f4\u65b0\uff08\u30de\u30eb\u30c1\u30d7\u30ed\u30bb\u30b9\u21d2\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\uff09\u3084\u3001\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u304b\u3089\u7591\u4f3c\u30b3\u30fc\u30c9\u3078\u306e\u5207\u308a\u66ff\u3048\u306a\u3069\u3001\u6839\u672c\u7684\u306a\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u8a2d\u8a08\u306e\u5909\u66f4\u304c\u884c\u308f\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5168\u822c\u7684\u306a\u51e6\u7406\u901f\u5ea6\u3084\u5b89\u5b9a\u6027\u306e\u6539\u5584\u304c\u56f3\u3089\u308c\u307e\u3057\u305f\u3002","title":"PG-Strom\u3068\u306f?"},{"location":"#_2","text":"PG-Strom\u306fPostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u306b\u57fa\u3065\u3044\u3066\u516c\u958b\u30fb\u914d\u5e03\u3055\u308c\u3066\u3044\u308b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3059\u3002 \u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u8a73\u7d30\u306f LICENSE \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u30e9\u30a4\u30bb\u30f3\u30b9\u3068\u8457\u4f5c\u6a29"},{"location":"#_3","text":"PG-Strom\u306b\u95a2\u3059\u308b\u8cea\u554f\u3084\u8981\u671b\u3001\u969c\u5bb3\u5831\u544a\u306a\u3069\u306f\u3001 GitHub\u306eDiscussion \u30da\u30fc\u30b8\u306b\u6295\u7a3f\u3059\u308b\u3088\u3046\u304a\u9858\u3044\u3057\u307e\u3059\u3002 \u672c\u63b2\u793a\u677f\u306f\u3001\u4e16\u754c\u4e2d\u306b\u516c\u958b\u3055\u308c\u305f\u30d1\u30d6\u30ea\u30c3\u30af\u306e\u63b2\u793a\u677f\u3067\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3064\u307e\u308a\u3001\u81ea\u5df1\u8cac\u4efb\u306e\u4e0b\u3001\u79d8\u5bc6\u60c5\u5831\u304c\u8aa4\u3063\u3066\u6295\u7a3f\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u672c\u63b2\u793a\u677f\u306e\u512a\u5148\u8a00\u8a9e\u306f\u82f1\u8a9e\u3067\u3059\u3002\u305f\u3060\u4e00\u65b9\u3067\u3001\u6b74\u53f2\u7684\u7d4c\u7def\u306b\u3088\u308aPG-Strom\u30e6\u30fc\u30b6\u306e\u591a\u304f\u306e\u5272\u5408\u304c\u65e5\u672c\u4eba\u3067\u3042\u308b\u4e8b\u306f\u627f\u77e5\u3057\u3066\u304a\u308a\u3001Discussion\u4e0a\u3067\u65e5\u672c\u8a9e\u3092\u5229\u7528\u3057\u305f\u8b70\u8ad6\u304c\u884c\u308f\u308c\u308b\u3053\u3068\u3082\u53ef\u80fd\u3068\u3057\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u3001Subject(\u4ef6\u540d)\u306b (JP) \u3068\u3044\u3046\u63a5\u982d\u53e5\u3092\u4ed8\u3051\u308b\u4e8b\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u975e\u65e5\u672c\u8a9e\u8a71\u8005\u304c\u4e0d\u8981\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8aad\u307f\u98db\u3070\u3059\u305f\u3081\u306b\u6709\u7528\u3067\u3059\u3002","title":"\u30b3\u30df\u30e5\u30cb\u30c6\u30a3"},{"location":"#_4","text":"\u7d50\u679c\u4e0d\u6b63\u3084\u30b7\u30b9\u30c6\u30e0\u30af\u30e9\u30c3\u30b7\u30e5/\u30ed\u30c3\u30af\u30a2\u30c3\u30d7\u3001\u305d\u306e\u4ed6\u306e\u7591\u308f\u3057\u3044\u52d5\u4f5c\u3092\u767a\u898b\u3057\u305f\u5834\u5408\u306f\u3001 PG-Strom Issue Tracker \u3067\u65b0\u3057\u3044\u30a4\u30b7\u30e5\u30fc\u3092\u30aa\u30fc\u30d7\u30f3\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30d0\u30b0\u30ec\u30dd\u30fc\u30c8\u306e\u4f5c\u6210\u306b\u969b\u3057\u3066\u306f\u3001\u4e0b\u8a18\u306e\u70b9\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 - \u540c\u3058\u554f\u984c\u3092\u6700\u65b0\u7248\u3067\u518d\u73fe\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u304b\u3069\u3046\u304b? - PG-Strom\u306e\u6700\u65b0\u7248\u3060\u3051\u3067\u306a\u304f\u3001OS\u3001CUDA\u3001PostgreSQL\u304a\u3088\u3073\u95a2\u9023\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u6700\u65b0\u7248\u3067\u30c6\u30b9\u30c8\u3059\u308b\u4e8b\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002 - PG-Strom\u304c\u7121\u52b9\u5316\u3055\u308c\u305f\u72b6\u614b\u3067\u3082\u540c\u3058\u554f\u984c\u3092\u518d\u73fe\u3067\u304d\u308b\u304b\u3069\u3046\u304b? - GUC\u30d1\u30e9\u30e1\u30fc\u30bf pg_strom.enabled \u306b\u3088\u3063\u3066PG-Strom\u306e\u6709\u52b9/\u7121\u52b9\u3092\u5207\u308a\u66ff\u3048\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 - \u540c\u3058\u65e2\u77e5\u554f\u984c\u304c\u65e2\u306bGitHub\u306e\u30a4\u30b7\u30e5\u30fc\u30c8\u30e9\u30c3\u30ab\u30fc\u306b\u5b58\u5728\u3059\u308b\u304b\u3069\u3046\u304b\uff1f - close \u72b6\u614b\u306e\u30a4\u30b7\u30e5\u30fc\u3092\u691c\u7d22\u3059\u308b\u306e\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306a\u60c5\u5831\u306f\u30d0\u30b0\u5831\u544a\u306b\u304a\u3044\u3066\u6709\u7528\u3067\u3059\u3002 \u554f\u984c\u3092\u518d\u73fe\u3059\u308b\u624b\u9806\uff08\u30c7\u30fc\u30bf\u304a\u3088\u3073\u30af\u30a8\u30ea\uff09 \u554f\u984c\u30af\u30a8\u30ea\u306e EXPLAIN VERBOSE \u51fa\u529b \u95a2\u9023\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u69cb\u9020\uff08 psql \u4e0a\u3067 \\d+
\u3092\u5b9f\u884c\u3057\u3066\u5f97\u3089\u308c\u308b\uff09 \u51fa\u529b\u3055\u308c\u305f\u30ed\u30b0\u30e1\u30c3\u30bb\u30fc\u30b8\uff08verbose\u51fa\u529b\u304c\u671b\u307e\u3057\u3044\uff09 \u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u304b\u3089\u5909\u66f4\u3057\u3066\u3044\u308bGUC\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u5024 \u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u8a2d\u5b9a\uff08\u7279\u306bGPU\u306e\u578b\u756a\u3068RAM\u5bb9\u91cf\uff09 \u3042\u306a\u305f\u306e\u74b0\u5883\u3067\u767a\u751f\u3057\u305f\u7591\u308f\u3057\u3044\u52d5\u4f5c\u304c\u30d0\u30b0\u304b\u3069\u3046\u304b\u5b9a\u304b\u3067\u306f\u306a\u3044\u5834\u5408\u3001\u65b0\u3057\u3044\u30a4\u30b7\u30e5\u30fc\u306e\u30c1\u30b1\u30c3\u30c8\u3092\u30aa\u30fc\u30d7\u30f3\u3059\u308b\u524d\u306bDiscussion\u63b2\u793a\u677f\u3078\u5831\u544a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u8ffd\u52a0\u7684\u306a\u60c5\u5831\u63a1\u53d6\u306e\u4f9d\u983c\u306a\u3069\u3001\u958b\u767a\u8005\u306f\u6b21\u306b\u53d6\u308b\u3079\u304d\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u63d0\u6848\u3057\u3066\u304f\u308c\u308b\u3067\u3057\u3087\u3046\u3002","title":"\u30d0\u30b0\u3084\u969c\u5bb3\u306e\u5831\u544a"},{"location":"#_5","text":"\u4f55\u304b\u65b0\u6a5f\u80fd\u306e\u30a2\u30a4\u30c7\u30a2\u304c\u3042\u308b\u5834\u5408\u3001 PG-Strom Issue Tracker \u3067\u65b0\u3057\u3044\u30a4\u30b7\u30e5\u30fc\u3092\u30aa\u30fc\u30d7\u30f3\u3057 feature \u30bf\u30b0\u3092\u4ed8\u3051\u3066\u304f\u3060\u3055\u3044\u3002\u7d9a\u3044\u3066\u3001\u4ed6\u306e\u958b\u767a\u8005\u3068\u8b70\u8ad6\u3092\u884c\u3044\u307e\u3057\u3087\u3046\u3002 \u671b\u307e\u3057\u3044\u65b0\u6a5f\u80fd\u63d0\u6848\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8981\u7d20\u3092\u542b\u3093\u3067\u3044\u307e\u3059\u3002 \u3042\u306a\u305f\u306f\u3069\u306e\u3088\u3046\u306a\u554f\u984c\u3092\u89e3\u6c7a/\u6539\u5584\u3057\u305f\u3044\u306e\u304b\uff1f \u3042\u306a\u305f\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9/\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306b\u3068\u3063\u3066\u3069\u306e\u7a0b\u5ea6\u6df1\u523b\u306a\u306e\u304b\uff1f \u3069\u306e\u3088\u3046\u306b\u305d\u308c\u3092\u5b9f\u88c5\u3059\u308b\u306e\u304b\uff1f \uff08\u3082\u3057\u3042\u308c\u3070\uff09\u4e88\u60f3\u3055\u308c\u308b\u6b20\u70b9\u30fb\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5 \u958b\u767a\u8005\u306e\u9593\u3067\u305d\u306e\u5fc5\u8981\u6027\u306b\u95a2\u3057\u3066\u30b3\u30f3\u30bb\u30f3\u30b5\u30b9\u304c\u5f97\u3089\u308c\u308b\u3068\u3001\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u30fc\u306f\u30a4\u30b7\u30e5\u30fc\u30c1\u30b1\u30c3\u30c8\u306b accepted \u30bf\u30b0\u3092\u4ed8\u3051\u3001\u305d\u306e\u30c1\u30b1\u30c3\u30c8\u306f\u305d\u306e\u5f8c\u306e\u958b\u767a\u4f5c\u696d\u306e\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u306e\u305f\u3081\u306b\u5229\u7528\u3055\u308c\u307e\u3059\u3002\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u3001\u30a4\u30b7\u30e5\u30fc\u30c1\u30b1\u30c3\u30c8\u306b\u306f rejected \u30bf\u30b0\u3092\u4ed8\u3051\u3066\u30af\u30ed\u30fc\u30ba\u3055\u308c\u307e\u3059\u3002 \u4e00\u5ea6\u30d7\u30ed\u30dd\u30fc\u30b6\u30eb\u304c\u5374\u4e0b\u3055\u308c\u305f\u3068\u3057\u3066\u3082\u3001\u5c06\u6765\u306b\u304a\u3044\u3066\u307e\u305f\u7570\u306a\u3063\u305f\u6c7a\u5b9a\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u5468\u8fba\u72b6\u6cc1\u304c\u5909\u308f\u3063\u305f\u5834\u5408\u3001\u65b0\u6a5f\u80fd\u306e\u518d\u63d0\u6848\u3092\u8e8a\u8e87\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u958b\u767a\u6bb5\u968e\u3067\u306f\u3001\u30d1\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30b7\u30e5\u30fc\u30c1\u30b1\u30c3\u30c8\u306b\u6dfb\u4ed8\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002pull-request\u306f\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002","title":"\u65b0\u6a5f\u80fd\u306e\u63d0\u6848"},{"location":"#_6","text":"PG-Strom development team\u306fHeteroDB Software Distribution Center\u304b\u3089\u914d\u5e03\u3055\u308c\u305f\u6700\u65b0\u7248\u306e\u307f\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002 \u30c8\u30e9\u30d6\u30eb\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u3001\u307e\u305a\u305d\u306e\u554f\u984c\u306f\u6700\u65b0\u7248\u306e\u30ea\u30ea\u30fc\u30b9\u3067\u518d\u73fe\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u304b\u3081\u3066\u304f\u3060\u3055\u3044\u3002 \u307e\u305f\u3001\u3053\u308c\u306f\u30dc\u30e9\u30f3\u30c6\u30a3\u30a2\u30d9\u30fc\u30b9\u306e\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u30b5\u30dd\u30fc\u30c8\u306e\u30dd\u30ea\u30b7\u30fc\u3067\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3064\u307e\u308a\u3001\u30b5\u30dd\u30fc\u30c8\u306f\u30d9\u30b9\u30c8\u30a8\u30d5\u30a9\u30fc\u30c8\u3067\u304b\u3064\u3001SLA\u306e\u5b9a\u7fa9\u3082\u3042\u308a\u307e\u305b\u3093\u3002 \u3082\u3057\u5546\u7528\u306e\u30b5\u30dd\u30fc\u30c8\u304c\u5fc5\u8981\u3067\u3042\u308b\u5834\u5408\u3001HeteroDB\u793e\uff08contact@heterodbcom\uff09\u306b\u30b3\u30f3\u30bf\u30af\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u30b5\u30dd\u30fc\u30c8\u30dd\u30ea\u30b7\u30fc"},{"location":"arrow_fdw/","text":"Apache Arrow (\u5217\u6307\u5411\u30c7\u30fc\u30bf\u30b9\u30c8\u30a2) \u6982\u8981 PostgreSQL\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u5185\u90e8\u7684\u306b8KB\u306e\u30d6\u30ed\u30c3\u30af 1 \u3068\u547c\u3070\u308c\u308b\u5358\u4f4d\u3067\u7de8\u6210\u3055\u308c\u3001\u30d6\u30ed\u30c3\u30af\u306f\u5168\u3066\u306e\u5c5e\u6027\u53ca\u3073\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u542b\u3080\u30bf\u30d7\u30eb\u3068\u547c\u3070\u308c\u308b\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u884c\u5358\u4f4d\u3067\u683c\u7d0d\u3057\u307e\u3059\u3002\u884c\u3092\u69cb\u6210\u3059\u308b\u30c7\u30fc\u30bf\u304c\u8fd1\u508d\u306b\u5b58\u5728\u3059\u308b\u305f\u3081\u3001\u3053\u308c\u306fINSERT\u3084UPDATE\u306e\u591a\u3044\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u6709\u52b9\u3067\u3059\u304c\u3001\u4e00\u65b9\u3067\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u30fb\u89e3\u6790\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u306f\u4e0d\u5411\u304d\u3067\u3042\u308b\u3068\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u901a\u5e38\u3001\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u306b\u304a\u3044\u3066\u306f\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u5168\u3066\u306e\u5217\u3092\u53c2\u7167\u3059\u308b\u4e8b\u306f\u73cd\u3057\u304f\u3001\u591a\u304f\u306e\u5834\u5408\u306b\u306f\u4e00\u90e8\u306e\u5217\u3060\u3051\u3092\u53c2\u7167\u3059\u308b\u3068\u3044\u3063\u305f\u51e6\u7406\u306b\u306a\u308a\u304c\u3061\u3067\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u5b9f\u969b\u306b\u306f\u53c2\u7167\u3055\u308c\u306a\u3044\u5217\u306e\u30c7\u30fc\u30bf\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u6d88\u8cbb\u3055\u308c\u308bI/O\u306e\u5e2f\u57df\u306f\u5168\u304f\u7121\u99c4\u3067\u3059\u304c\u3001\u884c\u5358\u4f4d\u3067\u7de8\u6210\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u7279\u5b9a\u306e\u5217\u3060\u3051\u3092\u53d6\u308a\u51fa\u3059\u3068\u3044\u3046\u64cd\u4f5c\u306f\u56f0\u96e3\u3067\u3059\u3002 \u9006\u306b\u5217\u5358\u4f4d\u3067\u30c7\u30fc\u30bf\u3092\u7de8\u6210\u3057\u305f\u5834\u5408\u3001INSERT\u3084UPDATE\u306e\u591a\u3044\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u3057\u3066\u306f\u6975\u7aef\u306b\u4e0d\u5229\u3067\u3059\u304c\u3001\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u30fb\u89e3\u6790\u3092\u884c\u3046\u969b\u306b\u306f\u88ab\u53c2\u7167\u5217\u3060\u3051\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089\u30ed\u30fc\u30c9\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308b\u305f\u3081\u3001I/O\u306e\u5e2f\u57df\u3092\u6700\u5927\u9650\u306b\u6d3b\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u307e\u305f\u30d7\u30ed\u30bb\u30c3\u30b5\u306e\u51e6\u7406\u52b9\u7387\u306e\u89b3\u70b9\u304b\u3089\u3082\u3001\u5217\u5358\u4f4d\u306b\u7de8\u6210\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306f\u5358\u7d14\u306a\u914d\u5217\u3067\u3042\u308b\u304b\u306e\u3088\u3046\u306b\u898b\u3048\u308b\u305f\u3081\u3001GPU\u306b\u3068\u3063\u3066\u306fCoalesced Memory Access\u3068\u3044\u3046\u30e1\u30e2\u30ea\u30d0\u30b9\u306e\u6027\u80fd\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059\u30a2\u30af\u30bb\u30b9\u30d1\u30bf\u30fc\u30f3\u3068\u306a\u308b\u4e8b\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 Apache Arrow\u3068\u306f Apache Arrow\u3068\u306f\u3001\u69cb\u9020\u5316\u30c7\u30fc\u30bf\u3092\u5217\u5f62\u5f0f\u3067\u8a18\u9332\u3001\u4ea4\u63db\u3059\u308b\u305f\u3081\u306e\u30c7\u30fc\u30bf\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u3059\u3002 \u4e3b\u306b\u30d3\u30c3\u30b0\u30c7\u30fc\u30bf\u51e6\u7406\u306e\u305f\u3081\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u307b\u304b\u3001C\u3084C++\u3001Python\u306a\u3069\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u5411\u3051\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u6574\u5099\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u81ea\u4f5c\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089Apache Arrow\u5f62\u5f0f\u3092\u6271\u3046\u3088\u3046\u8a2d\u8a08\u3059\u308b\u4e8b\u3082\u5bb9\u6613\u3067\u3059\u3002 Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u90e8\u306b\u306f\u3001\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u5b9a\u7fa9\u3059\u308b\u30b9\u30ad\u30fc\u30de\uff08Schema\uff09\u90e8\u5206\u3068\u3001\u30b9\u30ad\u30fc\u30de\u306b\u57fa\u3065\u3044\u3066\u5217\u30c7\u30fc\u30bf\u3092\u8a18\u9332\u3059\u308b1\u500b\u4ee5\u4e0a\u306e\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\uff08RecordBatch\uff09\u90e8\u5206\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u578b\u3068\u3057\u3066\u306f\u3001\u6574\u6570\u3084\u6587\u5b57\u5217\uff08\u53ef\u5909\u9577\uff09\u3001\u65e5\u4ed8\u6642\u523b\u578b\u306a\u3069\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u500b\u3005\u306e\u5217\u30c7\u30fc\u30bf\u306f\u3053\u308c\u3089\u30c7\u30fc\u30bf\u578b\u306b\u5fdc\u3058\u305f\u5185\u90e8\u8868\u73fe\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 Apache Arrow\u5f62\u5f0f\u306b\u304a\u3051\u308b\u30c7\u30fc\u30bf\u8868\u73fe\u306f\u3001\u5fc5\u305a\u3057\u3082\u5168\u3066\u306e\u5834\u5408\u3067PostgreSQL\u306e\u30c7\u30fc\u30bf\u8868\u73fe\u3068\u4e00\u81f4\u3057\u3066\u3044\u308b\u8a33\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070\u3001Arrow\u5f62\u5f0f\u3067\u306f\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b\u306e\u30a8\u30dd\u30c3\u30af\u306f 1970-01-01 \u3067\u8907\u6570\u306e\u7cbe\u5ea6\u3092\u6301\u3064\u4e8b\u304c\u3067\u304d\u307e\u3059\u304c\u3001PostgreSQL\u306e\u30a8\u30dd\u30c3\u30af\u306f 2001-01-01 \u3067\u30de\u30a4\u30af\u30ed\u79d2\u306e\u7cbe\u5ea6\u3092\u6301\u3061\u307e\u3059\u3002 Arrow_Fdw\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u7528\u3044\u3066Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092PostgreSQL\u4e0a\u3067\u8aad\u307f\u51fa\u3059\u4e8b\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u5217\u3054\u3068\u306b100\u4e07\u4ef6\u306e\u5217\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\u30928\u500b\u5185\u5305\u3059\u308bArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092Arrow_Fdw\u3092\u7528\u3044\u3066\u30de\u30c3\u30d7\u3057\u305f\u5834\u5408\u3001\u3053\u306e\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u4ecb\u3057\u3066Arrow\u30d5\u30a1\u30a4\u30eb\u4e0a\u306e800\u4e07\u4ef6\u306e\u30c7\u30fc\u30bf\u3078\u30a2\u30af\u30bb\u30b9\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u904b\u7528 \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u5b9a\u7fa9 \u901a\u5e38\u3001\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e3\u30b9\u30c6\u30c3\u30d7\u304c\u5fc5\u8981\u3067\u3059\u3002 CREATE FOREIGN DATA WRAPPER \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u5916\u90e8\u30c7\u30fc\u30bf\u30e9\u30c3\u30d1\u3092\u5b9a\u7fa9\u3059\u308b CREATE SERVER \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u5916\u90e8\u30b5\u30fc\u30d0\u3092\u5b9a\u7fa9\u3059\u308b CREATE FOREIGN TABLE \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u5b9a\u7fa9\u3059\u308b \u3053\u306e\u3046\u3061\u3001\u6700\u521d\u306e2\u30b9\u30c6\u30c3\u30d7\u306f CREATE EXTENSION pg_strom \u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u306b\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u500b\u5225\u306b\u5b9f\u884c\u304c\u5fc5\u8981\u306a\u306e\u306f\u6700\u5f8c\u306e CREATE FOREIGN TABLE \u306e\u307f\u3067\u3059\u3002 CREATE FOREIGN TABLE flogdata ( ts timestamp, sensor_id int, signal1 smallint, signal2 smallint, signal3 smallint, signal4 smallint, ) SERVER arrow_fdw OPTIONS (file '/path/to/logdata.arrow'); CREATE FOREIGN TABLE \u69cb\u6587\u3067\u6307\u5b9a\u3057\u305f\u5217\u306e\u30c7\u30fc\u30bf\u578b\u306f\u3001\u30de\u30c3\u30d7\u3059\u308bArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3068\u53b3\u5bc6\u306b\u4e00\u81f4\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u308c\u4ee5\u5916\u306b\u3082\u3001Arrow_Fdw\u306f IMPORT FOREIGN SCHEMA \u69cb\u6587\u3092\u7528\u3044\u305f\u4fbf\u5229\u306a\u65b9\u6cd5\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u6301\u3064\u30b9\u30ad\u30fc\u30de\u60c5\u5831\u3092\u5229\u7528\u3057\u3066\u3001\u81ea\u52d5\u7684\u306b\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9\u3092\u751f\u6210\u3059\u308b\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u540d\u3068\u30a4\u30f3\u30dd\u30fc\u30c8\u5148\u306e\u30b9\u30ad\u30fc\u30de\u3001\u304a\u3088\u3073OPTION\u53e5\u3067Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u306b\u306f\u3001\u5217\u3054\u3068\u306e\u30c7\u30fc\u30bf\u578b\u3068\u5217\u540d\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\uff09\u304c\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u3053\u308c\u3092\u7528\u3044\u3066\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u5b9a\u7fa9\u3092\u884c\u3044\u307e\u3059\u3002 IMPORT FOREIGN SCHEMA flogdata FROM SERVER arrow_fdw INTO public OPTIONS (file '/path/to/logdata.arrow'); \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u30aa\u30d7\u30b7\u30e7\u30f3 Arrow_Fdw\u306f\u4ee5\u4e0b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002\u73fe\u72b6\u3001\u5168\u3066\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u6307\u5b9a\u3059\u308b\u3082\u306e\u3067\u3059\u3002 file=PATHNAME \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3059\u308bArrow\u30d5\u30a1\u30a4\u30eb\u30921\u500b\u6307\u5b9a\u3057\u307e\u3059\u3002 files=PATHNAME1[,PATHNAME2...] \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3059\u308bArrow\u30d5\u30a1\u30a4\u30eb\u3092\u30ab\u30f3\u30de(,\uff09\u533a\u5207\u308a\u3067\u8907\u6570\u6307\u5b9a\u3057\u307e\u3059\u3002 dir=DIRNAME \u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u5168\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3057\u307e\u3059\u3002 suffix=SUFFIX dir \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u6307\u5b9a\u6642\u3001\u4f8b\u3048\u3070 .arrow \u306a\u3069\u3001\u7279\u5b9a\u306e\u63a5\u5c3e\u53e5\u3092\u6301\u3064\u30d5\u30a1\u30a4\u30eb\u3060\u3051\u3092\u30de\u30c3\u30d7\u3057\u307e\u3059\u3002 parallel_workers=N_WORKERS \u3053\u306e\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u4e26\u5217\u30b9\u30ad\u30e3\u30f3\u306b\u4f7f\u7528\u3059\u308b\u4e26\u5217\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306e\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u4e00\u822c\u7684\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u304a\u3051\u308b parallel_workers \u30b9\u30c8\u30ec\u30fc\u30b8\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u540c\u7b49\u306e\u610f\u5473\u3092\u6301\u3061\u307e\u3059\u3002 writable=(true|false) \u3053\u306e\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b INSERT \u6587\u306e\u5b9f\u884c\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002\u8a73\u7d30\u306f\u300e\u66f8\u304d\u8fbc\u307f\u53ef\u80fdArrow_Fdw\u300f\u306e\u7bc0\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc Arrow\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u578b\u3068\u3001PostgreSQL\u306e\u30c7\u30fc\u30bf\u578b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 Int bitWidth \u5c5e\u6027\u306e\u5024\u306b\u5fdc\u3058\u3066\u3001\u305d\u308c\u305e\u308c int1 \u3001 int2 \u3001 int4 \u3001 int8 \u306e\u3044\u305a\u308c\u304b\u306b\u5bfe\u5fdc\u3002 is_signed \u5c5e\u6027\u306e\u5024\u306f\u7121\u8996\u3055\u308c\u307e\u3059\u3002 int1 \u306fPG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 FloatingPoint precision \u5c5e\u6027\u306e\u5024\u306b\u5fdc\u3058\u3066\u3001\u305d\u308c\u305e\u308c float2 \u3001 float4 \u3001 float8 \u306e\u3044\u305a\u308c\u304b\u306b\u5bfe\u5fdc\u3002 float2 \u306fPG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 Binary bytea \u578b\u306b\u5bfe\u5fdc Decimal numeric \u578b\u306b\u5bfe\u5fdc Date date \u578b\u306b\u5bfe\u5fdc\u3002 unit=Day \u76f8\u5f53\u3068\u306a\u308b\u3088\u3046\u306b\u88dc\u6b63\u3055\u308c\u308b\u3002 Time time \u578b\u306b\u5bfe\u5fdc\u3002 unit=MicroSecond \u76f8\u5f53\u306b\u306a\u308b\u3088\u3046\u306b\u88dc\u6b63\u3055\u308c\u308b\u3002 Timestamp timestamp \u578b\u306b\u5bfe\u5fdc\u3002 unit=MicroSecond \u76f8\u5f53\u306b\u306a\u308b\u3088\u3046\u306b\u88dc\u6b63\u3055\u308c\u308b\u3002 Interval interval \u578b\u306b\u5bfe\u5fdc List \u8981\u7d20\u578b\u306e1\u6b21\u5143\u914d\u5217\u578b\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u308b\u3002 Struct \u8907\u5408\u578b\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u308b\u3002\u5bfe\u5fdc\u3059\u308b\u8907\u5408\u578b\u306f\u4e88\u3081\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002 FixedSizeBinary byteWidth \u5c5e\u6027\u306e\u5024\u306b\u5fdc\u3058\u3066 char(n) \u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u308b\u3002 \u30e1\u30bf\u30c7\u30fc\u30bf pg_type=TYPENAME \u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u8a72\u5f53\u3059\u308b\u30c7\u30fc\u30bf\u578b\u3092\u5272\u308a\u5f53\u3066\u308b\u5834\u5408\u304c\u3042\u308b\u3002\u73fe\u6642\u70b9\u3067\u306f\u3001 inet \u304a\u3088\u3073 macaddr \u578b\u3002 Union \u3001 Map \u3001 Duration \u3001 LargeBinary \u3001 LargeUtf8 \u3001 LargeList \u73fe\u6642\u70b9\u3067\u306fPostgreSQL\u30c7\u30fc\u30bf\u578b\u3078\u306e\u5bfe\u5fdc\u306f\u306a\u3057\u3002 EXPLAIN\u51fa\u529b\u306e\u8aad\u307f\u65b9 EXPLAIN \u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u3066\u3001Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u51fa\u3057\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u7d04503GB\u306e\u5927\u304d\u3055\u3092\u6301\u3064Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u30de\u30c3\u30d7\u3057\u305ff_lineorder\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u542b\u3080\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u306e\u51fa\u529b\u3067\u3059\u3002 =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) -> Custom Scan (GpuPreAgg) on f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..78.95 rows=365 width=4) Filter: (d_year = 1993) (12 rows) \u3053\u308c\u3092\u898b\u308b\u3068Custom Scan (GpuPreAgg)\u304c f_lineorder \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3066\u3044\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 file0 \u306b\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u80cc\u5f8c\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u540d /opt/nvme/f_lineorder_s999.arrow \u3068\u305d\u306e\u30b5\u30a4\u30ba\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u30de\u30c3\u30d7\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306b\u306f\u3001 file1 \u3001 file2 \u3001... \u3068\u5404\u30d5\u30a1\u30a4\u30eb\u6bce\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002 referenced \u306b\u306f\u5b9f\u969b\u306b\u53c2\u7167\u3055\u308c\u3066\u3044\u308b\u5217\u306e\u4e00\u89a7\u304c\u5217\u6319\u3055\u308c\u3066\u304a\u308a\u3001\u3053\u306e\u30af\u30a8\u30ea\u306b\u304a\u3044\u3066\u306f lo_orderdate \u3001 lo_quantity \u3001 lo_extendedprice \u304a\u3088\u3073 lo_discount \u5217\u304c\u53c2\u7167\u3055\u308c\u3066\u3044\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 \u307e\u305f\u3001 GPU-Direct SQL: enabled (GPU-0) \u306e\u8868\u793a\u304c\u3042\u308b\u4e8b\u304b\u3089\u3001 f_lineorder \u306e\u30b9\u30ad\u30e3\u30f3\u306b\u306fGPU-Direct SQL\u6a5f\u69cb\u304c\u7528\u3044\u3089\u308c\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002 VERBOSE\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u4e0e\u3059\u308b\u4e8b\u3067\u3001\u3088\u308a\u8a73\u7d30\u306a\u60c5\u5831\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002 =# EXPLAIN VERBOSE SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) Output: pgstrom.sum_int((pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint))) -> Custom Scan (GpuPreAgg) on public.f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) Output: (pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint)) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) lo_orderdate: 22.35GB lo_quantity: 22.35GB lo_extendedprice: 22.35GB lo_discount: 22.35GB GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , , , KVecs-Buffer: nbytes: 51200, ndims: 3, items=[kvec0=<0x0000-27ff, type='int4', expr='lo_discount'>, kvec1=<0x2800-4fff, type='int4', expr='lo_quantity'>, kvec2=<0x5000-77ff, type='int4', expr='lo_extendedprice'>, kvec3=<0x7800-9fff, type='int4', expr='lo_orderdate'>, kvec4=<0xa000-c7ff, type='int4', expr='d_datekey'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, , , ]}, items[1]={LoadVars(depth=1): kvars=[]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, , ]}}, items[1]={MoveVars(depth=1): items=[, ]}}} Scan Quals OpCode: {Bool::AND args=[{Func(bool)::int4ge args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='1'}]}, {Func(bool)::int4le args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='3'}]}, {Func(bool)::int4lt args=[{Var(int4): slot=1, expr='lo_quantity'}, {Const(int4): value='25'}]}]} Join Quals OpCode: {Packed items[1]={JoinQuals: {Func(bool)::int4eq args=[{Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}, {Var(int4): slot=5, expr='d_datekey'}]}}} Join HashValue OpCode: {Packed items[1]={HashValue arg={Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}}} Partial Aggregation OpCode: {AggFuncs arg={SaveExpr: arg={Func(int8)::int8 arg={Func(int4)::int4mul args=[{Var(int4): kvec=0x5000-7800, expr='lo_extendedprice'}, {Var(int4): kvec=0x0000-2800, expr='lo_discount'}]}}}} Partial Function BufSz: 16 -> Seq Scan on public.date1 (cost=0.00..78.95 rows=365 width=4) Output: date1.d_datekey Filter: (date1.d_year = 1993) (28 rows) \u88ab\u53c2\u7167\u5217\u3092\u30ed\u30fc\u30c9\u3059\u308b\u969b\u306b\u8aad\u307f\u51fa\u3059\u3079\u304d\u5217\u30c7\u30fc\u30bf\u306e\u5927\u304d\u3055\u3092\u3001\u5217\u3054\u3068\u306b\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002 lo_orderdate \u3001 lo_quantity \u3001 lo_extendedprice \u304a\u3088\u3073 lo_discount \u5217\u306e\u30ed\u30fc\u30c9\u306b\u306f\u5408\u8a08\u306789.41GB\u306e\u8aad\u307f\u51fa\u3057\u304c\u5fc5\u8981\u3067\u3001\u3053\u308c\u306f\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba502.93GB\u306e17.8%\u306b\u76f8\u5f53\u3057\u307e\u3059\u3002 Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u65b9\u6cd5 \u672c\u7bc0\u3067\u306f\u3001\u65e2\u306bPostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u3092Apache Arrow\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002 PyArrow+Pandas Arrow\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u304c\u958b\u767a\u3092\u884c\u3063\u3066\u3044\u308b PyArrow \u30e2\u30b8\u30e5\u30fc\u30eb\u3068Pandas\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306e\u7d44\u5408\u305b\u3092\u7528\u3044\u3066\u3001PostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5185\u5bb9\u3092Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u3068\u66f8\u304d\u51fa\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u30c6\u30fc\u30d6\u30ebt0\u306b\u683c\u7d0d\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u5168\u3066\u8aad\u8fbc\u307f\u3001\u30d5\u30a1\u30a4\u30eb/tmp/t0.arrow\u3078\u3068\u66f8\u304d\u51fa\u3059\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002 import pyarrow as pa import pandas as pd X = pd.read_sql(sql=\"SELECT * FROM t0\", con=\"postgresql://localhost/postgres\") Y = pa.Table.from_pandas(X) f = pa.RecordBatchFileWriter('/tmp/t0.arrow', Y.schema) f.write_table(Y,1000000) # RecordBatch for each million rows f.close() \u305f\u3060\u3057\u4e0a\u8a18\u306e\u65b9\u6cd5\u306f\u3001SQL\u3092\u4ecb\u3057\u3066PostgreSQL\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5185\u5bb9\u3092\u4e00\u5ea6\u30e1\u30e2\u30ea\u306b\u4fdd\u6301\u3059\u308b\u305f\u3081\u3001\u5927\u91cf\u306e\u884c\u3092\u4e00\u5ea6\u306b\u5909\u63db\u3059\u308b\u5834\u5408\u306b\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002 Pg2Arrow \u4e00\u65b9\u3001PG-Strom Development Team\u304c\u958b\u767a\u3092\u884c\u3063\u3066\u3044\u308b pg2arrow \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001PostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5185\u5bb9\u3092Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u3068\u66f8\u304d\u51fa\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u3053\u306e\u30c4\u30fc\u30eb\u306f\u6bd4\u8f03\u7684\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092NVME-SSD\u306a\u3069\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u66f8\u304d\u51fa\u3059\u4e8b\u3092\u5ff5\u982d\u306b\u8a2d\u8a08\u3055\u308c\u3066\u304a\u308a\u3001PostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089 -s|--segment-size \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u305f\u30b5\u30a4\u30ba\u306e\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3059\u305f\u3073\u306b\u3001Arrow\u5f62\u5f0f\u306e\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\uff08Record Batch\uff09\u3068\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30e1\u30e2\u30ea\u6d88\u8cbb\u91cf\u306f\u6bd4\u8f03\u7684\u30ea\u30fc\u30ba\u30ca\u30d6\u30eb\u306a\u5024\u3068\u306a\u308a\u307e\u3059\u3002 pg2arrow \u30b3\u30de\u30f3\u30c9\u306fPG-Strom\u306b\u540c\u68b1\u3055\u308c\u3066\u304a\u308a\u3001PostgreSQL\u95a2\u9023\u30b3\u30de\u30f3\u30c9\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002 $ pg2arrow --help Usage: pg2arrow [OPTION] [database] [username] General options: -d, --dbname=DBNAME Database name to connect to -c, --command=COMMAND SQL command to run -t, --table=TABLENAME Equivalent to '-c SELECT * FROM TABLENAME' (-c and -t are exclusive, either of them must be given) --inner-join=SUB_COMMAND --outer-join=SUB_COMMAND -o, --output=FILENAME result file in Apache Arrow format --append=FILENAME result Apache Arrow file to be appended (--output and --append are exclusive. If neither of them are given, it creates a temporary file.) -S, --stat[=COLUMNS] embeds min/max statistics for each record batch COLUMNS is a comma-separated list of the target columns if partially enabled. Arrow format options: -s, --segment-size=SIZE size of record batch for each Connection options: -h, --host=HOSTNAME database server host -p, --port=PORT database server port -u, --user=USERNAME database user name -w, --no-password never prompt for password -W, --password force password prompt Other options: --dump=FILENAME dump information of arrow file --progress shows progress of the job --set=NAME:VALUE config option to set before SQL execution --help shows this message Report bugs to . PostgreSQL\u3078\u306e\u63a5\u7d9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306fpsql\u3084pg_dump\u3068\u540c\u69d8\u306b\u3001 -h \u3084 -U \u306a\u3069\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002 \u57fa\u672c\u7684\u306a\u30b3\u30de\u30f3\u30c9\u306e\u4f7f\u7528\u65b9\u6cd5\u306f\u3001 -c|--command \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u305fSQL\u3092PostgreSQL\u4e0a\u3067\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092 -o|--output \u3067\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3078Arrow\u5f62\u5f0f\u3067\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002 -o|--output \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u4ee3\u308f\u308a\u306b --append \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u3053\u308c\u306f\u65e2\u5b58\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u8ffd\u8a18\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u8ffd\u8a18\u3055\u308c\u308bApache Arrow\u30d5\u30a1\u30a4\u30eb\u306f\u6307\u5b9a\u3057\u305fSQL\u306e\u5b9f\u884c\u7d50\u679c\u3068\u5b8c\u5168\u306b\u4e00\u81f4\u3059\u308b\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u6301\u305f\u306d\u3070\u306a\u308a\u307e\u305b\u3093\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u30c6\u30fc\u30d6\u30eb t0 \u306b\u683c\u7d0d\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u5168\u3066\u8aad\u8fbc\u307f\u3001\u30d5\u30a1\u30a4\u30eb /tmp/t0.arrow \u3078\u3068\u66f8\u304d\u51fa\u3059\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002 $ pg2arrow -U kaigai -d postgres -c \"SELECT * FROM t0\" -o /tmp/t0.arrow \u958b\u767a\u8005\u5411\u3051\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u304c\u3001 --dump \u3067Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3084\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\u306e\u4f4d\u7f6e\u3068\u30b5\u30a4\u30ba\u3092\u53ef\u8aad\u306a\u5f62\u5f0f\u3067\u51fa\u529b\u3059\u308b\u4e8b\u3082\u3067\u304d\u307e\u3059\u3002 --progress \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u51e6\u7406\u306e\u9014\u4e2d\u7d4c\u904e\u3092\u8868\u793a\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002\u3053\u308c\u306f\u5de8\u5927\u306a\u30c6\u30fc\u30d6\u30eb\u3092Apache Arrow\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u969b\u306b\u6709\u7528\u3067\u3059\u3002 \u5148\u9032\u7684\u306a\u4f7f\u3044\u65b9 SSDtoGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3055\u308c\u305f\u5168\u3066\u306eArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u304c\u4ee5\u4e0b\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u5834\u5408\u306b\u306f\u3001\u5217\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u51fa\u3057\u306bSSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u304cNVME-SSD\u533a\u753b\u4e0a\u306b\u7f6e\u304b\u308c\u3066\u3044\u308b\u3002 NVME-SSD\u533a\u753b\u306fExt4\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3067\u69cb\u7bc9\u3055\u308c\u3066\u3044\u308b\u3002 Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u7dcf\u8a08\u304c pg_strom.nvme_strom_threshold \u8a2d\u5b9a\u3092\u4e0a\u56de\u3063\u3066\u3044\u308b\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u8a2d\u5b9a Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u4e00\u90e8\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u901a\u5e38\u306ePostgreSQL\u30c6\u30fc\u30d6\u30eb\u3068\u6df7\u5728\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306f\u66f8\u304d\u8fbc\u307f\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u4e8b\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u307e\u305f\u3001\u30de\u30c3\u30d7\u3055\u308c\u305fArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306b\u542b\u307e\u308c\u308b\u30c7\u30fc\u30bf\u306f\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5883\u754c\u6761\u4ef6\u3068\u77db\u76fe\u3057\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u8005\u306e\u8cac\u4efb\u3067\u3059\u3002 \u5178\u578b\u7684\u306a\u5229\u7528\u30b7\u30fc\u30f3\u306f\u3001\u9577\u671f\u9593\u306b\u308f\u305f\u308a\u84c4\u7a4d\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u51e6\u7406\u3067\u3059\u3002 \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u3068\u7570\u306a\u308a\u3001\u4e00\u822c\u7684\u306b\u30ed\u30b0\u30c7\u30fc\u30bf\u306f\u4e00\u5ea6\u8a18\u9332\u3055\u308c\u305f\u3089\u305d\u306e\u5f8c\u66f4\u65b0\u524a\u9664\u3055\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u3057\u305f\u304c\u3063\u3066\u3001\u4e00\u5b9a\u671f\u9593\u304c\u7d4c\u904e\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306f\u3001\u8aad\u307f\u51fa\u3057\u5c02\u7528\u3067\u306f\u3042\u308b\u3082\u306e\u306e\u96c6\u8a08\u51e6\u7406\u304c\u9ad8\u901f\u306aArrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u79fb\u3057\u66ff\u3048\u308b\u3053\u3068\u3067\u3001\u96c6\u8a08\u30fb\u89e3\u6790\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u51e6\u7406\u52b9\u7387\u3092\u5f15\u304d\u4e0a\u3052\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u30ed\u30b0\u30c7\u30fc\u30bf\u306b\u306f\u307b\u307c\u9593\u9055\u3044\u306a\u304f\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u304c\u4ed8\u4e0e\u3055\u308c\u3066\u3044\u308b\u4e8b\u304b\u3089\u3001\u6708\u5358\u4f4d\u3001\u9031\u5358\u4f4d\u306a\u3069\u3001\u4e00\u5b9a\u671f\u9593\u3054\u3068\u306b\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u8ffd\u52a0\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001PostgreSQL\u30c6\u30fc\u30d6\u30eb\u3068Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u6df7\u5728\u3055\u305b\u305f\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3092\u5b9a\u7fa9\u3057\u305f\u3082\u306e\u3067\u3059\u3002 \u66f8\u304d\u8fbc\u307f\u304c\u53ef\u80fd\u306aPostgreSQL\u30c6\u30fc\u30d6\u30eb\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3068\u3057\u3066\u6307\u5b9a\u3057\u3066\u304a\u304f\u4e8b\u3067\u3001\u4e00\u5b9a\u671f\u9593\u306e\u7d4c\u904e\u5f8c\u3001DB\u904b\u7528\u3092\u7d99\u7d9a\u3057\u306a\u304c\u3089\u904e\u53bb\u306e\u30ed\u30b0\u30c7\u30fc\u30bf\u3060\u3051\u3092Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3078\u79fb\u3059\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 CREATE TABLE lineorder ( lo_orderkey numeric, lo_linenumber integer, lo_custkey numeric, lo_partkey integer, lo_suppkey numeric, lo_orderdate integer, lo_orderpriority character(15), lo_shippriority character(1), lo_quantity numeric, lo_extendedprice numeric, lo_ordertotalprice numeric, lo_discount numeric, lo_revenue numeric, lo_supplycost numeric, lo_tax numeric, lo_commit_date character(8), lo_shipmode character(10) ) PARTITION BY RANGE (lo_orderdate); CREATE TABLE lineorder__now PARTITION OF lineorder default; CREATE FOREIGN TABLE lineorder__1993 PARTITION OF lineorder FOR VALUES FROM (19930101) TO (19940101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1993.arrow'); CREATE FOREIGN TABLE lineorder__1994 PARTITION OF lineorder FOR VALUES FROM (19940101) TO (19950101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1994.arrow'); CREATE FOREIGN TABLE lineorder__1995 PARTITION OF lineorder FOR VALUES FROM (19950101) TO (19960101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1995.arrow'); CREATE FOREIGN TABLE lineorder__1996 PARTITION OF lineorder FOR VALUES FROM (19960101) TO (19970101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1996.arrow'); \u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b\u554f\u3044\u5408\u308f\u305b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u691c\u7d22\u6761\u4ef6 lo_orderdate between 19950701 and 19960630 \u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5883\u754c\u6761\u4ef6\u3092\u542b\u3093\u3067\u3044\u308b\u4e8b\u304b\u3089\u3001\u5b50\u30c6\u30fc\u30d6\u30eb lineorder__1993 \u3068 lineorder__1994 \u306f\u691c\u7d22\u5bfe\u8c61\u304b\u3089\u6392\u9664\u3055\u308c\u3001\u4ed6\u306e\u30c6\u30fc\u30d6\u30eb\u3060\u3051\u3092\u8aad\u307f\u51fa\u3059\u3088\u3046\u5b9f\u884c\u8a08\u753b\u304c\u4f5c\u3089\u308c\u3066\u3044\u307e\u3059\u3002 =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM lineorder,date1 WHERE lo_orderdate = d_datekey AND lo_orderdate between 19950701 and 19960630 AND lo_discount between 1 and 3 ABD lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=172088.90..172088.91 rows=1 width=32) -> Hash Join (cost=10548.86..172088.51 rows=77 width=64) Hash Cond: (lineorder__1995.lo_orderdate = date1.d_datekey) -> Append (cost=10444.35..171983.80 rows=77 width=67) -> Custom Scan (GpuScan) on lineorder__1995 (cost=10444.35..33671.87 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1995.arrow (size: 892.57MB) -> Custom Scan (GpuScan) on lineorder__1996 (cost=10444.62..33849.21 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1996.arrow (size: 897.87MB) -> Custom Scan (GpuScan) on lineorder__now (cost=11561.33..104462.33 rows=1 width=18) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash (cost=72.56..72.56 rows=2556 width=4) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=4) (16 rows) \u3053\u306e\u5f8c\u3001 lineorder__now \u30c6\u30fc\u30d6\u30eb\u304b\u30891997\u5e74\u306e\u30c7\u30fc\u30bf\u3092\u629c\u304d\u51fa\u3057\u3001\u3053\u308c\u3092Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u5074\u306b\u79fb\u3059\u306b\u306f\u4ee5\u4e0b\u306e\u64cd\u4f5c\u3092\u884c\u3044\u307e\u3059 $ pg2arrow -d sample -o /opt/tmp/lineorder_1997.arrow \\ -c \"SELECT * FROM lineorder WHERE lo_orderdate between 19970101 and 19971231\" pg2arrow \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u3001 lineorder \u30c6\u30fc\u30d6\u30eb\u304b\u30891997\u5e74\u306e\u30c7\u30fc\u30bf\u3060\u3051\u3092\u629c\u304d\u51fa\u3057\u3066\u3001\u65b0\u3057\u3044Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002 BEGIN; -- -- remove rows in 1997 from the read-writable table -- DELETE FROM lineorder WHERE lo_orderdate BETWEEN 19970101 AND 19971231; -- -- define a new partition leaf which maps log-data in 1997 -- CREATE FOREIGN TABLE lineorder__1997 PARTITION OF lineorder FOR VALUES FROM (19970101) TO (19980101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1997.arrow'); COMMIT; \u3053\u306e\u64cd\u4f5c\u306b\u3088\u308a\u3001PostgreSQL\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b lineorder__now \u304b\u30891997\u5e74\u306e\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3057\u3001\u4ee3\u308f\u308a\u306b\u540c\u4e00\u5185\u5bb9\u306eArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb /opt/tmp/lineorder_1997.arrow \u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb lineorder__1997 \u3068\u3057\u3066\u30de\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002 \u6b63\u78ba\u306b\u306f\u30014KB\uff5e32KB\u306e\u7bc4\u56f2\u3067\u30d3\u30eb\u30c9\u6642\u306b\u6307\u5b9a\u3067\u304d\u307e\u3059 \u21a9","title":"Apache Arrow"},{"location":"arrow_fdw/#apache-arrow","text":"","title":"Apache Arrow (\u5217\u6307\u5411\u30c7\u30fc\u30bf\u30b9\u30c8\u30a2)"},{"location":"arrow_fdw/#_1","text":"PostgreSQL\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u5185\u90e8\u7684\u306b8KB\u306e\u30d6\u30ed\u30c3\u30af 1 \u3068\u547c\u3070\u308c\u308b\u5358\u4f4d\u3067\u7de8\u6210\u3055\u308c\u3001\u30d6\u30ed\u30c3\u30af\u306f\u5168\u3066\u306e\u5c5e\u6027\u53ca\u3073\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u542b\u3080\u30bf\u30d7\u30eb\u3068\u547c\u3070\u308c\u308b\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u884c\u5358\u4f4d\u3067\u683c\u7d0d\u3057\u307e\u3059\u3002\u884c\u3092\u69cb\u6210\u3059\u308b\u30c7\u30fc\u30bf\u304c\u8fd1\u508d\u306b\u5b58\u5728\u3059\u308b\u305f\u3081\u3001\u3053\u308c\u306fINSERT\u3084UPDATE\u306e\u591a\u3044\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u6709\u52b9\u3067\u3059\u304c\u3001\u4e00\u65b9\u3067\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u30fb\u89e3\u6790\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u306f\u4e0d\u5411\u304d\u3067\u3042\u308b\u3068\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u901a\u5e38\u3001\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u306b\u304a\u3044\u3066\u306f\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u5168\u3066\u306e\u5217\u3092\u53c2\u7167\u3059\u308b\u4e8b\u306f\u73cd\u3057\u304f\u3001\u591a\u304f\u306e\u5834\u5408\u306b\u306f\u4e00\u90e8\u306e\u5217\u3060\u3051\u3092\u53c2\u7167\u3059\u308b\u3068\u3044\u3063\u305f\u51e6\u7406\u306b\u306a\u308a\u304c\u3061\u3067\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u5b9f\u969b\u306b\u306f\u53c2\u7167\u3055\u308c\u306a\u3044\u5217\u306e\u30c7\u30fc\u30bf\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u6d88\u8cbb\u3055\u308c\u308bI/O\u306e\u5e2f\u57df\u306f\u5168\u304f\u7121\u99c4\u3067\u3059\u304c\u3001\u884c\u5358\u4f4d\u3067\u7de8\u6210\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u7279\u5b9a\u306e\u5217\u3060\u3051\u3092\u53d6\u308a\u51fa\u3059\u3068\u3044\u3046\u64cd\u4f5c\u306f\u56f0\u96e3\u3067\u3059\u3002 \u9006\u306b\u5217\u5358\u4f4d\u3067\u30c7\u30fc\u30bf\u3092\u7de8\u6210\u3057\u305f\u5834\u5408\u3001INSERT\u3084UPDATE\u306e\u591a\u3044\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u3057\u3066\u306f\u6975\u7aef\u306b\u4e0d\u5229\u3067\u3059\u304c\u3001\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u30fb\u89e3\u6790\u3092\u884c\u3046\u969b\u306b\u306f\u88ab\u53c2\u7167\u5217\u3060\u3051\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089\u30ed\u30fc\u30c9\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308b\u305f\u3081\u3001I/O\u306e\u5e2f\u57df\u3092\u6700\u5927\u9650\u306b\u6d3b\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u307e\u305f\u30d7\u30ed\u30bb\u30c3\u30b5\u306e\u51e6\u7406\u52b9\u7387\u306e\u89b3\u70b9\u304b\u3089\u3082\u3001\u5217\u5358\u4f4d\u306b\u7de8\u6210\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306f\u5358\u7d14\u306a\u914d\u5217\u3067\u3042\u308b\u304b\u306e\u3088\u3046\u306b\u898b\u3048\u308b\u305f\u3081\u3001GPU\u306b\u3068\u3063\u3066\u306fCoalesced Memory Access\u3068\u3044\u3046\u30e1\u30e2\u30ea\u30d0\u30b9\u306e\u6027\u80fd\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059\u30a2\u30af\u30bb\u30b9\u30d1\u30bf\u30fc\u30f3\u3068\u306a\u308b\u4e8b\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002","title":"\u6982\u8981"},{"location":"arrow_fdw/#apache-arrow_1","text":"Apache Arrow\u3068\u306f\u3001\u69cb\u9020\u5316\u30c7\u30fc\u30bf\u3092\u5217\u5f62\u5f0f\u3067\u8a18\u9332\u3001\u4ea4\u63db\u3059\u308b\u305f\u3081\u306e\u30c7\u30fc\u30bf\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u3059\u3002 \u4e3b\u306b\u30d3\u30c3\u30b0\u30c7\u30fc\u30bf\u51e6\u7406\u306e\u305f\u3081\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u307b\u304b\u3001C\u3084C++\u3001Python\u306a\u3069\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u5411\u3051\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u6574\u5099\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u81ea\u4f5c\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089Apache Arrow\u5f62\u5f0f\u3092\u6271\u3046\u3088\u3046\u8a2d\u8a08\u3059\u308b\u4e8b\u3082\u5bb9\u6613\u3067\u3059\u3002 Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u90e8\u306b\u306f\u3001\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u5b9a\u7fa9\u3059\u308b\u30b9\u30ad\u30fc\u30de\uff08Schema\uff09\u90e8\u5206\u3068\u3001\u30b9\u30ad\u30fc\u30de\u306b\u57fa\u3065\u3044\u3066\u5217\u30c7\u30fc\u30bf\u3092\u8a18\u9332\u3059\u308b1\u500b\u4ee5\u4e0a\u306e\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\uff08RecordBatch\uff09\u90e8\u5206\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u578b\u3068\u3057\u3066\u306f\u3001\u6574\u6570\u3084\u6587\u5b57\u5217\uff08\u53ef\u5909\u9577\uff09\u3001\u65e5\u4ed8\u6642\u523b\u578b\u306a\u3069\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u500b\u3005\u306e\u5217\u30c7\u30fc\u30bf\u306f\u3053\u308c\u3089\u30c7\u30fc\u30bf\u578b\u306b\u5fdc\u3058\u305f\u5185\u90e8\u8868\u73fe\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 Apache Arrow\u5f62\u5f0f\u306b\u304a\u3051\u308b\u30c7\u30fc\u30bf\u8868\u73fe\u306f\u3001\u5fc5\u305a\u3057\u3082\u5168\u3066\u306e\u5834\u5408\u3067PostgreSQL\u306e\u30c7\u30fc\u30bf\u8868\u73fe\u3068\u4e00\u81f4\u3057\u3066\u3044\u308b\u8a33\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070\u3001Arrow\u5f62\u5f0f\u3067\u306f\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b\u306e\u30a8\u30dd\u30c3\u30af\u306f 1970-01-01 \u3067\u8907\u6570\u306e\u7cbe\u5ea6\u3092\u6301\u3064\u4e8b\u304c\u3067\u304d\u307e\u3059\u304c\u3001PostgreSQL\u306e\u30a8\u30dd\u30c3\u30af\u306f 2001-01-01 \u3067\u30de\u30a4\u30af\u30ed\u79d2\u306e\u7cbe\u5ea6\u3092\u6301\u3061\u307e\u3059\u3002 Arrow_Fdw\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u7528\u3044\u3066Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092PostgreSQL\u4e0a\u3067\u8aad\u307f\u51fa\u3059\u4e8b\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u5217\u3054\u3068\u306b100\u4e07\u4ef6\u306e\u5217\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\u30928\u500b\u5185\u5305\u3059\u308bArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092Arrow_Fdw\u3092\u7528\u3044\u3066\u30de\u30c3\u30d7\u3057\u305f\u5834\u5408\u3001\u3053\u306e\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u4ecb\u3057\u3066Arrow\u30d5\u30a1\u30a4\u30eb\u4e0a\u306e800\u4e07\u4ef6\u306e\u30c7\u30fc\u30bf\u3078\u30a2\u30af\u30bb\u30b9\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002","title":"Apache Arrow\u3068\u306f"},{"location":"arrow_fdw/#_2","text":"","title":"\u904b\u7528"},{"location":"arrow_fdw/#_3","text":"\u901a\u5e38\u3001\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e3\u30b9\u30c6\u30c3\u30d7\u304c\u5fc5\u8981\u3067\u3059\u3002 CREATE FOREIGN DATA WRAPPER \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u5916\u90e8\u30c7\u30fc\u30bf\u30e9\u30c3\u30d1\u3092\u5b9a\u7fa9\u3059\u308b CREATE SERVER \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u5916\u90e8\u30b5\u30fc\u30d0\u3092\u5b9a\u7fa9\u3059\u308b CREATE FOREIGN TABLE \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u5b9a\u7fa9\u3059\u308b \u3053\u306e\u3046\u3061\u3001\u6700\u521d\u306e2\u30b9\u30c6\u30c3\u30d7\u306f CREATE EXTENSION pg_strom \u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u306b\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u500b\u5225\u306b\u5b9f\u884c\u304c\u5fc5\u8981\u306a\u306e\u306f\u6700\u5f8c\u306e CREATE FOREIGN TABLE \u306e\u307f\u3067\u3059\u3002 CREATE FOREIGN TABLE flogdata ( ts timestamp, sensor_id int, signal1 smallint, signal2 smallint, signal3 smallint, signal4 smallint, ) SERVER arrow_fdw OPTIONS (file '/path/to/logdata.arrow'); CREATE FOREIGN TABLE \u69cb\u6587\u3067\u6307\u5b9a\u3057\u305f\u5217\u306e\u30c7\u30fc\u30bf\u578b\u306f\u3001\u30de\u30c3\u30d7\u3059\u308bArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3068\u53b3\u5bc6\u306b\u4e00\u81f4\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u308c\u4ee5\u5916\u306b\u3082\u3001Arrow_Fdw\u306f IMPORT FOREIGN SCHEMA \u69cb\u6587\u3092\u7528\u3044\u305f\u4fbf\u5229\u306a\u65b9\u6cd5\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u6301\u3064\u30b9\u30ad\u30fc\u30de\u60c5\u5831\u3092\u5229\u7528\u3057\u3066\u3001\u81ea\u52d5\u7684\u306b\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9\u3092\u751f\u6210\u3059\u308b\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u540d\u3068\u30a4\u30f3\u30dd\u30fc\u30c8\u5148\u306e\u30b9\u30ad\u30fc\u30de\u3001\u304a\u3088\u3073OPTION\u53e5\u3067Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u306b\u306f\u3001\u5217\u3054\u3068\u306e\u30c7\u30fc\u30bf\u578b\u3068\u5217\u540d\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\uff09\u304c\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u3053\u308c\u3092\u7528\u3044\u3066\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u5b9a\u7fa9\u3092\u884c\u3044\u307e\u3059\u3002 IMPORT FOREIGN SCHEMA flogdata FROM SERVER arrow_fdw INTO public OPTIONS (file '/path/to/logdata.arrow');","title":"\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u5b9a\u7fa9"},{"location":"arrow_fdw/#_4","text":"Arrow_Fdw\u306f\u4ee5\u4e0b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002\u73fe\u72b6\u3001\u5168\u3066\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u6307\u5b9a\u3059\u308b\u3082\u306e\u3067\u3059\u3002 file=PATHNAME \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3059\u308bArrow\u30d5\u30a1\u30a4\u30eb\u30921\u500b\u6307\u5b9a\u3057\u307e\u3059\u3002 files=PATHNAME1[,PATHNAME2...] \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3059\u308bArrow\u30d5\u30a1\u30a4\u30eb\u3092\u30ab\u30f3\u30de(,\uff09\u533a\u5207\u308a\u3067\u8907\u6570\u6307\u5b9a\u3057\u307e\u3059\u3002 dir=DIRNAME \u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u5168\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3057\u307e\u3059\u3002 suffix=SUFFIX dir \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u6307\u5b9a\u6642\u3001\u4f8b\u3048\u3070 .arrow \u306a\u3069\u3001\u7279\u5b9a\u306e\u63a5\u5c3e\u53e5\u3092\u6301\u3064\u30d5\u30a1\u30a4\u30eb\u3060\u3051\u3092\u30de\u30c3\u30d7\u3057\u307e\u3059\u3002 parallel_workers=N_WORKERS \u3053\u306e\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u4e26\u5217\u30b9\u30ad\u30e3\u30f3\u306b\u4f7f\u7528\u3059\u308b\u4e26\u5217\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306e\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u4e00\u822c\u7684\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u304a\u3051\u308b parallel_workers \u30b9\u30c8\u30ec\u30fc\u30b8\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u540c\u7b49\u306e\u610f\u5473\u3092\u6301\u3061\u307e\u3059\u3002 writable=(true|false) \u3053\u306e\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b INSERT \u6587\u306e\u5b9f\u884c\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002\u8a73\u7d30\u306f\u300e\u66f8\u304d\u8fbc\u307f\u53ef\u80fdArrow_Fdw\u300f\u306e\u7bc0\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u30aa\u30d7\u30b7\u30e7\u30f3"},{"location":"arrow_fdw/#_5","text":"Arrow\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u578b\u3068\u3001PostgreSQL\u306e\u30c7\u30fc\u30bf\u578b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 Int bitWidth \u5c5e\u6027\u306e\u5024\u306b\u5fdc\u3058\u3066\u3001\u305d\u308c\u305e\u308c int1 \u3001 int2 \u3001 int4 \u3001 int8 \u306e\u3044\u305a\u308c\u304b\u306b\u5bfe\u5fdc\u3002 is_signed \u5c5e\u6027\u306e\u5024\u306f\u7121\u8996\u3055\u308c\u307e\u3059\u3002 int1 \u306fPG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 FloatingPoint precision \u5c5e\u6027\u306e\u5024\u306b\u5fdc\u3058\u3066\u3001\u305d\u308c\u305e\u308c float2 \u3001 float4 \u3001 float8 \u306e\u3044\u305a\u308c\u304b\u306b\u5bfe\u5fdc\u3002 float2 \u306fPG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 Binary bytea \u578b\u306b\u5bfe\u5fdc Decimal numeric \u578b\u306b\u5bfe\u5fdc Date date \u578b\u306b\u5bfe\u5fdc\u3002 unit=Day \u76f8\u5f53\u3068\u306a\u308b\u3088\u3046\u306b\u88dc\u6b63\u3055\u308c\u308b\u3002 Time time \u578b\u306b\u5bfe\u5fdc\u3002 unit=MicroSecond \u76f8\u5f53\u306b\u306a\u308b\u3088\u3046\u306b\u88dc\u6b63\u3055\u308c\u308b\u3002 Timestamp timestamp \u578b\u306b\u5bfe\u5fdc\u3002 unit=MicroSecond \u76f8\u5f53\u306b\u306a\u308b\u3088\u3046\u306b\u88dc\u6b63\u3055\u308c\u308b\u3002 Interval interval \u578b\u306b\u5bfe\u5fdc List \u8981\u7d20\u578b\u306e1\u6b21\u5143\u914d\u5217\u578b\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u308b\u3002 Struct \u8907\u5408\u578b\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u308b\u3002\u5bfe\u5fdc\u3059\u308b\u8907\u5408\u578b\u306f\u4e88\u3081\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002 FixedSizeBinary byteWidth \u5c5e\u6027\u306e\u5024\u306b\u5fdc\u3058\u3066 char(n) \u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u308b\u3002 \u30e1\u30bf\u30c7\u30fc\u30bf pg_type=TYPENAME \u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u8a72\u5f53\u3059\u308b\u30c7\u30fc\u30bf\u578b\u3092\u5272\u308a\u5f53\u3066\u308b\u5834\u5408\u304c\u3042\u308b\u3002\u73fe\u6642\u70b9\u3067\u306f\u3001 inet \u304a\u3088\u3073 macaddr \u578b\u3002 Union \u3001 Map \u3001 Duration \u3001 LargeBinary \u3001 LargeUtf8 \u3001 LargeList \u73fe\u6642\u70b9\u3067\u306fPostgreSQL\u30c7\u30fc\u30bf\u578b\u3078\u306e\u5bfe\u5fdc\u306f\u306a\u3057\u3002","title":"\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc"},{"location":"arrow_fdw/#explain","text":"EXPLAIN \u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u3066\u3001Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u51fa\u3057\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u7d04503GB\u306e\u5927\u304d\u3055\u3092\u6301\u3064Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u30de\u30c3\u30d7\u3057\u305ff_lineorder\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u542b\u3080\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u306e\u51fa\u529b\u3067\u3059\u3002 =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) -> Custom Scan (GpuPreAgg) on f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..78.95 rows=365 width=4) Filter: (d_year = 1993) (12 rows) \u3053\u308c\u3092\u898b\u308b\u3068Custom Scan (GpuPreAgg)\u304c f_lineorder \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3066\u3044\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 file0 \u306b\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u80cc\u5f8c\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u540d /opt/nvme/f_lineorder_s999.arrow \u3068\u305d\u306e\u30b5\u30a4\u30ba\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u30de\u30c3\u30d7\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306b\u306f\u3001 file1 \u3001 file2 \u3001... \u3068\u5404\u30d5\u30a1\u30a4\u30eb\u6bce\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002 referenced \u306b\u306f\u5b9f\u969b\u306b\u53c2\u7167\u3055\u308c\u3066\u3044\u308b\u5217\u306e\u4e00\u89a7\u304c\u5217\u6319\u3055\u308c\u3066\u304a\u308a\u3001\u3053\u306e\u30af\u30a8\u30ea\u306b\u304a\u3044\u3066\u306f lo_orderdate \u3001 lo_quantity \u3001 lo_extendedprice \u304a\u3088\u3073 lo_discount \u5217\u304c\u53c2\u7167\u3055\u308c\u3066\u3044\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 \u307e\u305f\u3001 GPU-Direct SQL: enabled (GPU-0) \u306e\u8868\u793a\u304c\u3042\u308b\u4e8b\u304b\u3089\u3001 f_lineorder \u306e\u30b9\u30ad\u30e3\u30f3\u306b\u306fGPU-Direct SQL\u6a5f\u69cb\u304c\u7528\u3044\u3089\u308c\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002 VERBOSE\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u4e0e\u3059\u308b\u4e8b\u3067\u3001\u3088\u308a\u8a73\u7d30\u306a\u60c5\u5831\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002 =# EXPLAIN VERBOSE SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) Output: pgstrom.sum_int((pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint))) -> Custom Scan (GpuPreAgg) on public.f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) Output: (pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint)) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) lo_orderdate: 22.35GB lo_quantity: 22.35GB lo_extendedprice: 22.35GB lo_discount: 22.35GB GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , , , KVecs-Buffer: nbytes: 51200, ndims: 3, items=[kvec0=<0x0000-27ff, type='int4', expr='lo_discount'>, kvec1=<0x2800-4fff, type='int4', expr='lo_quantity'>, kvec2=<0x5000-77ff, type='int4', expr='lo_extendedprice'>, kvec3=<0x7800-9fff, type='int4', expr='lo_orderdate'>, kvec4=<0xa000-c7ff, type='int4', expr='d_datekey'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, , , ]}, items[1]={LoadVars(depth=1): kvars=[]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, , ]}}, items[1]={MoveVars(depth=1): items=[, ]}}} Scan Quals OpCode: {Bool::AND args=[{Func(bool)::int4ge args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='1'}]}, {Func(bool)::int4le args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='3'}]}, {Func(bool)::int4lt args=[{Var(int4): slot=1, expr='lo_quantity'}, {Const(int4): value='25'}]}]} Join Quals OpCode: {Packed items[1]={JoinQuals: {Func(bool)::int4eq args=[{Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}, {Var(int4): slot=5, expr='d_datekey'}]}}} Join HashValue OpCode: {Packed items[1]={HashValue arg={Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}}} Partial Aggregation OpCode: {AggFuncs arg={SaveExpr: arg={Func(int8)::int8 arg={Func(int4)::int4mul args=[{Var(int4): kvec=0x5000-7800, expr='lo_extendedprice'}, {Var(int4): kvec=0x0000-2800, expr='lo_discount'}]}}}} Partial Function BufSz: 16 -> Seq Scan on public.date1 (cost=0.00..78.95 rows=365 width=4) Output: date1.d_datekey Filter: (date1.d_year = 1993) (28 rows) \u88ab\u53c2\u7167\u5217\u3092\u30ed\u30fc\u30c9\u3059\u308b\u969b\u306b\u8aad\u307f\u51fa\u3059\u3079\u304d\u5217\u30c7\u30fc\u30bf\u306e\u5927\u304d\u3055\u3092\u3001\u5217\u3054\u3068\u306b\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002 lo_orderdate \u3001 lo_quantity \u3001 lo_extendedprice \u304a\u3088\u3073 lo_discount \u5217\u306e\u30ed\u30fc\u30c9\u306b\u306f\u5408\u8a08\u306789.41GB\u306e\u8aad\u307f\u51fa\u3057\u304c\u5fc5\u8981\u3067\u3001\u3053\u308c\u306f\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba502.93GB\u306e17.8%\u306b\u76f8\u5f53\u3057\u307e\u3059\u3002","title":"EXPLAIN\u51fa\u529b\u306e\u8aad\u307f\u65b9"},{"location":"arrow_fdw/#arrow","text":"\u672c\u7bc0\u3067\u306f\u3001\u65e2\u306bPostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u3092Apache Arrow\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002","title":"Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u65b9\u6cd5"},{"location":"arrow_fdw/#pyarrowpandas","text":"Arrow\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u304c\u958b\u767a\u3092\u884c\u3063\u3066\u3044\u308b PyArrow \u30e2\u30b8\u30e5\u30fc\u30eb\u3068Pandas\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306e\u7d44\u5408\u305b\u3092\u7528\u3044\u3066\u3001PostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5185\u5bb9\u3092Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u3068\u66f8\u304d\u51fa\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u30c6\u30fc\u30d6\u30ebt0\u306b\u683c\u7d0d\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u5168\u3066\u8aad\u8fbc\u307f\u3001\u30d5\u30a1\u30a4\u30eb/tmp/t0.arrow\u3078\u3068\u66f8\u304d\u51fa\u3059\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002 import pyarrow as pa import pandas as pd X = pd.read_sql(sql=\"SELECT * FROM t0\", con=\"postgresql://localhost/postgres\") Y = pa.Table.from_pandas(X) f = pa.RecordBatchFileWriter('/tmp/t0.arrow', Y.schema) f.write_table(Y,1000000) # RecordBatch for each million rows f.close() \u305f\u3060\u3057\u4e0a\u8a18\u306e\u65b9\u6cd5\u306f\u3001SQL\u3092\u4ecb\u3057\u3066PostgreSQL\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5185\u5bb9\u3092\u4e00\u5ea6\u30e1\u30e2\u30ea\u306b\u4fdd\u6301\u3059\u308b\u305f\u3081\u3001\u5927\u91cf\u306e\u884c\u3092\u4e00\u5ea6\u306b\u5909\u63db\u3059\u308b\u5834\u5408\u306b\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002","title":"PyArrow+Pandas"},{"location":"arrow_fdw/#pg2arrow","text":"\u4e00\u65b9\u3001PG-Strom Development Team\u304c\u958b\u767a\u3092\u884c\u3063\u3066\u3044\u308b pg2arrow \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001PostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5185\u5bb9\u3092Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u3068\u66f8\u304d\u51fa\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u3053\u306e\u30c4\u30fc\u30eb\u306f\u6bd4\u8f03\u7684\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092NVME-SSD\u306a\u3069\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u66f8\u304d\u51fa\u3059\u4e8b\u3092\u5ff5\u982d\u306b\u8a2d\u8a08\u3055\u308c\u3066\u304a\u308a\u3001PostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089 -s|--segment-size \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u305f\u30b5\u30a4\u30ba\u306e\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3059\u305f\u3073\u306b\u3001Arrow\u5f62\u5f0f\u306e\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\uff08Record Batch\uff09\u3068\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30e1\u30e2\u30ea\u6d88\u8cbb\u91cf\u306f\u6bd4\u8f03\u7684\u30ea\u30fc\u30ba\u30ca\u30d6\u30eb\u306a\u5024\u3068\u306a\u308a\u307e\u3059\u3002 pg2arrow \u30b3\u30de\u30f3\u30c9\u306fPG-Strom\u306b\u540c\u68b1\u3055\u308c\u3066\u304a\u308a\u3001PostgreSQL\u95a2\u9023\u30b3\u30de\u30f3\u30c9\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002 $ pg2arrow --help Usage: pg2arrow [OPTION] [database] [username] General options: -d, --dbname=DBNAME Database name to connect to -c, --command=COMMAND SQL command to run -t, --table=TABLENAME Equivalent to '-c SELECT * FROM TABLENAME' (-c and -t are exclusive, either of them must be given) --inner-join=SUB_COMMAND --outer-join=SUB_COMMAND -o, --output=FILENAME result file in Apache Arrow format --append=FILENAME result Apache Arrow file to be appended (--output and --append are exclusive. If neither of them are given, it creates a temporary file.) -S, --stat[=COLUMNS] embeds min/max statistics for each record batch COLUMNS is a comma-separated list of the target columns if partially enabled. Arrow format options: -s, --segment-size=SIZE size of record batch for each Connection options: -h, --host=HOSTNAME database server host -p, --port=PORT database server port -u, --user=USERNAME database user name -w, --no-password never prompt for password -W, --password force password prompt Other options: --dump=FILENAME dump information of arrow file --progress shows progress of the job --set=NAME:VALUE config option to set before SQL execution --help shows this message Report bugs to . PostgreSQL\u3078\u306e\u63a5\u7d9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306fpsql\u3084pg_dump\u3068\u540c\u69d8\u306b\u3001 -h \u3084 -U \u306a\u3069\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002 \u57fa\u672c\u7684\u306a\u30b3\u30de\u30f3\u30c9\u306e\u4f7f\u7528\u65b9\u6cd5\u306f\u3001 -c|--command \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u305fSQL\u3092PostgreSQL\u4e0a\u3067\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092 -o|--output \u3067\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3078Arrow\u5f62\u5f0f\u3067\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002 -o|--output \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u4ee3\u308f\u308a\u306b --append \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u3053\u308c\u306f\u65e2\u5b58\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u8ffd\u8a18\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u8ffd\u8a18\u3055\u308c\u308bApache Arrow\u30d5\u30a1\u30a4\u30eb\u306f\u6307\u5b9a\u3057\u305fSQL\u306e\u5b9f\u884c\u7d50\u679c\u3068\u5b8c\u5168\u306b\u4e00\u81f4\u3059\u308b\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u6301\u305f\u306d\u3070\u306a\u308a\u307e\u305b\u3093\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u30c6\u30fc\u30d6\u30eb t0 \u306b\u683c\u7d0d\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u5168\u3066\u8aad\u8fbc\u307f\u3001\u30d5\u30a1\u30a4\u30eb /tmp/t0.arrow \u3078\u3068\u66f8\u304d\u51fa\u3059\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002 $ pg2arrow -U kaigai -d postgres -c \"SELECT * FROM t0\" -o /tmp/t0.arrow \u958b\u767a\u8005\u5411\u3051\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u304c\u3001 --dump \u3067Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3084\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\u306e\u4f4d\u7f6e\u3068\u30b5\u30a4\u30ba\u3092\u53ef\u8aad\u306a\u5f62\u5f0f\u3067\u51fa\u529b\u3059\u308b\u4e8b\u3082\u3067\u304d\u307e\u3059\u3002 --progress \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u51e6\u7406\u306e\u9014\u4e2d\u7d4c\u904e\u3092\u8868\u793a\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002\u3053\u308c\u306f\u5de8\u5927\u306a\u30c6\u30fc\u30d6\u30eb\u3092Apache Arrow\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u969b\u306b\u6709\u7528\u3067\u3059\u3002","title":"Pg2Arrow"},{"location":"arrow_fdw/#_6","text":"","title":"\u5148\u9032\u7684\u306a\u4f7f\u3044\u65b9"},{"location":"arrow_fdw/#ssdtogpusql","text":"Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3055\u308c\u305f\u5168\u3066\u306eArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u304c\u4ee5\u4e0b\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u5834\u5408\u306b\u306f\u3001\u5217\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u51fa\u3057\u306bSSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u304cNVME-SSD\u533a\u753b\u4e0a\u306b\u7f6e\u304b\u308c\u3066\u3044\u308b\u3002 NVME-SSD\u533a\u753b\u306fExt4\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3067\u69cb\u7bc9\u3055\u308c\u3066\u3044\u308b\u3002 Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u7dcf\u8a08\u304c pg_strom.nvme_strom_threshold \u8a2d\u5b9a\u3092\u4e0a\u56de\u3063\u3066\u3044\u308b\u3002","title":"SSDtoGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL"},{"location":"arrow_fdw/#_7","text":"Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u4e00\u90e8\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u901a\u5e38\u306ePostgreSQL\u30c6\u30fc\u30d6\u30eb\u3068\u6df7\u5728\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306f\u66f8\u304d\u8fbc\u307f\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u4e8b\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u307e\u305f\u3001\u30de\u30c3\u30d7\u3055\u308c\u305fArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306b\u542b\u307e\u308c\u308b\u30c7\u30fc\u30bf\u306f\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5883\u754c\u6761\u4ef6\u3068\u77db\u76fe\u3057\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u8005\u306e\u8cac\u4efb\u3067\u3059\u3002 \u5178\u578b\u7684\u306a\u5229\u7528\u30b7\u30fc\u30f3\u306f\u3001\u9577\u671f\u9593\u306b\u308f\u305f\u308a\u84c4\u7a4d\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u51e6\u7406\u3067\u3059\u3002 \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u3068\u7570\u306a\u308a\u3001\u4e00\u822c\u7684\u306b\u30ed\u30b0\u30c7\u30fc\u30bf\u306f\u4e00\u5ea6\u8a18\u9332\u3055\u308c\u305f\u3089\u305d\u306e\u5f8c\u66f4\u65b0\u524a\u9664\u3055\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u3057\u305f\u304c\u3063\u3066\u3001\u4e00\u5b9a\u671f\u9593\u304c\u7d4c\u904e\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306f\u3001\u8aad\u307f\u51fa\u3057\u5c02\u7528\u3067\u306f\u3042\u308b\u3082\u306e\u306e\u96c6\u8a08\u51e6\u7406\u304c\u9ad8\u901f\u306aArrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u79fb\u3057\u66ff\u3048\u308b\u3053\u3068\u3067\u3001\u96c6\u8a08\u30fb\u89e3\u6790\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u51e6\u7406\u52b9\u7387\u3092\u5f15\u304d\u4e0a\u3052\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u30ed\u30b0\u30c7\u30fc\u30bf\u306b\u306f\u307b\u307c\u9593\u9055\u3044\u306a\u304f\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u304c\u4ed8\u4e0e\u3055\u308c\u3066\u3044\u308b\u4e8b\u304b\u3089\u3001\u6708\u5358\u4f4d\u3001\u9031\u5358\u4f4d\u306a\u3069\u3001\u4e00\u5b9a\u671f\u9593\u3054\u3068\u306b\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u8ffd\u52a0\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001PostgreSQL\u30c6\u30fc\u30d6\u30eb\u3068Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u6df7\u5728\u3055\u305b\u305f\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3092\u5b9a\u7fa9\u3057\u305f\u3082\u306e\u3067\u3059\u3002 \u66f8\u304d\u8fbc\u307f\u304c\u53ef\u80fd\u306aPostgreSQL\u30c6\u30fc\u30d6\u30eb\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3068\u3057\u3066\u6307\u5b9a\u3057\u3066\u304a\u304f\u4e8b\u3067\u3001\u4e00\u5b9a\u671f\u9593\u306e\u7d4c\u904e\u5f8c\u3001DB\u904b\u7528\u3092\u7d99\u7d9a\u3057\u306a\u304c\u3089\u904e\u53bb\u306e\u30ed\u30b0\u30c7\u30fc\u30bf\u3060\u3051\u3092Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3078\u79fb\u3059\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 CREATE TABLE lineorder ( lo_orderkey numeric, lo_linenumber integer, lo_custkey numeric, lo_partkey integer, lo_suppkey numeric, lo_orderdate integer, lo_orderpriority character(15), lo_shippriority character(1), lo_quantity numeric, lo_extendedprice numeric, lo_ordertotalprice numeric, lo_discount numeric, lo_revenue numeric, lo_supplycost numeric, lo_tax numeric, lo_commit_date character(8), lo_shipmode character(10) ) PARTITION BY RANGE (lo_orderdate); CREATE TABLE lineorder__now PARTITION OF lineorder default; CREATE FOREIGN TABLE lineorder__1993 PARTITION OF lineorder FOR VALUES FROM (19930101) TO (19940101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1993.arrow'); CREATE FOREIGN TABLE lineorder__1994 PARTITION OF lineorder FOR VALUES FROM (19940101) TO (19950101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1994.arrow'); CREATE FOREIGN TABLE lineorder__1995 PARTITION OF lineorder FOR VALUES FROM (19950101) TO (19960101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1995.arrow'); CREATE FOREIGN TABLE lineorder__1996 PARTITION OF lineorder FOR VALUES FROM (19960101) TO (19970101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1996.arrow'); \u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b\u554f\u3044\u5408\u308f\u305b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u691c\u7d22\u6761\u4ef6 lo_orderdate between 19950701 and 19960630 \u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5883\u754c\u6761\u4ef6\u3092\u542b\u3093\u3067\u3044\u308b\u4e8b\u304b\u3089\u3001\u5b50\u30c6\u30fc\u30d6\u30eb lineorder__1993 \u3068 lineorder__1994 \u306f\u691c\u7d22\u5bfe\u8c61\u304b\u3089\u6392\u9664\u3055\u308c\u3001\u4ed6\u306e\u30c6\u30fc\u30d6\u30eb\u3060\u3051\u3092\u8aad\u307f\u51fa\u3059\u3088\u3046\u5b9f\u884c\u8a08\u753b\u304c\u4f5c\u3089\u308c\u3066\u3044\u307e\u3059\u3002 =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM lineorder,date1 WHERE lo_orderdate = d_datekey AND lo_orderdate between 19950701 and 19960630 AND lo_discount between 1 and 3 ABD lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=172088.90..172088.91 rows=1 width=32) -> Hash Join (cost=10548.86..172088.51 rows=77 width=64) Hash Cond: (lineorder__1995.lo_orderdate = date1.d_datekey) -> Append (cost=10444.35..171983.80 rows=77 width=67) -> Custom Scan (GpuScan) on lineorder__1995 (cost=10444.35..33671.87 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1995.arrow (size: 892.57MB) -> Custom Scan (GpuScan) on lineorder__1996 (cost=10444.62..33849.21 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1996.arrow (size: 897.87MB) -> Custom Scan (GpuScan) on lineorder__now (cost=11561.33..104462.33 rows=1 width=18) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash (cost=72.56..72.56 rows=2556 width=4) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=4) (16 rows) \u3053\u306e\u5f8c\u3001 lineorder__now \u30c6\u30fc\u30d6\u30eb\u304b\u30891997\u5e74\u306e\u30c7\u30fc\u30bf\u3092\u629c\u304d\u51fa\u3057\u3001\u3053\u308c\u3092Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u5074\u306b\u79fb\u3059\u306b\u306f\u4ee5\u4e0b\u306e\u64cd\u4f5c\u3092\u884c\u3044\u307e\u3059 $ pg2arrow -d sample -o /opt/tmp/lineorder_1997.arrow \\ -c \"SELECT * FROM lineorder WHERE lo_orderdate between 19970101 and 19971231\" pg2arrow \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u3001 lineorder \u30c6\u30fc\u30d6\u30eb\u304b\u30891997\u5e74\u306e\u30c7\u30fc\u30bf\u3060\u3051\u3092\u629c\u304d\u51fa\u3057\u3066\u3001\u65b0\u3057\u3044Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002 BEGIN; -- -- remove rows in 1997 from the read-writable table -- DELETE FROM lineorder WHERE lo_orderdate BETWEEN 19970101 AND 19971231; -- -- define a new partition leaf which maps log-data in 1997 -- CREATE FOREIGN TABLE lineorder__1997 PARTITION OF lineorder FOR VALUES FROM (19970101) TO (19980101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1997.arrow'); COMMIT; \u3053\u306e\u64cd\u4f5c\u306b\u3088\u308a\u3001PostgreSQL\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b lineorder__now \u304b\u30891997\u5e74\u306e\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3057\u3001\u4ee3\u308f\u308a\u306b\u540c\u4e00\u5185\u5bb9\u306eArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb /opt/tmp/lineorder_1997.arrow \u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb lineorder__1997 \u3068\u3057\u3066\u30de\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002 \u6b63\u78ba\u306b\u306f\u30014KB\uff5e32KB\u306e\u7bc4\u56f2\u3067\u30d3\u30eb\u30c9\u6642\u306b\u6307\u5b9a\u3067\u304d\u307e\u3059 \u21a9","title":"\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u8a2d\u5b9a"},{"location":"brin/","text":"\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5bfe\u5fdc \u6982\u8981 PostgreSQL\u306f\u4f55\u7a2e\u985e\u304b\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5f62\u5f0f\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u9078\u629e\u3055\u308c\u308bB-tree\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u7279\u5b9a\u306e\u5024\u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u3092\u9ad8\u901f\u306b\u691c\u7d22\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002\u3053\u308c\u4ee5\u5916\u306b\u3082\u3001Hash\u3001BRIN\u3001GiST\u3001GIN\u306a\u3069\u7279\u6027\u306e\u7570\u306a\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5f62\u5f0f\u304c\u63d0\u4f9b\u3055\u308c\u3066\u304a\u308a\u3001\u73fe\u5728\u306e\u3068\u3053\u308dPG-Strom\u306fBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u306e\u307f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306b\u304a\u3051\u308b\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u5024\u306a\u3069\u3001\u7269\u7406\u7684\u306b\u8fd1\u508d\u306b\u4f4d\u7f6e\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u540c\u58eb\u304c\u8fd1\u3057\u3044\u5024\u3092\u6301\u3063\u3066\u3044\u308b\u4e8b\u304c\u671f\u5f85\u3067\u304d\u308b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u5bfe\u3057\u3066\u6709\u52b9\u306b\u4f5c\u7528\u3057\u307e\u3059\u3002\u672c\u6765\u306f\u5168\u4ef6\u30b9\u30ad\u30e3\u30f3\u304c\u5fc5\u8981\u306a\u64cd\u4f5c\u3067\u3042\u3063\u3066\u3082\u3001\u660e\u3089\u304b\u306b\u6761\u4ef6\u53e5\u306b\u30de\u30c3\u30c1\u3057\u306a\u3044\u9818\u57df\u3092\u8aad\u307f\u98db\u3070\u3057\u3001\u5168\u4ef6\u30b9\u30ad\u30e3\u30f3\u306b\u4f34\u3046I/O\u91cf\u3092\u524a\u6e1b\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 PG-Strom\u306b\u304a\u3044\u3066\u3082BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u7279\u6027\u3092\u6d3b\u7528\u3057\u3001GPU\u306b\u30ed\u30fc\u30c9\u3059\u3079\u304d\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u306e\u3046\u3061\u660e\u3089\u304b\u306b\u4e0d\u8981\u3067\u3042\u308b\u3082\u306e\u3092\u8aad\u307f\u98db\u3070\u3059\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 \u8a2d\u5b9a BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u7279\u5225\u306a\u8a2d\u5b9a\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002 CREATE INDEX\u69cb\u6587\u3092\u7528\u3044\u3066\u5bfe\u8c61\u5217\u306b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001\u304b\u3064\u3001\u691c\u7d22\u6761\u4ef6\u304cBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u9069\u5408\u3059\u308b\u3082\u306e\u3067\u3042\u308c\u3070\u81ea\u52d5\u7684\u306b\u9069\u7528\u3055\u308c\u307e\u3059\u3002 BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u81ea\u4f53\u306e\u8aac\u660e\u306f\u3001 PostgreSQL\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u4ee5\u4e0b\u306eGUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308a\u3001PG-Strom\u304cBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u30c7\u30d0\u30c3\u30b0\u3084\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u5834\u5408\u3092\u9664\u304d\u3001\u901a\u5e38\u306f\u521d\u671f\u8a2d\u5b9a\u306e\u307e\u307e\u3067\u69cb\u3044\u307e\u305b\u3093\u3002 \u30d1\u30e9\u30e1\u30fc\u30bf\u540d \u578b \u521d\u671f\u5024 \u8aac\u660e pg_strom.enable_brin bool on BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 \u64cd\u4f5c EXPLAIN \u69cb\u6587\u306b\u3088\u308aBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 postgres=# EXPLAIN ANALYZE SELECT * FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' AND cat LIKE '%aaa%'; QUERY PLAN -------------------------------------------------------------------------------- Custom Scan (GpuScan) on dt (cost=94810.93..176275.00 rows=169992 width=44) (actual time=1777.819..1901.537 rows=175277 loops=1) GPU Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date) AND (cat ~~ '%aaa%'::text)) Rows Removed by GPU Filter: 4385491 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 0.529 ms Execution time: 2323.063 ms (7 rows) \u4e0a\u8a18\u306e\u4f8b\u3067\u306f ymd \u5217\u306bBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001 BRIN cond \u306e\u8868\u793a\u306fBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308b\u7d5e\u308a\u8fbc\u307f\u6761\u4ef6\u3092\u3001 BRIN skipped \u306e\u8868\u793a\u306fBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308a\u5b9f\u969b\u306b\u8aad\u307f\u98db\u3070\u3055\u308c\u305f\u30d6\u30ed\u30c3\u30af\u306e\u6570\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002 \u3053\u306e\u4f8b\u3067\u306f424704\u30d6\u30ed\u30c3\u30af\u304c\u8aad\u307f\u98db\u3070\u3055\u308c\u3001\u3055\u3089\u306b\u3001\u8aad\u307f\u8fbc\u3093\u3060\u30d6\u30ed\u30c3\u30af\u306b\u542b\u307e\u308c\u3066\u3044\u308b\u30ec\u30b3\u30fc\u30c9\u306e\u3046\u30614385491\u884c\u304c\u6761\u4ef6\u53e5\u306b\u3088\u3063\u3066\u30d5\u30a3\u30eb\u30bf\u3055\u308c\u305f\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u8ee2\u9001\u306e\u30ed\u30b9\u3092\u6e1b\u3089\u3059\u305f\u3081\u3001GpuJoin\u3084GpuPreAgg\u304c\u76f4\u4e0b\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u3092\u5f15\u304d\u4e0a\u3052\u3001\u81ea\u3089\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u51e6\u7406\u3092\u884c\u3046\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3067\u3082\u3001BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u5229\u7528\u53ef\u80fd\u3067\u3042\u308c\u3070\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308b\u7d5e\u308a\u8fbc\u307f\u3092\u884c\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001GROUP BY\u3092\u542b\u3080\u51e6\u7406\u3067BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u30b1\u30fc\u30b9\u3067\u3059\u3002 postgres=# EXPLAIN ANALYZE SELECT cat,count(*) FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=6149.78..6151.86 rows=26 width=12) (actual time=427.482..427.499 rows=26 loops=1) Group Key: cat -> Sort (cost=6149.78..6150.24 rows=182 width=12) (actual time=427.465..427.467 rows=26 loops=1) Sort Key: cat Sort Method: quicksort Memory: 26kB -> Custom Scan (GpuPreAgg) on dt (cost=6140.68..6142.95 rows=182 width=12) (actual time=427.331..427.339 rows=26 loops=1) Reduction: Local Outer Scan: dt (cost=4000.00..4011.99 rows=4541187 width=4) (actual time=78.573..415.961 rows=4560768 loops=1) Outer Scan Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) Rows Removed by Outer Scan Filter: 15564 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 30.992 ms Execution time: 818.994 ms (14 rows)","title":"BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9"},{"location":"brin/#_1","text":"","title":"\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5bfe\u5fdc"},{"location":"brin/#_2","text":"PostgreSQL\u306f\u4f55\u7a2e\u985e\u304b\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5f62\u5f0f\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u9078\u629e\u3055\u308c\u308bB-tree\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u7279\u5b9a\u306e\u5024\u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u3092\u9ad8\u901f\u306b\u691c\u7d22\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002\u3053\u308c\u4ee5\u5916\u306b\u3082\u3001Hash\u3001BRIN\u3001GiST\u3001GIN\u306a\u3069\u7279\u6027\u306e\u7570\u306a\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5f62\u5f0f\u304c\u63d0\u4f9b\u3055\u308c\u3066\u304a\u308a\u3001\u73fe\u5728\u306e\u3068\u3053\u308dPG-Strom\u306fBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u306e\u307f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306b\u304a\u3051\u308b\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u5024\u306a\u3069\u3001\u7269\u7406\u7684\u306b\u8fd1\u508d\u306b\u4f4d\u7f6e\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u540c\u58eb\u304c\u8fd1\u3057\u3044\u5024\u3092\u6301\u3063\u3066\u3044\u308b\u4e8b\u304c\u671f\u5f85\u3067\u304d\u308b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u5bfe\u3057\u3066\u6709\u52b9\u306b\u4f5c\u7528\u3057\u307e\u3059\u3002\u672c\u6765\u306f\u5168\u4ef6\u30b9\u30ad\u30e3\u30f3\u304c\u5fc5\u8981\u306a\u64cd\u4f5c\u3067\u3042\u3063\u3066\u3082\u3001\u660e\u3089\u304b\u306b\u6761\u4ef6\u53e5\u306b\u30de\u30c3\u30c1\u3057\u306a\u3044\u9818\u57df\u3092\u8aad\u307f\u98db\u3070\u3057\u3001\u5168\u4ef6\u30b9\u30ad\u30e3\u30f3\u306b\u4f34\u3046I/O\u91cf\u3092\u524a\u6e1b\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 PG-Strom\u306b\u304a\u3044\u3066\u3082BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u7279\u6027\u3092\u6d3b\u7528\u3057\u3001GPU\u306b\u30ed\u30fc\u30c9\u3059\u3079\u304d\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u306e\u3046\u3061\u660e\u3089\u304b\u306b\u4e0d\u8981\u3067\u3042\u308b\u3082\u306e\u3092\u8aad\u307f\u98db\u3070\u3059\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002","title":"\u6982\u8981"},{"location":"brin/#_3","text":"BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u7279\u5225\u306a\u8a2d\u5b9a\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002 CREATE INDEX\u69cb\u6587\u3092\u7528\u3044\u3066\u5bfe\u8c61\u5217\u306b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001\u304b\u3064\u3001\u691c\u7d22\u6761\u4ef6\u304cBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u9069\u5408\u3059\u308b\u3082\u306e\u3067\u3042\u308c\u3070\u81ea\u52d5\u7684\u306b\u9069\u7528\u3055\u308c\u307e\u3059\u3002 BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u81ea\u4f53\u306e\u8aac\u660e\u306f\u3001 PostgreSQL\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u4ee5\u4e0b\u306eGUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308a\u3001PG-Strom\u304cBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u30c7\u30d0\u30c3\u30b0\u3084\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u5834\u5408\u3092\u9664\u304d\u3001\u901a\u5e38\u306f\u521d\u671f\u8a2d\u5b9a\u306e\u307e\u307e\u3067\u69cb\u3044\u307e\u305b\u3093\u3002 \u30d1\u30e9\u30e1\u30fc\u30bf\u540d \u578b \u521d\u671f\u5024 \u8aac\u660e pg_strom.enable_brin bool on BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002","title":"\u8a2d\u5b9a"},{"location":"brin/#_4","text":"EXPLAIN \u69cb\u6587\u306b\u3088\u308aBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 postgres=# EXPLAIN ANALYZE SELECT * FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' AND cat LIKE '%aaa%'; QUERY PLAN -------------------------------------------------------------------------------- Custom Scan (GpuScan) on dt (cost=94810.93..176275.00 rows=169992 width=44) (actual time=1777.819..1901.537 rows=175277 loops=1) GPU Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date) AND (cat ~~ '%aaa%'::text)) Rows Removed by GPU Filter: 4385491 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 0.529 ms Execution time: 2323.063 ms (7 rows) \u4e0a\u8a18\u306e\u4f8b\u3067\u306f ymd \u5217\u306bBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001 BRIN cond \u306e\u8868\u793a\u306fBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308b\u7d5e\u308a\u8fbc\u307f\u6761\u4ef6\u3092\u3001 BRIN skipped \u306e\u8868\u793a\u306fBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308a\u5b9f\u969b\u306b\u8aad\u307f\u98db\u3070\u3055\u308c\u305f\u30d6\u30ed\u30c3\u30af\u306e\u6570\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002 \u3053\u306e\u4f8b\u3067\u306f424704\u30d6\u30ed\u30c3\u30af\u304c\u8aad\u307f\u98db\u3070\u3055\u308c\u3001\u3055\u3089\u306b\u3001\u8aad\u307f\u8fbc\u3093\u3060\u30d6\u30ed\u30c3\u30af\u306b\u542b\u307e\u308c\u3066\u3044\u308b\u30ec\u30b3\u30fc\u30c9\u306e\u3046\u30614385491\u884c\u304c\u6761\u4ef6\u53e5\u306b\u3088\u3063\u3066\u30d5\u30a3\u30eb\u30bf\u3055\u308c\u305f\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u8ee2\u9001\u306e\u30ed\u30b9\u3092\u6e1b\u3089\u3059\u305f\u3081\u3001GpuJoin\u3084GpuPreAgg\u304c\u76f4\u4e0b\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u3092\u5f15\u304d\u4e0a\u3052\u3001\u81ea\u3089\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u51e6\u7406\u3092\u884c\u3046\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3067\u3082\u3001BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u5229\u7528\u53ef\u80fd\u3067\u3042\u308c\u3070\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308b\u7d5e\u308a\u8fbc\u307f\u3092\u884c\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001GROUP BY\u3092\u542b\u3080\u51e6\u7406\u3067BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u30b1\u30fc\u30b9\u3067\u3059\u3002 postgres=# EXPLAIN ANALYZE SELECT cat,count(*) FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=6149.78..6151.86 rows=26 width=12) (actual time=427.482..427.499 rows=26 loops=1) Group Key: cat -> Sort (cost=6149.78..6150.24 rows=182 width=12) (actual time=427.465..427.467 rows=26 loops=1) Sort Key: cat Sort Method: quicksort Memory: 26kB -> Custom Scan (GpuPreAgg) on dt (cost=6140.68..6142.95 rows=182 width=12) (actual time=427.331..427.339 rows=26 loops=1) Reduction: Local Outer Scan: dt (cost=4000.00..4011.99 rows=4541187 width=4) (actual time=78.573..415.961 rows=4560768 loops=1) Outer Scan Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) Rows Removed by Outer Scan Filter: 15564 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 30.992 ms Execution time: 818.994 ms (14 rows)","title":"\u64cd\u4f5c"},{"location":"fluentd/","text":"Fluentd\u9023\u643a \u672c\u7ae0\u3067\u306f\u3001Apache Arrow\u30c7\u30fc\u30bf\u5f62\u5f0f\u3092\u4ecb\u3057\u305fFluentd\u3068\u306e\u9023\u643a\u3068\u3001IoT/M2M\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u52b9\u7387\u7684\u306a\u53d6\u308a\u8fbc\u307f\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u6982\u8981 IoT/M2M\u3068\u3088\u3070\u308c\u308b\u6280\u8853\u9818\u57df\u306b\u304a\u3044\u3066\u306f\u3001PC\u3084\u30b5\u30fc\u30d0\u3060\u3051\u3067\u306a\u304f\u3001\u643a\u5e2f\u96fb\u8a71\u3084\u81ea\u52d5\u8eca\u3001\u5404\u7a2e\u30bb\u30f3\u30b5\u30fc\u306a\u3069\u306e\u30c7\u30d0\u30a4\u30b9\u304c\u751f\u6210\u3057\u305f\u5927\u91cf\u306e\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u84c4\u7a4d\u3057\u3001\u3053\u308c\u3092\u5206\u6790\u3059\u308b\u305f\u3081\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c\u6570\u591a\u304f\u958b\u767a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5927\u91cf\u306e\u30c7\u30d0\u30a4\u30b9\u304c\u6642\u3005\u523b\u3005\u3068\u751f\u6210\u3059\u308b\u30c7\u30fc\u30bf\u306f\u975e\u5e38\u306b\u5927\u304d\u306a\u30b5\u30a4\u30ba\u306b\u306a\u308a\u304c\u3061\u3067\u3001\u3053\u308c\u3092\u5b9f\u7528\u7684\u306a\u6642\u9593\u5185\u306b\u51e6\u7406\u3059\u308b\u306b\u306f\u3001\u7279\u5225\u306a\u5de5\u592b\u304c\u5fc5\u8981\u3068\u306a\u308b\u304b\u3089\u3067\u3059\u3002 PG-Strom\u306e\u5404\u7a2e\u6a5f\u80fd\u306f\u3001\u3053\u3046\u3044\u3063\u305f\u898f\u6a21\u306e\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u9ad8\u901f\u306b\u51e6\u7406\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u30fb\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3057\u304b\u3057\u4e00\u65b9\u3067\u3001\u3053\u3046\u3057\u305f\u898f\u6a21\u306e\u30c7\u30fc\u30bf\u306e\u691c\u7d22\u30fb\u96c6\u8a08\u304c\u53ef\u80fd\u306a\u72b6\u614b\u306b\u3059\u308b\u305f\u3081\u306b\u30c7\u30fc\u30bf\u3092\u79fb\u9001\u3057\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u53d6\u308a\u8fbc\u3080\u306b\u306f\u6642\u9593\u304c\u304b\u304b\u308a\u304c\u3061\u3067\u3059\u3002 \u305d\u3053\u3067\u3001PG-Strom\u306b\u306fFluentd\u5411\u3051\u306bApache Arrow\u5f62\u5f0f\u3067\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u51fa\u529b\u3059\u308b fluent-plugin-arrow-file \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u540c\u68b1\u3057\u3001\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u3068\u3044\u3046\u554f\u984c\u306b\u5bfe\u51e6\u3092\u8a66\u307f\u3066\u3044\u307e\u3059\u3002 Fluentd\u306f\u53e4\u6a4b\u8c9e\u4e4b\u6c0f\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u305f\u30ed\u30b0\u53ce\u96c6\u30c4\u30fc\u30eb\u3067\u3001Syslog\u306e\u3088\u3046\u306a\u30b5\u30fc\u30d0\u30ed\u30b0\u304b\u3089IoT/M2M\u6a5f\u5668\u306e\u30c7\u30d0\u30a4\u30b9\u30ed\u30b0\u306b\u81f3\u308b\u307e\u3067\u3001\u591a\u7a2e\u591a\u69d8\u306a\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u96c6\u7a4d\u30fb\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306b\u4e8b\u5b9f\u4e0a\u306e\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u3068\u3057\u3066\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3059\u3002 Ruby\u3067\u8a18\u8ff0\u3055\u308c\u305f\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u8ffd\u52a0\u306b\u3088\u308a\u3001\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u5165\u51fa\u529b\u3084\u52a0\u5de5\u3092\u81ea\u5728\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u30012022\u5e74\u73fe\u5728\u3001800\u7a2e\u985e\u3092\u8d8a\u3048\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u516c\u5f0fWeb\u30b5\u30a4\u30c8\u3067\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002 PG-Strom\u304c\u53d6\u308a\u6271\u3046\u3053\u3068\u306e\u3067\u304d\u308b\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f\u3001PostgreSQL Heap\u5f62\u5f0f\uff08\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30ca\u30eb\u884c\u30c7\u30fc\u30bf\uff09\u3068Apache Arrow\u5f62\u5f0f\uff08\u69cb\u9020\u5316\u5217\u30c7\u30fc\u30bf\uff09\u306e\uff12\u7a2e\u985e\u3067\u3059\u304c\u3001IoT/M2M\u9818\u57df\u3067\u60f3\u5b9a\u3055\u308c\u308b\u3088\u3046\u306a\u3001\u6642\u3005\u523b\u3005\u3068\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u304c\u767a\u751f\u3059\u308b\u3088\u3046\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u3057\u3066\u306f\u3001Apache Arrow\u5f62\u5f0f\u3092\u7528\u3044\u305f\u65b9\u304c\u5408\u7406\u7684\u3067\u3059\u3002 arrow-file \u30d7\u30e9\u30b0\u30a4\u30f3 \u4ee5\u4e0b\u3067\u306f\u3001Fluentd\u304c\u53ce\u96c6\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u3092Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u51fa\u529b\u3057\u3001\u3053\u308c\u3092PG-Strom\u3067\u53c2\u7167\u3059\u308b\u3068\u3044\u3046\u30a2\u30d7\u30ed\u30fc\u30c1\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u307e\u305f\u3001Fluentd\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u306f\u3001Treasure Data\u793e\u306e\u63d0\u4f9b\u3059\u308b\u5b89\u5b9a\u7248 td-agent \u3092\u4f7f\u7528\u3059\u308b\u3082\u306e\u3068\u3057\u307e\u3059\u3002 PG-Strom\u306b\u540c\u68b1\u306eFluentd\u5411\u3051Output\u30d7\u30e9\u30b0\u30a4\u30f3\u306e fluent-plugin-arrow-file \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u5229\u7528\u3059\u308b\u3068\u3001Fluentd\u304c\u53ce\u96c6\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u3001\u6307\u5b9a\u3057\u305f\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u6301\u3064Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u66f8\u304d\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002PG-Strom\u306eArrow_Fdw\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308c\u3070\u3053\u306eApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u53c2\u7167\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u307e\u305f\u4fdd\u5b58\u5148\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u304c\u9069\u5207\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308c\u3070\u3001GPU-Direct SQL\u3092\u7528\u3044\u305f\u9ad8\u901f\u306a\u8aad\u307f\u51fa\u3057\u3082\u53ef\u80fd\u3067\u3059\u3002 \u3053\u306e\u65b9\u6cd5\u306b\u306f\u4ee5\u4e0b\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002 - Fluentd \u304c\u51fa\u529b\u3057\u305f\u30c7\u30fc\u30bf\u3092\u305d\u306e\u307e\u307ePG-Strom\u3067\u8aad\u307f\u51fa\u305b\u308b\u305f\u3081\u3001\u6539\u3081\u3066DB\u3078\u30c7\u30fc\u30bf\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u3002 - \u5217\u30c7\u30fc\u30bf\u5f62\u5f0f\u3067\u3042\u308b\u305f\u3081\u3001\u691c\u7d22\u30fb\u96c6\u8a08\u51e6\u7406\u306b\u4f34\u3046\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u51fa\u3057\uff08I/O\u8ca0\u8377\uff09\u3092\u5fc5\u8981\u6700\u5c0f\u9650\u306b\u6291\u3048\u308b\u4e8b\u304c\u3067\u304d\u308b\u3002 - \u53e4\u304f\u306a\u3063\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u3082\u3001OS\u4e0a\u306e\u30d5\u30a1\u30a4\u30eb\u79fb\u52d5\u306e\u307f\u3067\u5b8c\u4e86\u3067\u304d\u308b\u3002 \u4e00\u65b9\u3067\u3001Apache Arrow\u5f62\u5f0f\u3067\u6027\u80fd\u4e0a\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u5f97\u308b\u306b\u306f\u3001Record Batch\u306e\u30b5\u30a4\u30ba\u3092\u3042\u308b\u7a0b\u5ea6\u5927\u304d\u304f\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u305f\u3081\u3001\u30ed\u30b0\u306e\u767a\u751f\u983b\u5ea6\u304c\u5c0f\u3055\u304f\u3001\u4e00\u5b9a\u30b5\u30a4\u30ba\u306e\u30ed\u30b0\u304c\u6e9c\u307e\u308b\u307e\u3067\u306b\u6642\u9593\u306e\u304b\u304b\u308b\u5834\u5408\u306b\u306f\u3001PostgreSQL\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u51fa\u529b\u3055\u305b\u308b\u306a\u3069\u3001\u5225\u306e\u65b9\u6cd5\u3092\u8a66\u3057\u305f\u65b9\u304c\u3088\u308a\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306b\u8fd1\u3044\u30ed\u30b0\u5206\u6790\u304c\u53ef\u80fd\u3067\u3057\u3087\u3046\u3002 \u5185\u90e8\u69cb\u9020 Fluentd\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u306f\u3044\u304f\u3064\u304b\u30ab\u30c6\u30b4\u30ea\u304c\u3042\u308a\u3001\u5916\u90e8\u304b\u3089\u30ed\u30b0\u3092\u53d7\u3051\u53d6\u308bInput\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u30ed\u30b0\u3092\u6210\u5f62\u3059\u308bParser\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u53d7\u4fe1\u3057\u305f\u30ed\u30b0\u3092\u4e00\u6642\u7684\u306b\u84c4\u7a4d\u3059\u308bBuffer\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u30ed\u30b0\u3092\u51fa\u529b\u3059\u308bOutput\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u306a\u3069\u306e\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u3002 arrow-file\u306fOutput\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4e00\u3064\u3067\u3059\u304c\u3001\u3053\u308c\u306fBuffer\u30d7\u30e9\u30b0\u30a4\u30f3\u304b\u3089\u6e21\u3055\u308c\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u56fa\u307e\u308a(chunk)\u3092\u3001\u30b3\u30f3\u30d5\u30a3\u30b0\u3067\u6307\u5b9a\u3055\u308c\u305f\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u6301\u3064Apache Arrow\u5f62\u5f0f\u3067\u66f8\u304d\u51fa\u3059\u5f79\u5272\u3092\u62c5\u3063\u3066\u3044\u307e\u3059\u3002 Input/Parser\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u5f79\u5272\u306f\u3001\u5916\u90e8\u304b\u3089\u53d7\u3051\u53d6\u3063\u305f\u30ed\u30b0\u3092\u5171\u901a\u306e\u5f62\u5f0f\u306b\u5909\u63db\u3057\u3001Buffer\u30d7\u30e9\u30b0\u30a4\u30f3\u3084Output\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u5165\u529b\u30c7\u30fc\u30bf\u306e\u5f62\u5f0f\u3092\u610f\u8b58\u3059\u308b\u3053\u3068\u306a\u304f\u6271\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u3059\u3002 \u3053\u308c\u306f\u5185\u90e8\u7684\u306b\u306f\u3001\u30ed\u30b0\u306e\u632f\u308a\u5206\u3051\u306b\u5229\u7528\u3059\u308b\u3053\u3068\u306e\u3067\u304d\u308b\u8b58\u5225\u5b50\u306e tag \u3001\u30ed\u30b0\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7 time \u3001\u304a\u3088\u3073\u751f\u30ed\u30b0\u3092\u6210\u5f62\u3057\u305f\u9023\u60f3\u914d\u5217\u3067\u3042\u308b record \u306e\u7d44\u3067\u3059\u3002 arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001 tag \u3001 time \u306e\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u3068\u3001 record \u9023\u60f3\u914d\u5217\u306e\u5404\u8981\u7d20\uff08\u4e00\u90e8\u3092\u7701\u7565\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\uff09\u3092\u5217\u3068\u3057\u3066\u6301\u3064Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u66f8\u304d\u51fa\u3057\u3092\u884c\u3044\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001\u51fa\u529b\u5148\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3068\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u60c5\u5831\uff08\u9023\u60f3\u914d\u5217\u306e\u8981\u7d20\u3068\u5217/\u578b\u306e\u30de\u30c3\u30d4\u30f3\u30b0\uff09\u306f\u5fc5\u9808\u306e\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3059\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u4f7f\u7528\u3057\u3066\u3044\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u7528\u306e td-agent \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u307e\u305f\u3001arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u306f rake-compiler \u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u306e\u3067\u3001\u4e88\u3081\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3059\u3002 \u8a73\u3057\u304f\u306f \u3053\u3061\u3089 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 $ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent4.sh | sh $ sudo /opt/td-agent/bin/fluent-gem install rake-compiler \u6b21\u306b\u3001PG-Strom\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001 fluentd \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u306e\u7269\u4ef6\u3092\u30d3\u30eb\u30c9\u3057\u307e\u3059\u3002 $ git clone https://github.com/heterodb/pg-strom.git $ cd pg-strom/fluentd $ make TD_AGENT=1 gem $ sudo make TD_AGENT=1 install Fluentd\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 $ /opt/td-agent/bin/fluent-gem list | grep arrow fluent-plugin-arrow-file (0.2) \u8a2d\u5b9a \u524d\u8ff0\u306e\u901a\u308a\u3001arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u52d5\u4f5c\u3055\u305b\u308b\u306b\u306f\u3001\u51fa\u529b\u5148\u306e\u30d1\u30b9\u540d\u3068\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u6700\u4f4e\u9650\u5fc5\u8981\u3067\u3059\u3002 \u3053\u308c\u306b\u52a0\u3048\u3066\u3001Apache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u69cb\u9020\u4e0a\u3001Record Batch\u3068\u547c\u3070\u308c\u308b\u30c7\u30fc\u30bf\u306e\u56fa\u307e\u308a\u306f\u3042\u308b\u7a0b\u5ea6\u5927\u304d\u306a\u30b5\u30a4\u30ba\u3067\u533a\u5207\u3063\u3066\u304a\u3044\u305f\u65b9\u304c\u3001\u691c\u7d22\u30fb\u96c6\u8a08\u51e6\u7406\u3092\u884c\u3046\u969b\u306e\u51e6\u7406\u6027\u80fd\u3092\u5f15\u304d\u51fa\u3057\u3084\u3059\u3044\u3067\u3059\u3002 arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001Buffer\u30d7\u30e9\u30b0\u30a4\u30f3\u304b\u3089\u6e21\u3055\u308c\u308bchunk\u3054\u3068\u306bRecord Batch\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u3001Buffer\u30d7\u30e9\u30b0\u30a4\u30f3\u5074\u306e\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u306f\u3053\u308c\u306b\u6e96\u3058\u305f\u8a2d\u5b9a\u3092\u884c\u3046\u3079\u304d\u3067\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f 256MB \u306e\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u3092\u53d6\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 path [type: String ] (\u5fc5\u9808\u30d1\u30e9\u30e1\u30fc\u30bf) arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u30ed\u30b0\u3092\u51fa\u529b\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u5fc5\u9808\u3067\u3001\u4ee5\u4e0b\u306e\u66f8\u5f0f\u6587\u5b57\u3092\u542b\u3081\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u66f8\u5f0f \u8aac\u660e %Y \u73fe\u5728\u306e\u5e74\u3092\u897f\u66a64\u6841\u3067\u8868\u73fe\u3057\u305f\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %y \u73fe\u5728\u306e\u5e74\u306e\u897f\u66a6\u4e0b2\u6841\u3067\u8868\u73fe\u3057\u305f\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %m \u73fe\u5728\u306e\u6708\u3092 01\uff5e12 \u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %d \u73fe\u5728\u306e\u65e5\u3092 01\uff5e31 \u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %H \u73fe\u5728\u6642\u523b\u306e\u6642\u309200\uff5e23\u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %M \u73fe\u5728\u6642\u523b\u306e\u5206\u309200\uff5e59\u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %S \u73fe\u5728\u6642\u523b\u306e\u79d2\u309200\uff5e59\u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %p \u73fe\u5728\u306e Fluentd \u30d7\u30ed\u30bb\u30b9\u306ePID\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 \u66f8\u5f0f\u6587\u5b57\u5217\u306f\u30c1\u30e3\u30f3\u30af\u3092\u66f8\u304d\u51fa\u3059\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u8a55\u4fa1\u3055\u308c\u3001\u540c\u540d\u306eApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306b\u306f\u3001Record Batch\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306fApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u65b0\u898f\u4f5c\u6210\u3057\u3001\u6700\u521d\u306eRecord Batch\u3092\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002 \u305f\u3060\u3057\u3001\u65e2\u5b58\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u304c\u5f8c\u8ff0\u306e filesize_threshold \u8a2d\u5b9a\u5024\u3092\u8d8a\u3048\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u65e2\u5b58\u30d5\u30a1\u30a4\u30eb\u3092\u30ea\u30cd\u30fc\u30e0\u3057\u305f\u5f8c\u3001\u65b0\u898f\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \uff08\u4f8b\uff09`path /tmp/arrow_logs/my_logs_%y%m%d.%p.log` \u51fa\u529b\u5148\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u30c1\u30e3\u30f3\u30af\u3092\u66f8\u304d\u51fa\u3059\u305f\u3073\u306b\u30d5\u30c3\u30bf\u9818\u57df\u3092\u66f4\u65b0\u3057\u3066\u5168\u3066\u306eRecord Batch\u3092\u30dd\u30a4\u30f3\u30c8\u3057\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u751f\u6210\u3055\u308c\u305fApache Arrow\u30d5\u30a1\u30a4\u30eb\u306f\u5373\u5ea7\u306b\u8aad\u307f\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u30a2\u30af\u30bb\u30b9\u7af6\u5408\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u306f lockf(3) \u3092\u7528\u3044\u3066\u6392\u4ed6\u51e6\u7406\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 schema_defs [type: String ] (\u5fc5\u9808\u30d1\u30e9\u30e1\u30fc\u30bf) fluent-plugin-arrow-file \u304c\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u51fa\u529b\u3059\u308b\u969b\u306e\u3001Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u5fc5\u9808\u3067\u3001\u4ee5\u4e0b\u306e\u5f62\u5f0f\u3067\u8a18\u8ff0\u3055\u308c\u305f\u6587\u5b57\u5217\u306b\u3088\u308a\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002 schema_defs := column_def1[,column_def2 ...] column_def := =[;] \u306f\u5217\u306e\u540d\u524d\u3067\u3059\u3002Fluentd\u304b\u3089arrow-file\u306b\u6e21\u3055\u308c\u308b\u9023\u60f3\u914d\u5217\u306e\u30ad\u30fc\u5024\u3068\u4e00\u81f4\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u306f\u5217\u306e\u30c7\u30fc\u30bf\u578b\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u8868\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u306f\u5217\u306e\u4ed8\u52a0\u5c5e\u6027\u3067\u3059\u3002\u73fe\u6642\u70b9\u3067\u306f\u4ee5\u4e0b\u306e\u5c5e\u6027\u306e\u307f\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002 stat_enabled ... \u5217\u306e\u7d71\u8a08\u60c5\u5831\u3092\u53ce\u96c6\u3057\u3001Record Batch\u3054\u3068\u306e\u6700\u5927\u5024/\u6700\u5c0f\u5024\u3092 max_values=... \u304a\u3088\u3073 min_values=... \u30ab\u30b9\u30bf\u30e0\u30e1\u30bf\u30c7\u30fc\u30bf\u3068\u3057\u3066\u57cb\u3081\u8fbc\u307f\u307e\u3059\u3002 \uff08\u4f8b\uff09 schema_defs \"ts=Timestamp;stat_enabled,dev_id=Uint32,temperature=Float32,humidity=Float32\" arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u30c7\u30fc\u30bf\u578b \u30c7\u30fc\u30bf\u578b \u8aac\u660e Int8 Int16 Int32 Int64 \u7b26\u53f7\u4ed8\u304d\u6574\u6570\u578b\u3067\u3001\u305d\u308c\u305e\u308c\u6307\u5b9a\u3057\u305f\u30d3\u30c3\u30c8\u5e45\u3092\u6301\u3061\u307e\u3059\u3002 Uint8 Uint16 Uint32 Uint64 \u7b26\u53f7\u306a\u3057\u6574\u6570\u578b\u3067\u3001\u305d\u308c\u305e\u308c\u6307\u5b9a\u3057\u305f\u30d3\u30c3\u30c8\u5e45\u3092\u6301\u3061\u307e\u3059\u3002 Float16 Float32 Float64 \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3001\u305d\u308c\u305e\u308c\u534a\u7cbe\u5ea6(16bit)\u3001\u5358\u7cbe\u5ea6(32bit)\u3001\u500d\u7cbe\u5ea6(64bit)\u306e\u5e45\u3092\u6301\u3061\u307e\u3059\u3002 Decimal Decimal128 128bit\u56fa\u5b9a\u5c0f\u6570\u70b9\u578b\u3067\u3059\u3002256bit\u56fa\u5b9a\u5c0f\u6570\u70b9\u578b\u306f\u73fe\u5728\u672a\u30b5\u30dd\u30fc\u30c8\u3067\u3059\u3002 Timestamp Timestamp[sec] Timestamp[ms] Timestamp[us] Timestamp[ns] \u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b\u3067\u3059\u3002\u7cbe\u5ea6\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6697\u9ed9\u306b [us] \u3092\u4ed8\u52a0\u3057\u305f\u3082\u306e\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002 Time Time[sec] Time[ms] Time[us] Time[ns] \u6642\u523b\u578b\u3067\u3059\u3002\u7cbe\u5ea6\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6697\u9ed9\u306b [sec] \u3092\u4ed8\u52a0\u3057\u305f\u3082\u306e\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002 Date Date[Day] Date[ms] \u65e5\u4ed8\u578b\u3067\u3059\u3002\u7cbe\u5ea6\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6697\u9ed9\u306b [day] \u3092\u4ed8\u52a0\u3057\u305f\u3082\u306e\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002 Utf8 \u6587\u5b57\u5217\u578b\u3067\u3059\u3002 Ipaddr4 IPv4\u30a2\u30c9\u30ec\u30b9\u578b\u3067\u3059\u3002\u5b9f\u969b\u306b\u306f byteWidth=4 \u3067\u3042\u308b FixedSizeBinary \u578b\u306b\u3001 pg_type=pg_catalog.inet \u3068\u3044\u3046\u30ab\u30b9\u30bf\u30e0\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u4ed8\u4e0e\u3057\u307e\u3059\u3002 Ipaddr6 IPv6\u30a2\u30c9\u30ec\u30b9\u578b\u3067\u3059\u3002\u5b9f\u969b\u306b\u306f byteWidth=16 \u3067\u3042\u308b FixedSizeBinary \u578b\u306b\u3001 pg_type=pg_catalog.inet \u3068\u3044\u3046\u30ab\u30b9\u30bf\u30e0\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u4ed8\u4e0e\u3057\u307e\u3059\u3002 ts_column [type: String / default: \u306a\u3057] \u6307\u5b9a\u3057\u305f\u5217\u306e\u5024\u3092\uff08 record \u9023\u60f3\u914d\u5217\u304b\u3089\u3067\u306f\u306a\u304f\uff09Fluentd\u304b\u3089\u6e21\u3055\u308c\u305f\u30ed\u30b0\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u5024\u3088\u308a\u53d6\u5f97\u3057\u307e\u3059\u3002 \u901a\u5e38\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3059\u308b\u5217\u306f Timestamp \u306a\u3069\u306e\u65e5\u4ed8\u6642\u523b\u578b\u3092\u6301\u3063\u3066\u304a\u308a\u3001\u307e\u305f stat_enabled \u5c5e\u6027\u3068\u4f75\u7528\u3059\u308b\u3053\u3068\u3067\u691c\u7d22\u51e6\u7406\u306e\u9ad8\u901f\u5316\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 tag_column [type: String / default: \u306a\u3057] \u6307\u5b9a\u3057\u305f\u5217\u306e\u5024\u3092\uff08 record \u9023\u60f3\u914d\u5217\u304b\u3089\u3067\u306f\u306a\u304f\uff09Fluentd\u304b\u3089\u6e21\u3055\u308c\u305f\u30ed\u30b0\u306e\u30bf\u30b0\u5024\u3088\u308a\u53d6\u5f97\u3057\u307e\u3059\u3002 \u901a\u5e38\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3059\u308b\u5217\u306f Utf8 \u306a\u3069\u306e\u6587\u5b57\u5217\u578b\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 filesize_threshold [type: Integer / default: 10000] fluent-plugin-arrow-file \u304c\u51fa\u529b\u5148\u30d5\u30a1\u30a4\u30eb\u3092\u5207\u308a\u66ff\u3048\u308b\u95be\u5024\u3092MB\u5358\u4f4d\u3067\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u304c\u7d0410GB\u3092\u8d8a\u3048\u305f\u8fba\u308a\u3067\u51fa\u529b\u5148\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002 \u4f7f\u7528\u4f8b \u7c21\u5358\u306a\u4f8b\u3068\u3057\u3066\u3001\u30ed\u30fc\u30ab\u30eb\u306eApache Httpd\u30b5\u30fc\u30d0\u306e\u30ed\u30b0\u3092\u76e3\u8996\u3057\u3001\u305d\u308c\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u6bce\u306b\u30d1\u30fc\u30b9\u3057\u3066Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002 \u3067 /var/log/httpd/access_log \u3092\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u6307\u5b9a\u3057\u3066\u3044\u308b\u307b\u304b\u3001 apache2 \u306eParse\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u7528\u3044\u3066\u3001host, user, time, method, path, code, size, referer, agent\u306e\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u5207\u308a\u51fa\u3057\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089\u306farrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u9023\u60f3\u914d\u5217\u3068\u3057\u3066\u6e21\u3055\u308c\u3001 \u5185\u306e schema_defs \u306b\u306f\u3001\u3053\u308c\u3089\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u5bfe\u5fdc\u3059\u308bApache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u5217\u5b9a\u7fa9\u3092\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\u3002 \u307e\u305f\u3001\u3053\u3053\u3067\u306f\u7c21\u5358\u306a\u4f7f\u7528\u4f8b\u3092\u793a\u3059\u3053\u3068\u304c\u76ee\u7684\u3067\u3059\u306e\u3067\u3001 \u30bf\u30b0\u3067\u30c1\u30e3\u30f3\u30af\u30b5\u30a4\u30ba\u3092\u6700\u59274MB / 200\u884c\u306b\u7e2e\u5c0f\u3057\u3001\u6700\u5927\u3067\u308210\u79d2\u3067Output\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u6e21\u3059\u3088\u3046\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002 /etc/td-agent/td-agent.conf \u306e\u8a2d\u5b9a\u4f8b @type tail path /var/log/httpd/access_log pos_file /var/log/td-agent/httpd_access.pos tag httpd format apache2 @type apache2 expression /^(?[^ ]*) [^ ]* (?[^ ]*) \\[(? @type arrow_file path /tmp/mytest%Y%m%d.%p.arrow schema_defs \"ts=Timestamp[sec],host=Utf8,method=Utf8,path=Utf8,code=Int32,size=Int32,referer=Utf8,agent=Utf8\" ts_column \"ts\" flush_interval 10s chunk_limit_size 4MB chunk_limit_records 200 td-agent \u3092\u8d77\u52d5\u3057\u307e\u3059\u3002 $ sudo systemctl start td-agent \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001Apache Httpd\u306e\u30ed\u30b0\u304c path \u3067\u8a2d\u5b9a\u3057\u305f /tmp/mytest%Y%m%d.%p.arrow \u304c\u5c55\u958b\u3055\u308c\u305f\u5148\u3067\u3042\u308b /tmp/mytest20220124.3206341.arrow \u306b\u66f8\u304d\u51fa\u3055\u308c\u3066\u3044\u307e\u3059\u3002 $ arrow2csv /tmp/mytest20220124.3206341.arrow --head --offset 300 --limit 10 \"ts\",\"host\",\"method\",\"path\",\"code\",\"size\",\"referer\",\"agent\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme_extra.js\",200,195,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme.js\",200,4401,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/fluentd_overview.png\",200,121459,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/main.js\",200,3027,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-regular.woff2\",200,182708,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/fontawesome-webfont.woff2?v=4.7.0\",200,77160,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/RobotoSlab/roboto-slab-v7-bold.woff2\",200,67312,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-bold.woff2\",200,184912,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/worker.js\",200,3724,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/favicon.ico\",200,1150,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \u3053\u308c\u3092 PG-Strom \u306eArrow_Fdw\u3092\u7528\u3044\u3066PostgreSQL\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3066\u307f\u307e\u3059\u3002 postgres=# IMPORT FOREIGN SCHEMA mytest FROM SERVER arrow_fdw INTO public OPTIONS (file '/tmp/mytest20220124.3206341.arrow'); IMPORT FOREIGN SCHEMA postgres=# SELECT ts, host, path FROM mytest WHERE code = 404; ts | host | path ---------------------+---------------+---------------------- 2022-01-24 12:02:06 | 192.168.77.73 | /~kaigai/ja/fluentd/ (1 row) postgres=# EXPLAIN SELECT ts, host, path FROM mytest WHERE code = 404; QUERY PLAN ------------------------------------------------------------------------------ Custom Scan (GpuScan) on mytest (cost=4026.12..4026.12 rows=3 width=72) GPU Filter: (code = 404) referenced: ts, host, path, code files0: /tmp/mytest20220124.3206341.arrow (read: 128.00KB, size: 133.94KB) (4 rows) \u751f\u6210\u3055\u308c\u305f Apache Arrow \u30d5\u30a1\u30a4\u30eb\u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3001\u3053\u308c\u3092SQL\u304b\u3089\u53c2\u7167\u3057\u3066\u3044\u307e\u3059\u3002 Fluentd\u5074\u3067\u6210\u5f62\u3055\u308c\u305f\u30ed\u30b0\u306e\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53c2\u7167\u3059\u308b\u691c\u7d22\u6761\u4ef6\u3092\u4e0e\u3048\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4e0a\u8a18\u306e\u4f8b\u3067\u306f\u3001HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9404\u306e\u30ed\u30b0\u3092\u691c\u7d22\u3057\u30011\u4ef6\u304c\u30d2\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002","title":"Fluentd\u9023\u643a"},{"location":"fluentd/#fluentd","text":"\u672c\u7ae0\u3067\u306f\u3001Apache Arrow\u30c7\u30fc\u30bf\u5f62\u5f0f\u3092\u4ecb\u3057\u305fFluentd\u3068\u306e\u9023\u643a\u3068\u3001IoT/M2M\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u52b9\u7387\u7684\u306a\u53d6\u308a\u8fbc\u307f\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"Fluentd\u9023\u643a"},{"location":"fluentd/#_1","text":"IoT/M2M\u3068\u3088\u3070\u308c\u308b\u6280\u8853\u9818\u57df\u306b\u304a\u3044\u3066\u306f\u3001PC\u3084\u30b5\u30fc\u30d0\u3060\u3051\u3067\u306a\u304f\u3001\u643a\u5e2f\u96fb\u8a71\u3084\u81ea\u52d5\u8eca\u3001\u5404\u7a2e\u30bb\u30f3\u30b5\u30fc\u306a\u3069\u306e\u30c7\u30d0\u30a4\u30b9\u304c\u751f\u6210\u3057\u305f\u5927\u91cf\u306e\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u84c4\u7a4d\u3057\u3001\u3053\u308c\u3092\u5206\u6790\u3059\u308b\u305f\u3081\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c\u6570\u591a\u304f\u958b\u767a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5927\u91cf\u306e\u30c7\u30d0\u30a4\u30b9\u304c\u6642\u3005\u523b\u3005\u3068\u751f\u6210\u3059\u308b\u30c7\u30fc\u30bf\u306f\u975e\u5e38\u306b\u5927\u304d\u306a\u30b5\u30a4\u30ba\u306b\u306a\u308a\u304c\u3061\u3067\u3001\u3053\u308c\u3092\u5b9f\u7528\u7684\u306a\u6642\u9593\u5185\u306b\u51e6\u7406\u3059\u308b\u306b\u306f\u3001\u7279\u5225\u306a\u5de5\u592b\u304c\u5fc5\u8981\u3068\u306a\u308b\u304b\u3089\u3067\u3059\u3002 PG-Strom\u306e\u5404\u7a2e\u6a5f\u80fd\u306f\u3001\u3053\u3046\u3044\u3063\u305f\u898f\u6a21\u306e\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u9ad8\u901f\u306b\u51e6\u7406\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u30fb\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3057\u304b\u3057\u4e00\u65b9\u3067\u3001\u3053\u3046\u3057\u305f\u898f\u6a21\u306e\u30c7\u30fc\u30bf\u306e\u691c\u7d22\u30fb\u96c6\u8a08\u304c\u53ef\u80fd\u306a\u72b6\u614b\u306b\u3059\u308b\u305f\u3081\u306b\u30c7\u30fc\u30bf\u3092\u79fb\u9001\u3057\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u53d6\u308a\u8fbc\u3080\u306b\u306f\u6642\u9593\u304c\u304b\u304b\u308a\u304c\u3061\u3067\u3059\u3002 \u305d\u3053\u3067\u3001PG-Strom\u306b\u306fFluentd\u5411\u3051\u306bApache Arrow\u5f62\u5f0f\u3067\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u51fa\u529b\u3059\u308b fluent-plugin-arrow-file \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u540c\u68b1\u3057\u3001\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u3068\u3044\u3046\u554f\u984c\u306b\u5bfe\u51e6\u3092\u8a66\u307f\u3066\u3044\u307e\u3059\u3002 Fluentd\u306f\u53e4\u6a4b\u8c9e\u4e4b\u6c0f\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u305f\u30ed\u30b0\u53ce\u96c6\u30c4\u30fc\u30eb\u3067\u3001Syslog\u306e\u3088\u3046\u306a\u30b5\u30fc\u30d0\u30ed\u30b0\u304b\u3089IoT/M2M\u6a5f\u5668\u306e\u30c7\u30d0\u30a4\u30b9\u30ed\u30b0\u306b\u81f3\u308b\u307e\u3067\u3001\u591a\u7a2e\u591a\u69d8\u306a\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u96c6\u7a4d\u30fb\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306b\u4e8b\u5b9f\u4e0a\u306e\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u3068\u3057\u3066\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3059\u3002 Ruby\u3067\u8a18\u8ff0\u3055\u308c\u305f\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u8ffd\u52a0\u306b\u3088\u308a\u3001\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u5165\u51fa\u529b\u3084\u52a0\u5de5\u3092\u81ea\u5728\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u30012022\u5e74\u73fe\u5728\u3001800\u7a2e\u985e\u3092\u8d8a\u3048\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u516c\u5f0fWeb\u30b5\u30a4\u30c8\u3067\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002 PG-Strom\u304c\u53d6\u308a\u6271\u3046\u3053\u3068\u306e\u3067\u304d\u308b\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f\u3001PostgreSQL Heap\u5f62\u5f0f\uff08\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30ca\u30eb\u884c\u30c7\u30fc\u30bf\uff09\u3068Apache Arrow\u5f62\u5f0f\uff08\u69cb\u9020\u5316\u5217\u30c7\u30fc\u30bf\uff09\u306e\uff12\u7a2e\u985e\u3067\u3059\u304c\u3001IoT/M2M\u9818\u57df\u3067\u60f3\u5b9a\u3055\u308c\u308b\u3088\u3046\u306a\u3001\u6642\u3005\u523b\u3005\u3068\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u304c\u767a\u751f\u3059\u308b\u3088\u3046\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u3057\u3066\u306f\u3001Apache Arrow\u5f62\u5f0f\u3092\u7528\u3044\u305f\u65b9\u304c\u5408\u7406\u7684\u3067\u3059\u3002","title":"\u6982\u8981"},{"location":"fluentd/#arrow-file","text":"\u4ee5\u4e0b\u3067\u306f\u3001Fluentd\u304c\u53ce\u96c6\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u3092Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u51fa\u529b\u3057\u3001\u3053\u308c\u3092PG-Strom\u3067\u53c2\u7167\u3059\u308b\u3068\u3044\u3046\u30a2\u30d7\u30ed\u30fc\u30c1\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u307e\u305f\u3001Fluentd\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u306f\u3001Treasure Data\u793e\u306e\u63d0\u4f9b\u3059\u308b\u5b89\u5b9a\u7248 td-agent \u3092\u4f7f\u7528\u3059\u308b\u3082\u306e\u3068\u3057\u307e\u3059\u3002 PG-Strom\u306b\u540c\u68b1\u306eFluentd\u5411\u3051Output\u30d7\u30e9\u30b0\u30a4\u30f3\u306e fluent-plugin-arrow-file \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u5229\u7528\u3059\u308b\u3068\u3001Fluentd\u304c\u53ce\u96c6\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u3001\u6307\u5b9a\u3057\u305f\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u6301\u3064Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u66f8\u304d\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002PG-Strom\u306eArrow_Fdw\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308c\u3070\u3053\u306eApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u53c2\u7167\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u307e\u305f\u4fdd\u5b58\u5148\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u304c\u9069\u5207\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308c\u3070\u3001GPU-Direct SQL\u3092\u7528\u3044\u305f\u9ad8\u901f\u306a\u8aad\u307f\u51fa\u3057\u3082\u53ef\u80fd\u3067\u3059\u3002 \u3053\u306e\u65b9\u6cd5\u306b\u306f\u4ee5\u4e0b\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002 - Fluentd \u304c\u51fa\u529b\u3057\u305f\u30c7\u30fc\u30bf\u3092\u305d\u306e\u307e\u307ePG-Strom\u3067\u8aad\u307f\u51fa\u305b\u308b\u305f\u3081\u3001\u6539\u3081\u3066DB\u3078\u30c7\u30fc\u30bf\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u3002 - \u5217\u30c7\u30fc\u30bf\u5f62\u5f0f\u3067\u3042\u308b\u305f\u3081\u3001\u691c\u7d22\u30fb\u96c6\u8a08\u51e6\u7406\u306b\u4f34\u3046\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u51fa\u3057\uff08I/O\u8ca0\u8377\uff09\u3092\u5fc5\u8981\u6700\u5c0f\u9650\u306b\u6291\u3048\u308b\u4e8b\u304c\u3067\u304d\u308b\u3002 - \u53e4\u304f\u306a\u3063\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u3082\u3001OS\u4e0a\u306e\u30d5\u30a1\u30a4\u30eb\u79fb\u52d5\u306e\u307f\u3067\u5b8c\u4e86\u3067\u304d\u308b\u3002 \u4e00\u65b9\u3067\u3001Apache Arrow\u5f62\u5f0f\u3067\u6027\u80fd\u4e0a\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u5f97\u308b\u306b\u306f\u3001Record Batch\u306e\u30b5\u30a4\u30ba\u3092\u3042\u308b\u7a0b\u5ea6\u5927\u304d\u304f\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u305f\u3081\u3001\u30ed\u30b0\u306e\u767a\u751f\u983b\u5ea6\u304c\u5c0f\u3055\u304f\u3001\u4e00\u5b9a\u30b5\u30a4\u30ba\u306e\u30ed\u30b0\u304c\u6e9c\u307e\u308b\u307e\u3067\u306b\u6642\u9593\u306e\u304b\u304b\u308b\u5834\u5408\u306b\u306f\u3001PostgreSQL\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u51fa\u529b\u3055\u305b\u308b\u306a\u3069\u3001\u5225\u306e\u65b9\u6cd5\u3092\u8a66\u3057\u305f\u65b9\u304c\u3088\u308a\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306b\u8fd1\u3044\u30ed\u30b0\u5206\u6790\u304c\u53ef\u80fd\u3067\u3057\u3087\u3046\u3002","title":"arrow-file \u30d7\u30e9\u30b0\u30a4\u30f3"},{"location":"fluentd/#_2","text":"Fluentd\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u306f\u3044\u304f\u3064\u304b\u30ab\u30c6\u30b4\u30ea\u304c\u3042\u308a\u3001\u5916\u90e8\u304b\u3089\u30ed\u30b0\u3092\u53d7\u3051\u53d6\u308bInput\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u30ed\u30b0\u3092\u6210\u5f62\u3059\u308bParser\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u53d7\u4fe1\u3057\u305f\u30ed\u30b0\u3092\u4e00\u6642\u7684\u306b\u84c4\u7a4d\u3059\u308bBuffer\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u30ed\u30b0\u3092\u51fa\u529b\u3059\u308bOutput\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u306a\u3069\u306e\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u3002 arrow-file\u306fOutput\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4e00\u3064\u3067\u3059\u304c\u3001\u3053\u308c\u306fBuffer\u30d7\u30e9\u30b0\u30a4\u30f3\u304b\u3089\u6e21\u3055\u308c\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u56fa\u307e\u308a(chunk)\u3092\u3001\u30b3\u30f3\u30d5\u30a3\u30b0\u3067\u6307\u5b9a\u3055\u308c\u305f\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u6301\u3064Apache Arrow\u5f62\u5f0f\u3067\u66f8\u304d\u51fa\u3059\u5f79\u5272\u3092\u62c5\u3063\u3066\u3044\u307e\u3059\u3002 Input/Parser\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u5f79\u5272\u306f\u3001\u5916\u90e8\u304b\u3089\u53d7\u3051\u53d6\u3063\u305f\u30ed\u30b0\u3092\u5171\u901a\u306e\u5f62\u5f0f\u306b\u5909\u63db\u3057\u3001Buffer\u30d7\u30e9\u30b0\u30a4\u30f3\u3084Output\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u5165\u529b\u30c7\u30fc\u30bf\u306e\u5f62\u5f0f\u3092\u610f\u8b58\u3059\u308b\u3053\u3068\u306a\u304f\u6271\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u3059\u3002 \u3053\u308c\u306f\u5185\u90e8\u7684\u306b\u306f\u3001\u30ed\u30b0\u306e\u632f\u308a\u5206\u3051\u306b\u5229\u7528\u3059\u308b\u3053\u3068\u306e\u3067\u304d\u308b\u8b58\u5225\u5b50\u306e tag \u3001\u30ed\u30b0\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7 time \u3001\u304a\u3088\u3073\u751f\u30ed\u30b0\u3092\u6210\u5f62\u3057\u305f\u9023\u60f3\u914d\u5217\u3067\u3042\u308b record \u306e\u7d44\u3067\u3059\u3002 arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001 tag \u3001 time \u306e\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u3068\u3001 record \u9023\u60f3\u914d\u5217\u306e\u5404\u8981\u7d20\uff08\u4e00\u90e8\u3092\u7701\u7565\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\uff09\u3092\u5217\u3068\u3057\u3066\u6301\u3064Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u66f8\u304d\u51fa\u3057\u3092\u884c\u3044\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001\u51fa\u529b\u5148\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3068\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u60c5\u5831\uff08\u9023\u60f3\u914d\u5217\u306e\u8981\u7d20\u3068\u5217/\u578b\u306e\u30de\u30c3\u30d4\u30f3\u30b0\uff09\u306f\u5fc5\u9808\u306e\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3059\u3002","title":"\u5185\u90e8\u69cb\u9020"},{"location":"fluentd/#_3","text":"\u4f7f\u7528\u3057\u3066\u3044\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u7528\u306e td-agent \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u307e\u305f\u3001arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u306f rake-compiler \u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u306e\u3067\u3001\u4e88\u3081\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3059\u3002 \u8a73\u3057\u304f\u306f \u3053\u3061\u3089 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 $ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent4.sh | sh $ sudo /opt/td-agent/bin/fluent-gem install rake-compiler \u6b21\u306b\u3001PG-Strom\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001 fluentd \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u306e\u7269\u4ef6\u3092\u30d3\u30eb\u30c9\u3057\u307e\u3059\u3002 $ git clone https://github.com/heterodb/pg-strom.git $ cd pg-strom/fluentd $ make TD_AGENT=1 gem $ sudo make TD_AGENT=1 install Fluentd\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 $ /opt/td-agent/bin/fluent-gem list | grep arrow fluent-plugin-arrow-file (0.2)","title":"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"fluentd/#_4","text":"\u524d\u8ff0\u306e\u901a\u308a\u3001arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u52d5\u4f5c\u3055\u305b\u308b\u306b\u306f\u3001\u51fa\u529b\u5148\u306e\u30d1\u30b9\u540d\u3068\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u6700\u4f4e\u9650\u5fc5\u8981\u3067\u3059\u3002 \u3053\u308c\u306b\u52a0\u3048\u3066\u3001Apache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u69cb\u9020\u4e0a\u3001Record Batch\u3068\u547c\u3070\u308c\u308b\u30c7\u30fc\u30bf\u306e\u56fa\u307e\u308a\u306f\u3042\u308b\u7a0b\u5ea6\u5927\u304d\u306a\u30b5\u30a4\u30ba\u3067\u533a\u5207\u3063\u3066\u304a\u3044\u305f\u65b9\u304c\u3001\u691c\u7d22\u30fb\u96c6\u8a08\u51e6\u7406\u3092\u884c\u3046\u969b\u306e\u51e6\u7406\u6027\u80fd\u3092\u5f15\u304d\u51fa\u3057\u3084\u3059\u3044\u3067\u3059\u3002 arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001Buffer\u30d7\u30e9\u30b0\u30a4\u30f3\u304b\u3089\u6e21\u3055\u308c\u308bchunk\u3054\u3068\u306bRecord Batch\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u3001Buffer\u30d7\u30e9\u30b0\u30a4\u30f3\u5074\u306e\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u306f\u3053\u308c\u306b\u6e96\u3058\u305f\u8a2d\u5b9a\u3092\u884c\u3046\u3079\u304d\u3067\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f 256MB \u306e\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u3092\u53d6\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 path [type: String ] (\u5fc5\u9808\u30d1\u30e9\u30e1\u30fc\u30bf) arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u30ed\u30b0\u3092\u51fa\u529b\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u5fc5\u9808\u3067\u3001\u4ee5\u4e0b\u306e\u66f8\u5f0f\u6587\u5b57\u3092\u542b\u3081\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u66f8\u5f0f \u8aac\u660e %Y \u73fe\u5728\u306e\u5e74\u3092\u897f\u66a64\u6841\u3067\u8868\u73fe\u3057\u305f\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %y \u73fe\u5728\u306e\u5e74\u306e\u897f\u66a6\u4e0b2\u6841\u3067\u8868\u73fe\u3057\u305f\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %m \u73fe\u5728\u306e\u6708\u3092 01\uff5e12 \u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %d \u73fe\u5728\u306e\u65e5\u3092 01\uff5e31 \u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %H \u73fe\u5728\u6642\u523b\u306e\u6642\u309200\uff5e23\u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %M \u73fe\u5728\u6642\u523b\u306e\u5206\u309200\uff5e59\u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %S \u73fe\u5728\u6642\u523b\u306e\u79d2\u309200\uff5e59\u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %p \u73fe\u5728\u306e Fluentd \u30d7\u30ed\u30bb\u30b9\u306ePID\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 \u66f8\u5f0f\u6587\u5b57\u5217\u306f\u30c1\u30e3\u30f3\u30af\u3092\u66f8\u304d\u51fa\u3059\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u8a55\u4fa1\u3055\u308c\u3001\u540c\u540d\u306eApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306b\u306f\u3001Record Batch\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306fApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u65b0\u898f\u4f5c\u6210\u3057\u3001\u6700\u521d\u306eRecord Batch\u3092\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002 \u305f\u3060\u3057\u3001\u65e2\u5b58\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u304c\u5f8c\u8ff0\u306e filesize_threshold \u8a2d\u5b9a\u5024\u3092\u8d8a\u3048\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u65e2\u5b58\u30d5\u30a1\u30a4\u30eb\u3092\u30ea\u30cd\u30fc\u30e0\u3057\u305f\u5f8c\u3001\u65b0\u898f\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \uff08\u4f8b\uff09`path /tmp/arrow_logs/my_logs_%y%m%d.%p.log` \u51fa\u529b\u5148\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u30c1\u30e3\u30f3\u30af\u3092\u66f8\u304d\u51fa\u3059\u305f\u3073\u306b\u30d5\u30c3\u30bf\u9818\u57df\u3092\u66f4\u65b0\u3057\u3066\u5168\u3066\u306eRecord Batch\u3092\u30dd\u30a4\u30f3\u30c8\u3057\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u751f\u6210\u3055\u308c\u305fApache Arrow\u30d5\u30a1\u30a4\u30eb\u306f\u5373\u5ea7\u306b\u8aad\u307f\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u30a2\u30af\u30bb\u30b9\u7af6\u5408\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u306f lockf(3) \u3092\u7528\u3044\u3066\u6392\u4ed6\u51e6\u7406\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 schema_defs [type: String ] (\u5fc5\u9808\u30d1\u30e9\u30e1\u30fc\u30bf) fluent-plugin-arrow-file \u304c\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u51fa\u529b\u3059\u308b\u969b\u306e\u3001Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u5fc5\u9808\u3067\u3001\u4ee5\u4e0b\u306e\u5f62\u5f0f\u3067\u8a18\u8ff0\u3055\u308c\u305f\u6587\u5b57\u5217\u306b\u3088\u308a\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002 schema_defs := column_def1[,column_def2 ...] column_def := =[;] \u306f\u5217\u306e\u540d\u524d\u3067\u3059\u3002Fluentd\u304b\u3089arrow-file\u306b\u6e21\u3055\u308c\u308b\u9023\u60f3\u914d\u5217\u306e\u30ad\u30fc\u5024\u3068\u4e00\u81f4\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u306f\u5217\u306e\u30c7\u30fc\u30bf\u578b\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u8868\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u306f\u5217\u306e\u4ed8\u52a0\u5c5e\u6027\u3067\u3059\u3002\u73fe\u6642\u70b9\u3067\u306f\u4ee5\u4e0b\u306e\u5c5e\u6027\u306e\u307f\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002 stat_enabled ... \u5217\u306e\u7d71\u8a08\u60c5\u5831\u3092\u53ce\u96c6\u3057\u3001Record Batch\u3054\u3068\u306e\u6700\u5927\u5024/\u6700\u5c0f\u5024\u3092 max_values=... \u304a\u3088\u3073 min_values=... \u30ab\u30b9\u30bf\u30e0\u30e1\u30bf\u30c7\u30fc\u30bf\u3068\u3057\u3066\u57cb\u3081\u8fbc\u307f\u307e\u3059\u3002 \uff08\u4f8b\uff09 schema_defs \"ts=Timestamp;stat_enabled,dev_id=Uint32,temperature=Float32,humidity=Float32\" arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u30c7\u30fc\u30bf\u578b \u30c7\u30fc\u30bf\u578b \u8aac\u660e Int8 Int16 Int32 Int64 \u7b26\u53f7\u4ed8\u304d\u6574\u6570\u578b\u3067\u3001\u305d\u308c\u305e\u308c\u6307\u5b9a\u3057\u305f\u30d3\u30c3\u30c8\u5e45\u3092\u6301\u3061\u307e\u3059\u3002 Uint8 Uint16 Uint32 Uint64 \u7b26\u53f7\u306a\u3057\u6574\u6570\u578b\u3067\u3001\u305d\u308c\u305e\u308c\u6307\u5b9a\u3057\u305f\u30d3\u30c3\u30c8\u5e45\u3092\u6301\u3061\u307e\u3059\u3002 Float16 Float32 Float64 \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3001\u305d\u308c\u305e\u308c\u534a\u7cbe\u5ea6(16bit)\u3001\u5358\u7cbe\u5ea6(32bit)\u3001\u500d\u7cbe\u5ea6(64bit)\u306e\u5e45\u3092\u6301\u3061\u307e\u3059\u3002 Decimal Decimal128 128bit\u56fa\u5b9a\u5c0f\u6570\u70b9\u578b\u3067\u3059\u3002256bit\u56fa\u5b9a\u5c0f\u6570\u70b9\u578b\u306f\u73fe\u5728\u672a\u30b5\u30dd\u30fc\u30c8\u3067\u3059\u3002 Timestamp Timestamp[sec] Timestamp[ms] Timestamp[us] Timestamp[ns] \u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b\u3067\u3059\u3002\u7cbe\u5ea6\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6697\u9ed9\u306b [us] \u3092\u4ed8\u52a0\u3057\u305f\u3082\u306e\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002 Time Time[sec] Time[ms] Time[us] Time[ns] \u6642\u523b\u578b\u3067\u3059\u3002\u7cbe\u5ea6\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6697\u9ed9\u306b [sec] \u3092\u4ed8\u52a0\u3057\u305f\u3082\u306e\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002 Date Date[Day] Date[ms] \u65e5\u4ed8\u578b\u3067\u3059\u3002\u7cbe\u5ea6\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6697\u9ed9\u306b [day] \u3092\u4ed8\u52a0\u3057\u305f\u3082\u306e\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002 Utf8 \u6587\u5b57\u5217\u578b\u3067\u3059\u3002 Ipaddr4 IPv4\u30a2\u30c9\u30ec\u30b9\u578b\u3067\u3059\u3002\u5b9f\u969b\u306b\u306f byteWidth=4 \u3067\u3042\u308b FixedSizeBinary \u578b\u306b\u3001 pg_type=pg_catalog.inet \u3068\u3044\u3046\u30ab\u30b9\u30bf\u30e0\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u4ed8\u4e0e\u3057\u307e\u3059\u3002 Ipaddr6 IPv6\u30a2\u30c9\u30ec\u30b9\u578b\u3067\u3059\u3002\u5b9f\u969b\u306b\u306f byteWidth=16 \u3067\u3042\u308b FixedSizeBinary \u578b\u306b\u3001 pg_type=pg_catalog.inet \u3068\u3044\u3046\u30ab\u30b9\u30bf\u30e0\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u4ed8\u4e0e\u3057\u307e\u3059\u3002 ts_column [type: String / default: \u306a\u3057] \u6307\u5b9a\u3057\u305f\u5217\u306e\u5024\u3092\uff08 record \u9023\u60f3\u914d\u5217\u304b\u3089\u3067\u306f\u306a\u304f\uff09Fluentd\u304b\u3089\u6e21\u3055\u308c\u305f\u30ed\u30b0\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u5024\u3088\u308a\u53d6\u5f97\u3057\u307e\u3059\u3002 \u901a\u5e38\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3059\u308b\u5217\u306f Timestamp \u306a\u3069\u306e\u65e5\u4ed8\u6642\u523b\u578b\u3092\u6301\u3063\u3066\u304a\u308a\u3001\u307e\u305f stat_enabled \u5c5e\u6027\u3068\u4f75\u7528\u3059\u308b\u3053\u3068\u3067\u691c\u7d22\u51e6\u7406\u306e\u9ad8\u901f\u5316\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 tag_column [type: String / default: \u306a\u3057] \u6307\u5b9a\u3057\u305f\u5217\u306e\u5024\u3092\uff08 record \u9023\u60f3\u914d\u5217\u304b\u3089\u3067\u306f\u306a\u304f\uff09Fluentd\u304b\u3089\u6e21\u3055\u308c\u305f\u30ed\u30b0\u306e\u30bf\u30b0\u5024\u3088\u308a\u53d6\u5f97\u3057\u307e\u3059\u3002 \u901a\u5e38\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3059\u308b\u5217\u306f Utf8 \u306a\u3069\u306e\u6587\u5b57\u5217\u578b\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 filesize_threshold [type: Integer / default: 10000] fluent-plugin-arrow-file \u304c\u51fa\u529b\u5148\u30d5\u30a1\u30a4\u30eb\u3092\u5207\u308a\u66ff\u3048\u308b\u95be\u5024\u3092MB\u5358\u4f4d\u3067\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u304c\u7d0410GB\u3092\u8d8a\u3048\u305f\u8fba\u308a\u3067\u51fa\u529b\u5148\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002","title":"\u8a2d\u5b9a"},{"location":"fluentd/#_5","text":"\u7c21\u5358\u306a\u4f8b\u3068\u3057\u3066\u3001\u30ed\u30fc\u30ab\u30eb\u306eApache Httpd\u30b5\u30fc\u30d0\u306e\u30ed\u30b0\u3092\u76e3\u8996\u3057\u3001\u305d\u308c\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u6bce\u306b\u30d1\u30fc\u30b9\u3057\u3066Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002 \u3067 /var/log/httpd/access_log \u3092\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u6307\u5b9a\u3057\u3066\u3044\u308b\u307b\u304b\u3001 apache2 \u306eParse\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u7528\u3044\u3066\u3001host, user, time, method, path, code, size, referer, agent\u306e\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u5207\u308a\u51fa\u3057\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089\u306farrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u9023\u60f3\u914d\u5217\u3068\u3057\u3066\u6e21\u3055\u308c\u3001 \u5185\u306e schema_defs \u306b\u306f\u3001\u3053\u308c\u3089\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u5bfe\u5fdc\u3059\u308bApache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u5217\u5b9a\u7fa9\u3092\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\u3002 \u307e\u305f\u3001\u3053\u3053\u3067\u306f\u7c21\u5358\u306a\u4f7f\u7528\u4f8b\u3092\u793a\u3059\u3053\u3068\u304c\u76ee\u7684\u3067\u3059\u306e\u3067\u3001 \u30bf\u30b0\u3067\u30c1\u30e3\u30f3\u30af\u30b5\u30a4\u30ba\u3092\u6700\u59274MB / 200\u884c\u306b\u7e2e\u5c0f\u3057\u3001\u6700\u5927\u3067\u308210\u79d2\u3067Output\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u6e21\u3059\u3088\u3046\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002 /etc/td-agent/td-agent.conf \u306e\u8a2d\u5b9a\u4f8b @type tail path /var/log/httpd/access_log pos_file /var/log/td-agent/httpd_access.pos tag httpd format apache2 @type apache2 expression /^(?[^ ]*) [^ ]* (?[^ ]*) \\[(? @type arrow_file path /tmp/mytest%Y%m%d.%p.arrow schema_defs \"ts=Timestamp[sec],host=Utf8,method=Utf8,path=Utf8,code=Int32,size=Int32,referer=Utf8,agent=Utf8\" ts_column \"ts\" flush_interval 10s chunk_limit_size 4MB chunk_limit_records 200 td-agent \u3092\u8d77\u52d5\u3057\u307e\u3059\u3002 $ sudo systemctl start td-agent \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001Apache Httpd\u306e\u30ed\u30b0\u304c path \u3067\u8a2d\u5b9a\u3057\u305f /tmp/mytest%Y%m%d.%p.arrow \u304c\u5c55\u958b\u3055\u308c\u305f\u5148\u3067\u3042\u308b /tmp/mytest20220124.3206341.arrow \u306b\u66f8\u304d\u51fa\u3055\u308c\u3066\u3044\u307e\u3059\u3002 $ arrow2csv /tmp/mytest20220124.3206341.arrow --head --offset 300 --limit 10 \"ts\",\"host\",\"method\",\"path\",\"code\",\"size\",\"referer\",\"agent\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme_extra.js\",200,195,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme.js\",200,4401,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/fluentd_overview.png\",200,121459,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/main.js\",200,3027,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-regular.woff2\",200,182708,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/fontawesome-webfont.woff2?v=4.7.0\",200,77160,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/RobotoSlab/roboto-slab-v7-bold.woff2\",200,67312,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-bold.woff2\",200,184912,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/worker.js\",200,3724,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/favicon.ico\",200,1150,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \u3053\u308c\u3092 PG-Strom \u306eArrow_Fdw\u3092\u7528\u3044\u3066PostgreSQL\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3066\u307f\u307e\u3059\u3002 postgres=# IMPORT FOREIGN SCHEMA mytest FROM SERVER arrow_fdw INTO public OPTIONS (file '/tmp/mytest20220124.3206341.arrow'); IMPORT FOREIGN SCHEMA postgres=# SELECT ts, host, path FROM mytest WHERE code = 404; ts | host | path ---------------------+---------------+---------------------- 2022-01-24 12:02:06 | 192.168.77.73 | /~kaigai/ja/fluentd/ (1 row) postgres=# EXPLAIN SELECT ts, host, path FROM mytest WHERE code = 404; QUERY PLAN ------------------------------------------------------------------------------ Custom Scan (GpuScan) on mytest (cost=4026.12..4026.12 rows=3 width=72) GPU Filter: (code = 404) referenced: ts, host, path, code files0: /tmp/mytest20220124.3206341.arrow (read: 128.00KB, size: 133.94KB) (4 rows) \u751f\u6210\u3055\u308c\u305f Apache Arrow \u30d5\u30a1\u30a4\u30eb\u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3001\u3053\u308c\u3092SQL\u304b\u3089\u53c2\u7167\u3057\u3066\u3044\u307e\u3059\u3002 Fluentd\u5074\u3067\u6210\u5f62\u3055\u308c\u305f\u30ed\u30b0\u306e\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53c2\u7167\u3059\u308b\u691c\u7d22\u6761\u4ef6\u3092\u4e0e\u3048\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4e0a\u8a18\u306e\u4f8b\u3067\u306f\u3001HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9404\u306e\u30ed\u30b0\u3092\u691c\u7d22\u3057\u30011\u4ef6\u304c\u30d2\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002","title":"\u4f7f\u7528\u4f8b"},{"location":"gpucache/","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5 \u6982\u8981 GPU\u306b\u306f\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u306eRAM\u3068\u306f\u72ec\u7acb\u306a\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u304c\u642d\u8f09\u3055\u308c\u3066\u304a\u308a\u3001GPU\u3067\u8a08\u7b97\u3059\u308b\u306b\u306fPCI-E\u30d0\u30b9\u306a\u3069\u3092\u901a\u3058\u3066\u3001\u4e00\u65e6\u3001\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u3084\u30b9\u30c8\u30ec\u30fc\u30b8\u30c7\u30d0\u30a4\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u5074\u3078\u8ee2\u9001\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 PG-Strom\u304cSQL\u30af\u30a8\u30ea\u3092GPU\u3067\u51e6\u7406\u3059\u308b\u5834\u5408\u3082\u4f8b\u5916\u3067\u306f\u306a\u304f\u3001\u5185\u90e8\u7684\u306b\u306f\u3001PostgreSQL\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30ec\u30b3\u30fc\u30c9\u3092GPU\u3078\u3068\u8ee2\u9001\u3057\u3001\u305d\u306e\u4e0a\u3067GPU\u3067SQL\u306e\u5404\u7a2e\u51e6\u7406\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 \u3057\u304b\u3057\u3053\u308c\u3089\u306e\u51e6\u7406\u306b\u306f\u3001\u591a\u304b\u308c\u5c11\u306a\u304b\u308c\u30c6\u30fc\u30d6\u30eb\u306e\u8aad\u307f\u51fa\u3057\u3084\u30c7\u30fc\u30bf\u306e\u8ee2\u9001\u306b\u6642\u9593\u3092\u8981\u3057\u307e\u3059\uff08\u591a\u304f\u306e\u5834\u5408\u3001GPU\u3067\u306e\u51e6\u7406\u3088\u308a\u3082\u9065\u304b\u306b\u9577\u3044\u6642\u9593\u306e\uff01\uff09\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\uff08GPU Cache\uff09\u3068\u306f\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u4e88\u3081\u9818\u57df\u3092\u78ba\u4fdd\u3057\u3066\u304a\u304d\u3001\u305d\u3053\u306bPostgreSQL\u30c6\u30fc\u30d6\u30eb\u306e\u8907\u88fd\u3092\u4fdd\u6301\u3057\u3066\u304a\u304f\u6a5f\u80fd\u3067\u3059\u3002 \u6bd4\u8f03\u7684\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u306e\u5c0f\u3055\u306a\uff08\uff5e10GB\u7a0b\u5ea6\uff09\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u3001\u66f4\u65b0\u983b\u5ea6\u304c\u9ad8\u3044\u3046\u3048\u306b\u3001\u3057\u3070\u3057\u3070\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u691c\u7d22/\u5206\u6790\u7cfb\u306eSQL\u3092\u5b9f\u884c\u3059\u308b\u3068\u3044\u3046\u30d1\u30bf\u30fc\u30f3\u3092\u610f\u56f3\u3057\u3066\u3044\u307e\u3059\u3002 \u5f8c\u8ff0\u3059\u308b\u30ed\u30b0\u30d9\u30fc\u30b9\u306e\u540c\u671f\u30e1\u30ab\u30cb\u30ba\u30e0\u306b\u3088\u308a\u3001\u4e26\u5217\u5ea6\u306e\u9ad8\u3044\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30ca\u30eb\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u59a8\u3052\u308b\u3053\u3068\u306a\u304fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6700\u65b0\u306e\u72b6\u614b\u306b\u4fdd\u3064\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u305d\u306e\u4e00\u65b9\u3067\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306eSQL\u3092\u5b9f\u884c\u3059\u308b\u969b\u306b\u306f\u65e2\u306bGPU\u4e0a\u306b\u30c7\u30fc\u30bf\u304c\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u6539\u3081\u3066\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30ec\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u51fa\u3057\u305f\u308a\u3001PCI-E\u30d0\u30b9\u3092\u4ecb\u3057\u3066\u30c7\u30fc\u30bf\u3092\u8ee2\u9001\u3057\u305f\u308a\u3059\u308b\u4e8b\u306a\u304f\u3001SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5178\u578b\u7684\u306a\u5229\u7528\u30b7\u30fc\u30f3\u3068\u3057\u3066\u306f\u3001\u81ea\u52d5\u8eca\u3084\u643a\u5e2f\u96fb\u8a71\u3068\u3044\u3063\u305f\u30e2\u30d0\u30a4\u30eb\u30c7\u30d0\u30a4\u30b9\u306e\u4f4d\u7f6e\u60c5\u5831\uff08\u73fe\u5728\u4f4d\u7f6e\uff09\u3092\u6642\u3005\u523b\u3005\u53ce\u96c6\u3057\u3001 GPU\u7248PostGIS \u306a\u3069\u3092\u7528\u3044\u3066\u4ed6\u306e\u30c7\u30fc\u30bf\u3068\u7a81\u304d\u5408\u308f\u305b\u308b\u3068\u3044\u3063\u305f\u30b1\u30fc\u30b9\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u3002 \u591a\u6570\u306e\u30c7\u30d0\u30a4\u30b9\u304b\u3089\u9001\u51fa\u3055\u308c\u308b\u4f4d\u7f6e\u60c5\u5831\u306e\u66f4\u65b0\u306f\u6975\u3081\u3066\u66f4\u65b0\u30d8\u30d3\u30fc\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u304c\u3001\u4e00\u65b9\u3067\u3001\u6700\u65b0\u306e\u4f4d\u7f6e\u60c5\u5831\u306b\u57fa\u3065\u3044\u3066\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u3082\u3042\u308b\u305f\u3081\u3001\u3053\u308c\u3089\u66f4\u65b0\u30c7\u30fc\u30bf\u3092\u9045\u6ede\u306a\u304fGPU\u5074\u3078\u9069\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u306b\u306f\u5236\u7d04\u304c\u3042\u308a\u307e\u3059\u304c\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u9ad8\u983b\u5ea6\u306e\u66f4\u65b0\u3068\u3001\u9ad8\u6027\u80fd\u306a\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u3092\u4e21\u7acb\u3059\u308b\u4e00\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002 \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3067\u306f\u3001\u4e26\u5217\u5ea6\u306e\u9ad8\u3044\u66f4\u65b0\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u5fdc\u3059\u308b\u3053\u3068\u3068\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u304c\u5e38\u306b\u6700\u65b0\u306e\u30c7\u30fc\u30bf\u3092\u53c2\u7167\u3059\u308b\u3068\u3044\u30462\u3064\u306e\u8981\u4ef6\u3092\u30af\u30ea\u30a2\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u591a\u304f\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u306fCPU\u3068GPU\u306fPCI-E\u30d0\u30b9\u3092\u4ecb\u3057\u3066\u63a5\u7d9a\u3055\u308c\u3001\u305d\u306e\u901a\u4fe1\u306b\u306f\u76f8\u5fdc\u306e\u30ec\u30a4\u30c6\u30f3\u30b7\u304c\u767a\u751f\u3057\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u304c1\u884c\u66f4\u65b0\u3055\u308c\u308b\u305f\u3073\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u540c\u671f\u3057\u3066\u3044\u3066\u306f\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u6027\u80fd\u306b\u5927\u304d\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u3066\u3057\u307e\u3044\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3059\u308b\u3068\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u7528\u306e\u30e1\u30e2\u30ea\u9818\u57df\u3092\u78ba\u4fdd\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u30db\u30b9\u30c8\u5074\u5171\u6709\u30e1\u30e2\u30ea\u4e0a\u306bREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u306e\u66f4\u65b0\u3092\u4f34\u3046SQL\u30b3\u30de\u30f3\u30c9\uff08INSERT\u3001UPDATE\u3001DELETE\uff09\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001AFTER ROW\u30c8\u30ea\u30ac\u306b\u3088\u3063\u3066\u66f4\u65b0\u5185\u5bb9\u304cREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u30b3\u30d4\u30fc\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u306e\u51e6\u7406\u306fGPU\u3078\u306e\u547c\u3073\u51fa\u3057\u3092\u4f34\u308f\u306a\u3044\u3001CPU\u3068RAM\u3060\u3051\u3067\u5b8c\u7d50\u3059\u308b\u51e6\u7406\u3067\u3059\u306e\u3067\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u6027\u80fd\u3078\u306e\u5f71\u97ff\u306f\u307b\u3068\u3093\u3069\u3042\u308a\u307e\u305b\u3093\u3002 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u304c\u4e00\u5b9a\u91cf\u305f\u307e\u308b\u304b\u3001\u6700\u5f8c\u306e\u66f8\u304d\u8fbc\u307f\u304b\u3089\u4e00\u5b9a\u6642\u9593\u304c\u7d4c\u904e\u3059\u308b\u3068\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\uff08GPU memory keeper\uff09\u306b\u3088\u3063\u3066\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u306fGPU\u3078\u30ed\u30fc\u30c9\u3055\u308c\u3001\u66f4\u65b0\u5dee\u5206\u3092GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u9069\u7528\u3057\u307e\u3059\u3002 \u3053\u306e\u6642\u3001REDO\u30ed\u30b0\u306f\u307e\u3068\u3081\u3066GPU\u306b\u8ee2\u9001\u3055\u308c\u3001\u3055\u3089\u306bGPU\u306e\u6570\u5343\u30d7\u30ed\u30bb\u30c3\u30b5\u30b3\u30a2\u304c\u4e26\u5217\u306bREDO\u30ed\u30b0\u3092\u9069\u7528\u3059\u308b\u305f\u3081\u3001\u901a\u5e38\u306f\u51e6\u7406\u9045\u5ef6\u304c\u554f\u984c\u3068\u306a\u308b\u4e8b\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u3092\u53c2\u7167\u3059\u308b\u969b\u306b\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3057\u3066GPU\u306b\u30ed\u30fc\u30c9\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u65e2\u306bGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u5272\u5f53\u3066\u6e08\u307f\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u5148\u7acb\u3063\u3066\u3001\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u958b\u59cb\u6642\u70b9\u3067\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u3001\u3053\u308c\u3089\u306f\u5168\u3066\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u524d\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3078\u9069\u7528\u3055\u308c\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u304c\u5bfe\u8c61\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u305f\u7d50\u679c\u306f\u3001\u76f4\u63a5\u30c6\u30fc\u30d6\u30eb\u3092\u53c2\u7167\u3057\u305f\u5834\u5408\u3068\u540c\u3058\u7d50\u679c\u3092\u8fd4\u3059\u4e8b\u3068\u306a\u308a\u3001\u554f\u3044\u5408\u308f\u305b\u306e\u4e00\u8cab\u6027\u306f\u5e38\u306b\u4fdd\u6301\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u8a2d\u5b9a GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6709\u52b9\u306b\u3059\u308b\u306b\u306f\u3001\u5bfe\u8c61\u3068\u306a\u308b\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066 pgstrom.gpucache_sync_trigger() \u95a2\u6570\u3092\u5b9f\u884c\u3059\u308bAFTER INSERT OR UPDATE OR DELETE\u306e\u884c\u30c8\u30ea\u30ac\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b9\u30ec\u30fc\u30d6\u5074\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u3053\u306e\u30c8\u30ea\u30ac\u306e\u767a\u884c\u30e2\u30fc\u30c9\u304c ALWAYS \u3067\u3042\u308b\u4e8b\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u30c6\u30fc\u30d6\u30eb dpoints \u306b\u5bfe\u3057\u3066GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3059\u308b\u4f8b\u3067\u3059\u3002 =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; Note PostgreSQL v12.x \u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u304a\u3051\u308b\u8ffd\u52a0\u8a2d\u5b9a PostgreSQL v12\u304a\u3088\u3073\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u3001\u4e0a\u8a18\u306e\u30c8\u30ea\u30ac\u306b\u52a0\u3048\u3066\u3001 pgstrom.gpucache_sync_trigger() \u95a2\u6570\u3092\u5b9f\u884c\u3059\u308bBEFORE TRUNCATE\u306e\u69cb\u6587\u30c8\u30ea\u30ac\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002 \u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b9\u30ec\u30fc\u30d6\u5074\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u3001\u540c\u69d8\u306b\u3001\u3053\u306e\u30c8\u30ea\u30ac\u306e\u767a\u884c\u30e2\u30fc\u30c9\u304c ALWAYS \u3067\u3042\u308b\u4e8b\u304c\u5fc5\u8981\u3067\u3059\u3002 PostgreSQL v13\u3067\u306fObject Access Hook\u304c\u62e1\u5f35\u3055\u308c\u3001\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u30c8\u30ea\u30ac\u8a2d\u5b9a\u306a\u3057\u3067 TRUNCATE\u306e\u5b9f\u884c\u3092\u6355\u6349\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u3057\u304b\u3057\u305d\u308c\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u3001TRUNCATE\u3092\u6355\u6349\u3057\u3066GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4e00\u8cab\u6027\u3092\u4fdd\u3064\u306b\u306f\u3001 BEFORE TRUNCATE\u306e\u69cb\u6587\u30c8\u30ea\u30ac\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4ee5\u4e0b\u306f\u3001PostgreSQL v12\u4ee5\u524d\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092 dpoints \u30c6\u30fc\u30d6\u30eb\u306b\u8a2d\u5b9a\u3059\u308b\u4f8b\u3067\u3059\u3002 =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# create trigger stmt_sync before truncate on dpoints_even for statement execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; =# alter table dpoints_even enable always trigger stmt_sync; GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u884c\u30c8\u30ea\u30ac\u306b\u5f15\u6570\u3068\u3057\u3066 KEY=VALUE \u5f62\u5f0f\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3092\u4e0e\u3048\u308b\u4e8b\u3067\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u69cb\u6587\u30c8\u30ea\u30ac\u306e\u65b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u884c\u6570\u306e\u6700\u5927\u5024\u304c250\u4e07\u884c\u3001REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u30b5\u30a4\u30ba\u3092100MB\u3068\u3057\u3066\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002 =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger('max_num_rows=2500000,redo_buffer_size=100m'); \u884c\u30c8\u30ea\u30ac\u306e\u5f15\u6570\u306b\u4e0e\u3048\u308b\u4e8b\u306e\u3067\u304d\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 gpu_device_id=GPU_ID (default: 0) GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u78ba\u4fdd\u3059\u308b\u5bfe\u8c61\u306eGPU\u30c7\u30d0\u30a4\u30b9ID\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 max_num_rows=NROWS (default: 10485760) GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306b\u78ba\u4fdd\u3067\u304d\u308b\u884c\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 PostgreSQL\u30c6\u30fc\u30d6\u30eb\u3068\u540c\u69d8\u306b\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3067\u3082\u53ef\u8996\u6027\u5236\u5fa1\u306e\u305f\u3081\u306b\u30b3\u30df\u30c3\u30c8\u524d\u306e\u66f4\u65b0\u884c\u3092\u4fdd\u6301\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u3066 max_num_rows \u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u306a\u304a\u3001\u66f4\u65b0/\u524a\u9664\u3055\u308c\u305f\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u884c\u306f\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u30b3\u30df\u30c3\u30c8\u5f8c\u306b\u89e3\u653e\u3055\u308c\u307e\u3059\u3002 redo_buffer_size=SIZE \u3000\uff08default: 160m\uff09 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u5358\u4f4d\u3068\u3057\u3066\u3001k\u3001m\u3001g\u3092\u6307\u5b9a\u3067\u304d\u308b\u3002 gpu_sync_interval=SECONDS \u3000\uff08default: 5\uff09 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3078\u306e\u6700\u5f8c\u306e\u66f8\u304d\u8fbc\u307f\u304b\u3089 SECONDS \u79d2\u7d4c\u904e\u3059\u308b\u3068\u3001\u305f\u3068\u3048\u66f4\u65b0\u884c\u6570\u304c\u5c11\u306a\u304f\u3068\u3082\u3001REDO\u30ed\u30b0\u3092GPU\u5074\u3078\u53cd\u6620\u3057\u307e\u3059\u3002 gpu_sync_threshold=SIZE \u3000\uff08default: redo_buffer_size \u306e25%\uff09 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u66f8\u304d\u8fbc\u307f\u306e\u3046\u3061\u3001\u672a\u53cd\u6620\u5206\u306e\u5927\u304d\u3055\u304c SIZE \u30d0\u30a4\u30c8\u306b\u9054\u3059\u308b\u3068\u3001GPU\u5074\u306bREDO\u30ed\u30b0\u3092\u53cd\u6620\u3057\u307e\u3059\u3002 \u5358\u4f4d\u3068\u3057\u3066k\u3001m\u3001g\u3092\u6307\u5b9a\u3067\u304d\u308b\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30aa\u30d7\u30b7\u30e7\u30f3 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u95a2\u9023\u3057\u3066\u3001\u4ee5\u4e0b\u306ePostgreSQL\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002 pg_strom.enable_gpucache \u3000\uff08default: on\uff09 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5229\u7528\u53ef\u80fd\u3067\u3042\u308b\u5834\u5408\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 \u3053\u306e\u5024\u304c off \u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5b58\u5728\u3057\u3066\u3044\u3066\u3082\u3053\u308c\u3092\u7121\u8996\u3057\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u90fd\u5ea6\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u305d\u3046\u3068\u3057\u307e\u3059\u3002 \u306a\u304a\u3001\u672c\u8a2d\u5b9a\u306f\u30c8\u30ea\u30ac\u306b\u3088\u308bREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3078\u306e\u8ffd\u8a18\u306b\u306f\u5f71\u97ff\u3057\u307e\u305b\u3093\u3002 pg_strom.gpucache_auto_preload \u3000\uff08default: NULL\uff09 PostgreSQL\u306e\u8d77\u52d5\u6642/\u518d\u8d77\u52d5\u6642\u306b\u3001\u672c\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4e88\u3081\u69cb\u7bc9\u3057\u3066\u304a\u304d\u307e\u3059\u3002 \u66f8\u5f0f\u306f DATABASE_NAME.SCHEMA_NAME.TABLE_NAME \u3067\u3001\u8907\u6570\u500b\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3053\u308c\u3092\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u4e26\u3079\u307e\u3059\u3002 \u307e\u3060GPU\u30c7\u30d0\u30a4\u30b9\u4e0a\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u69cb\u7bc9\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u3001\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u3092\u30d5\u30eb\u30b9\u30ad\u30e3\u30f3\u3057\u3066GPU\u5074\u3078\u8ee2\u9001\u3059\u308b\u306e\u306f\u3001\u6700\u521d\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3088\u3046\u3068\u8a66\u307f\u305fPostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306e\u5f79\u5272\u3067\u3059\u3002\u3053\u308c\u306f\u901a\u5e38\u3001\u76f8\u5fdc\u306e\u6642\u9593\u3092\u8981\u3059\u308b\u51e6\u7406\u3067\u3059\u304c\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u30ed\u30fc\u30c9\u3059\u3079\u304d\u30c6\u30fc\u30d6\u30eb\u3092\u8a18\u8f09\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u521d\u56de\u5b9f\u884c\u6642\u306b\u9577\u3005\u3068\u5f85\u305f\u3055\u308c\u308b\u4e8b\u3092\u6291\u6b62\u3067\u304d\u307e\u3059\u3002 \u306a\u304a\u3001\u3053\u306e\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306b '*' \u3068\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6301\u3064\u5168\u3066\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092\u9806\u306bGPU\u3078\u30ed\u30fc\u30c9\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002\u3053\u306e\u6642\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u306f\u5168\u3066\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u9806\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3044\u304f\u4e8b\u3068\u306a\u308a\u307e\u3059\u304c\u3001postmaster\u306b\u518d\u8d77\u52d5\u3092\u4fc3\u3059\u305f\u3081\u7d42\u4e86\u30b3\u30fc\u30c9 1 \u3092\u8fd4\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u30b5\u30fc\u30d0\u306e\u8d77\u52d5\u30ed\u30b0\u306b\u300cGPUCache Startup Preloader\u300d\u304c\u7d42\u4e86\u30b3\u30fc\u30c9 1 \u3067\u7d42\u4e86\u3057\u305f\u3068\u51fa\u529b\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u308c\u306f\u7570\u5e38\u3067\u306f\u3042\u308a\u307e\u305b\u3093 LOG: database system is ready to accept connections LOG: background worker \"GPUCache Startup Preloader\" (PID 856418) exited with exit code 1 LOG: background worker \"GPUCache Startup Preloader\" (PID 856427) exited with exit code 1 LOG: create GpuCacheSharedState dpoints:164c95f71 LOG: gpucache: AllocMemory dpoints:164c95f71 (main_sz=772505600, extra_sz=0) LOG: gpucache: auto preload 'public.dpoints' (DB: postgres) LOG: create GpuCacheSharedState mytest:1773a589b LOG: gpucache: auto preload 'public.mytest' (DB: postgres) LOG: gpucache: AllocMemory mytest:1773a589b (main_sz=675028992, extra_sz=0) \u904b\u7528 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5229\u7528\u3092\u78ba\u8a8d\u3059\u308b GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u53c2\u7167\u306f\u900f\u904e\u7684\u306b\u884c\u308f\u308c\u307e\u3059\u3002\u30e6\u30fc\u30b6\u306f\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u6709\u7121\u3092\u610f\u8b58\u3059\u308b\u5fc5\u8981\u306f\u306a\u304f\u3001PG-Strom\u304c\u81ea\u52d5\u7684\u306b\u5224\u5b9a\u3057\u3066\u51e6\u7406\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u306f\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u8a2d\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb dpoints \u3078\u306e\u53c2\u7167\u3092\u542b\u3080\u3082\u306e\u3067\u3059\u3002\u4e0b\u304b\u30893\u884c\u76ee\u306e\u300cGPU Cache\u300d\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u3001\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u57fa\u672c\u7684\u306a\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u3066\u304a\u308a\u3001\u3053\u306e\u30af\u30a8\u30ea\u3067\u306f dpoints \u30c6\u30fc\u30d6\u30eb\u3092\u8aad\u307f\u51fa\u3059\u306e\u3067\u306f\u306a\u304f\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u53c2\u7167\u3057\u3066\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 \u306a\u304a\u3001 max_num_rows \u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4fdd\u6301\u3067\u304d\u308b\u6700\u5927\u306e\u884c\u6570\u3001 main \u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u56fa\u5b9a\u9577\u30d5\u30a3\u30fc\u30eb\u30c9\u7528\u306e\u9818\u57df\u306e\u5927\u304d\u3055\u3001 extra \u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306f\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u5927\u304d\u3055\u3067\u3059\u3002 =# explain select pref, city, count(*) from giscity g, dpoints d where pref = 'Tokyo' and st_contains(g.geom,st_makepoint(d.x, d.y)) group by pref, city; QUERY PLAN -------------------------------------------------------------------------------------------------------- HashAggregate (cost=5638809.75..5638859.99 rows=5024 width=29) Group Key: g.pref, g.city -> Custom Scan (GpuPreAgg) (cost=5638696.71..5638759.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=631923.57..5606933.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) GPU Cache: NVIDIA Tesla V100-PCIE-16GB [max_num_rows: 12000000, main: 772.51M, extra: 0] -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (16 rows) GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u73fe\u5728\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f pgstrom.gpucache_info \u30d3\u30e5\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | refcnt | corrupted | gpu_main_sz | gpu_extra_sz | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------+------------+--------+-----------+-------------+--------------+----------------------------+-------------------+----------------+------------------+---------------+---------------+------------------------------------------------------------------------------------------------------------------------ 12728 | postgres | 25244 | mytest | 6295279771 | 3 | f | 675028992 | 0 | 2021-05-14 03:00:18.623503 | 500000 | 36000000 | 500000 | 36000000 | 36000000 | gpu_device_id=0,max_num_rows=10485760,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 12728 | postgres | 25262 | dpoints | 5985886065 | 3 | f | 772505600 | 0 | 2021-05-14 03:00:18.524627 | 8000000 | 576000192 | 8000000 | 576000192 | 576000192 | gpu_device_id=0,max_num_rows=12000000,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 (2 rows) \u3053\u306e\u30d3\u30e5\u30fc\u3067\u8868\u793a\u3055\u308c\u308bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u72b6\u614b\u306f\u3001\u305d\u306e\u6642\u70b9\u3067\u521d\u671f\u30ed\u30fc\u30c9\u304c\u7d42\u308f\u3063\u3066\u304a\u308a\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u9818\u57df\u304c\u78ba\u4fdd\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3060\u3051\u3067\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u3064\u307e\u308a\u3001\u30c8\u30ea\u30ac\u95a2\u6570\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u304c\u521d\u671f\u30ed\u30fc\u30c9\u304c\u7d42\u308f\u3063\u3066\u3044\u306a\u3044\uff08\u307e\u3060\u8ab0\u3082\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3044\u306a\u3044\uff09\u5834\u5408\u3001\u6f5c\u5728\u7684\u306b\u78ba\u4fdd\u3055\u308c\u3046\u308bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u307e\u3060 pgstrom.gpucache_info \u306b\u306f\u73fe\u308c\u307e\u305b\u3093\u3002 \u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u610f\u5473\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 database_oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eOID\u3067\u3059 database_name GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u540d\u524d\u3067\u3059 table_oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306eOID\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 table_name GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u540d\u524d\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 signature GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4e00\u610f\u6027\u3092\u793a\u3059\u30cf\u30c3\u30b7\u30e5\u5024\u3067\u3059\u3002\u4f8b\u3048\u3070 ALTER TABLE \u306e\u524d\u5f8c\u306a\u3069\u3067\u3053\u306e\u5024\u304c\u5909\u308f\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 refcnt GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u53c2\u7167\u30ab\u30a6\u30f3\u30bf\u3067\u3059\u3002\u3053\u308c\u306f\u5fc5\u305a\u3057\u3082\u6700\u65b0\u306e\u5024\u3092\u53cd\u6620\u3057\u3066\u3044\u308b\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002 corrupted GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5185\u5bb9\u304c\u7834\u640d\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u793a\u3057\u307e\u3059\u3002 gpu_main_sz GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306b\u78ba\u4fdd\u3055\u308c\u305f\u56fa\u5b9a\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_extra_sz GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306b\u78ba\u4fdd\u3055\u308c\u305f\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 redo_write_ts REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u6700\u5f8c\u306b\u66f4\u65b0\u3057\u305f\u6642\u523b\u3067\u3059\u3002 redo_write_nitems REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_write_pos REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_read_nitems REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_read_pos REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_sync_pos REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u3046\u3061\u3001\u65e2\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3078\u306e\u9069\u7528\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u305f\u4f4d\u7f6e\u3067\u3059\u3002 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u6b8b\u308a\u5bb9\u91cf\u304c\u903c\u8feb\u3057\u3066\u304d\u305f\u969b\u306b\u3001\u591a\u6570\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u540c\u6642\u306b\u975e\u540c\u671f\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u767a\u751f\u3055\u305b\u308b\u4e8b\u3092\u907f\u3051\u308b\u305f\u3081\u3001\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002 config_options GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3067\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u7834\u640d\u3068\u5fa9\u5143 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b max_num_rows \u3067\u6307\u5b9a\u3057\u305f\u4ee5\u4e0a\u306e\u884c\u6570\u3092\u633f\u5165\u3057\u3088\u3046\u3068\u3057\u305f\u308a\u3001\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u306e\u30d0\u30c3\u30d5\u30a1\u9577\u304c\u80a5\u5927\u5316\u3057\u3059\u304e\u305f\u308a\u3001 \u3068\u3044\u3063\u305f\u7406\u7531\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306bREDO\u30ed\u30b0\u3092\u9069\u7528\u3067\u304d\u306a\u304b\u3063\u305f\u5834\u5408\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u7834\u640d\uff08corrupted\uff09\u72b6\u614b\u306b\u79fb\u884c\u3057\u307e\u3059\u3002 \u4e00\u5ea6GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u7834\u640d\u3059\u308b\u3068\u3001\u3053\u308c\u3092\u624b\u52d5\u3067\u5fa9\u65e7\u3059\u308b\u307e\u3067\u306f\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u53c2\u7167\u3059\u308b\u4e8b\u306f\u306a\u304f\u306a\u308a\u3001 \u307e\u305f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u66f4\u65b0\u306b\u969b\u3057\u3066\u3082REDO\u30ed\u30b0\u306e\u8a18\u9332\u3092\u884c\u308f\u306a\u304f\u306a\u308a\u307e\u3059\u3002 \uff08\u904b\u60aa\u304f\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u304c\u5b9f\u884c\u3092\u958b\u59cb\u3057\u305f\u5f8c\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u7834\u640d\u3057\u305f\u5834\u5408\u3001\u305d\u306e\u30af\u30a8\u30ea\u306f\u30a8\u30e9\u30fc\u3092\u8fd4\u3059\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002\uff09 GPU\u30d0\u30c3\u30d5\u30a1\u3092\u7834\u640d\u72b6\u614b\u304b\u3089\u5fa9\u5143\u3059\u308b\u306e\u306f pgstrom.gpucache_recovery(regclass) \u95a2\u6570\u3067\u3059\u3002 REDO\u30ed\u30b0\u3092\u9069\u7528\u3067\u304d\u306a\u304b\u3063\u305f\u539f\u56e0\u3092\u53d6\u308a\u9664\u3044\u305f\u4e0a\u3067\u3053\u306e\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u518d\u5ea6\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u521d\u671f\u30ed\u30fc\u30c9\u3092\u884c\u3044\u3001\u5143\u306e\u72b6\u614b\u3078\u306e \u5fa9\u65e7\u3092\u8a66\u307f\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001 max_num_rows \u3067\u6307\u5b9a\u3057\u305f\u4ee5\u4e0a\u306e\u884c\u6570\u3092\u633f\u5165\u3057\u3088\u3046\u3068\u3057\u305f\u5834\u5408\u3067\u3042\u308c\u3070\u3001\u30c8\u30ea\u30ac\u306e\u5b9a\u7fa9\u3092\u5909\u66f4\u3057\u3066 max_num_rows \u8a2d\u5b9a\u3092 \u62e1\u5927\u3059\u308b\u304b\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u4e00\u90e8\u306e\u884c\u3092\u524a\u9664\u3057\u305f\u5f8c\u3067\u3001 pgstrom.gpucache_recovery() \u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3068\u3044\u3046\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5"},{"location":"gpucache/#gpu","text":"","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5"},{"location":"gpucache/#_1","text":"GPU\u306b\u306f\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u306eRAM\u3068\u306f\u72ec\u7acb\u306a\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u304c\u642d\u8f09\u3055\u308c\u3066\u304a\u308a\u3001GPU\u3067\u8a08\u7b97\u3059\u308b\u306b\u306fPCI-E\u30d0\u30b9\u306a\u3069\u3092\u901a\u3058\u3066\u3001\u4e00\u65e6\u3001\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u3084\u30b9\u30c8\u30ec\u30fc\u30b8\u30c7\u30d0\u30a4\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u5074\u3078\u8ee2\u9001\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 PG-Strom\u304cSQL\u30af\u30a8\u30ea\u3092GPU\u3067\u51e6\u7406\u3059\u308b\u5834\u5408\u3082\u4f8b\u5916\u3067\u306f\u306a\u304f\u3001\u5185\u90e8\u7684\u306b\u306f\u3001PostgreSQL\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30ec\u30b3\u30fc\u30c9\u3092GPU\u3078\u3068\u8ee2\u9001\u3057\u3001\u305d\u306e\u4e0a\u3067GPU\u3067SQL\u306e\u5404\u7a2e\u51e6\u7406\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 \u3057\u304b\u3057\u3053\u308c\u3089\u306e\u51e6\u7406\u306b\u306f\u3001\u591a\u304b\u308c\u5c11\u306a\u304b\u308c\u30c6\u30fc\u30d6\u30eb\u306e\u8aad\u307f\u51fa\u3057\u3084\u30c7\u30fc\u30bf\u306e\u8ee2\u9001\u306b\u6642\u9593\u3092\u8981\u3057\u307e\u3059\uff08\u591a\u304f\u306e\u5834\u5408\u3001GPU\u3067\u306e\u51e6\u7406\u3088\u308a\u3082\u9065\u304b\u306b\u9577\u3044\u6642\u9593\u306e\uff01\uff09\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\uff08GPU Cache\uff09\u3068\u306f\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u4e88\u3081\u9818\u57df\u3092\u78ba\u4fdd\u3057\u3066\u304a\u304d\u3001\u305d\u3053\u306bPostgreSQL\u30c6\u30fc\u30d6\u30eb\u306e\u8907\u88fd\u3092\u4fdd\u6301\u3057\u3066\u304a\u304f\u6a5f\u80fd\u3067\u3059\u3002 \u6bd4\u8f03\u7684\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u306e\u5c0f\u3055\u306a\uff08\uff5e10GB\u7a0b\u5ea6\uff09\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u3001\u66f4\u65b0\u983b\u5ea6\u304c\u9ad8\u3044\u3046\u3048\u306b\u3001\u3057\u3070\u3057\u3070\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u691c\u7d22/\u5206\u6790\u7cfb\u306eSQL\u3092\u5b9f\u884c\u3059\u308b\u3068\u3044\u3046\u30d1\u30bf\u30fc\u30f3\u3092\u610f\u56f3\u3057\u3066\u3044\u307e\u3059\u3002 \u5f8c\u8ff0\u3059\u308b\u30ed\u30b0\u30d9\u30fc\u30b9\u306e\u540c\u671f\u30e1\u30ab\u30cb\u30ba\u30e0\u306b\u3088\u308a\u3001\u4e26\u5217\u5ea6\u306e\u9ad8\u3044\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30ca\u30eb\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u59a8\u3052\u308b\u3053\u3068\u306a\u304fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6700\u65b0\u306e\u72b6\u614b\u306b\u4fdd\u3064\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u305d\u306e\u4e00\u65b9\u3067\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306eSQL\u3092\u5b9f\u884c\u3059\u308b\u969b\u306b\u306f\u65e2\u306bGPU\u4e0a\u306b\u30c7\u30fc\u30bf\u304c\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u6539\u3081\u3066\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30ec\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u51fa\u3057\u305f\u308a\u3001PCI-E\u30d0\u30b9\u3092\u4ecb\u3057\u3066\u30c7\u30fc\u30bf\u3092\u8ee2\u9001\u3057\u305f\u308a\u3059\u308b\u4e8b\u306a\u304f\u3001SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5178\u578b\u7684\u306a\u5229\u7528\u30b7\u30fc\u30f3\u3068\u3057\u3066\u306f\u3001\u81ea\u52d5\u8eca\u3084\u643a\u5e2f\u96fb\u8a71\u3068\u3044\u3063\u305f\u30e2\u30d0\u30a4\u30eb\u30c7\u30d0\u30a4\u30b9\u306e\u4f4d\u7f6e\u60c5\u5831\uff08\u73fe\u5728\u4f4d\u7f6e\uff09\u3092\u6642\u3005\u523b\u3005\u53ce\u96c6\u3057\u3001 GPU\u7248PostGIS \u306a\u3069\u3092\u7528\u3044\u3066\u4ed6\u306e\u30c7\u30fc\u30bf\u3068\u7a81\u304d\u5408\u308f\u305b\u308b\u3068\u3044\u3063\u305f\u30b1\u30fc\u30b9\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u3002 \u591a\u6570\u306e\u30c7\u30d0\u30a4\u30b9\u304b\u3089\u9001\u51fa\u3055\u308c\u308b\u4f4d\u7f6e\u60c5\u5831\u306e\u66f4\u65b0\u306f\u6975\u3081\u3066\u66f4\u65b0\u30d8\u30d3\u30fc\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u304c\u3001\u4e00\u65b9\u3067\u3001\u6700\u65b0\u306e\u4f4d\u7f6e\u60c5\u5831\u306b\u57fa\u3065\u3044\u3066\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u3082\u3042\u308b\u305f\u3081\u3001\u3053\u308c\u3089\u66f4\u65b0\u30c7\u30fc\u30bf\u3092\u9045\u6ede\u306a\u304fGPU\u5074\u3078\u9069\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u306b\u306f\u5236\u7d04\u304c\u3042\u308a\u307e\u3059\u304c\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u9ad8\u983b\u5ea6\u306e\u66f4\u65b0\u3068\u3001\u9ad8\u6027\u80fd\u306a\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u3092\u4e21\u7acb\u3059\u308b\u4e00\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002","title":"\u6982\u8981"},{"location":"gpucache/#_2","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3067\u306f\u3001\u4e26\u5217\u5ea6\u306e\u9ad8\u3044\u66f4\u65b0\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u5fdc\u3059\u308b\u3053\u3068\u3068\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u304c\u5e38\u306b\u6700\u65b0\u306e\u30c7\u30fc\u30bf\u3092\u53c2\u7167\u3059\u308b\u3068\u3044\u30462\u3064\u306e\u8981\u4ef6\u3092\u30af\u30ea\u30a2\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u591a\u304f\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u306fCPU\u3068GPU\u306fPCI-E\u30d0\u30b9\u3092\u4ecb\u3057\u3066\u63a5\u7d9a\u3055\u308c\u3001\u305d\u306e\u901a\u4fe1\u306b\u306f\u76f8\u5fdc\u306e\u30ec\u30a4\u30c6\u30f3\u30b7\u304c\u767a\u751f\u3057\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u304c1\u884c\u66f4\u65b0\u3055\u308c\u308b\u305f\u3073\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u540c\u671f\u3057\u3066\u3044\u3066\u306f\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u6027\u80fd\u306b\u5927\u304d\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u3066\u3057\u307e\u3044\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3059\u308b\u3068\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u7528\u306e\u30e1\u30e2\u30ea\u9818\u57df\u3092\u78ba\u4fdd\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u30db\u30b9\u30c8\u5074\u5171\u6709\u30e1\u30e2\u30ea\u4e0a\u306bREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u306e\u66f4\u65b0\u3092\u4f34\u3046SQL\u30b3\u30de\u30f3\u30c9\uff08INSERT\u3001UPDATE\u3001DELETE\uff09\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001AFTER ROW\u30c8\u30ea\u30ac\u306b\u3088\u3063\u3066\u66f4\u65b0\u5185\u5bb9\u304cREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u30b3\u30d4\u30fc\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u306e\u51e6\u7406\u306fGPU\u3078\u306e\u547c\u3073\u51fa\u3057\u3092\u4f34\u308f\u306a\u3044\u3001CPU\u3068RAM\u3060\u3051\u3067\u5b8c\u7d50\u3059\u308b\u51e6\u7406\u3067\u3059\u306e\u3067\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u6027\u80fd\u3078\u306e\u5f71\u97ff\u306f\u307b\u3068\u3093\u3069\u3042\u308a\u307e\u305b\u3093\u3002 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u304c\u4e00\u5b9a\u91cf\u305f\u307e\u308b\u304b\u3001\u6700\u5f8c\u306e\u66f8\u304d\u8fbc\u307f\u304b\u3089\u4e00\u5b9a\u6642\u9593\u304c\u7d4c\u904e\u3059\u308b\u3068\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\uff08GPU memory keeper\uff09\u306b\u3088\u3063\u3066\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u306fGPU\u3078\u30ed\u30fc\u30c9\u3055\u308c\u3001\u66f4\u65b0\u5dee\u5206\u3092GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u9069\u7528\u3057\u307e\u3059\u3002 \u3053\u306e\u6642\u3001REDO\u30ed\u30b0\u306f\u307e\u3068\u3081\u3066GPU\u306b\u8ee2\u9001\u3055\u308c\u3001\u3055\u3089\u306bGPU\u306e\u6570\u5343\u30d7\u30ed\u30bb\u30c3\u30b5\u30b3\u30a2\u304c\u4e26\u5217\u306bREDO\u30ed\u30b0\u3092\u9069\u7528\u3059\u308b\u305f\u3081\u3001\u901a\u5e38\u306f\u51e6\u7406\u9045\u5ef6\u304c\u554f\u984c\u3068\u306a\u308b\u4e8b\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u3092\u53c2\u7167\u3059\u308b\u969b\u306b\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3057\u3066GPU\u306b\u30ed\u30fc\u30c9\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u65e2\u306bGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u5272\u5f53\u3066\u6e08\u307f\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u5148\u7acb\u3063\u3066\u3001\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u958b\u59cb\u6642\u70b9\u3067\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u3001\u3053\u308c\u3089\u306f\u5168\u3066\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u524d\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3078\u9069\u7528\u3055\u308c\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u304c\u5bfe\u8c61\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u305f\u7d50\u679c\u306f\u3001\u76f4\u63a5\u30c6\u30fc\u30d6\u30eb\u3092\u53c2\u7167\u3057\u305f\u5834\u5408\u3068\u540c\u3058\u7d50\u679c\u3092\u8fd4\u3059\u4e8b\u3068\u306a\u308a\u3001\u554f\u3044\u5408\u308f\u305b\u306e\u4e00\u8cab\u6027\u306f\u5e38\u306b\u4fdd\u6301\u3055\u308c\u3066\u3044\u307e\u3059\u3002","title":"\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3"},{"location":"gpucache/#_3","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6709\u52b9\u306b\u3059\u308b\u306b\u306f\u3001\u5bfe\u8c61\u3068\u306a\u308b\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066 pgstrom.gpucache_sync_trigger() \u95a2\u6570\u3092\u5b9f\u884c\u3059\u308bAFTER INSERT OR UPDATE OR DELETE\u306e\u884c\u30c8\u30ea\u30ac\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b9\u30ec\u30fc\u30d6\u5074\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u3053\u306e\u30c8\u30ea\u30ac\u306e\u767a\u884c\u30e2\u30fc\u30c9\u304c ALWAYS \u3067\u3042\u308b\u4e8b\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u30c6\u30fc\u30d6\u30eb dpoints \u306b\u5bfe\u3057\u3066GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3059\u308b\u4f8b\u3067\u3059\u3002 =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; Note PostgreSQL v12.x \u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u304a\u3051\u308b\u8ffd\u52a0\u8a2d\u5b9a PostgreSQL v12\u304a\u3088\u3073\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u3001\u4e0a\u8a18\u306e\u30c8\u30ea\u30ac\u306b\u52a0\u3048\u3066\u3001 pgstrom.gpucache_sync_trigger() \u95a2\u6570\u3092\u5b9f\u884c\u3059\u308bBEFORE TRUNCATE\u306e\u69cb\u6587\u30c8\u30ea\u30ac\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002 \u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b9\u30ec\u30fc\u30d6\u5074\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u3001\u540c\u69d8\u306b\u3001\u3053\u306e\u30c8\u30ea\u30ac\u306e\u767a\u884c\u30e2\u30fc\u30c9\u304c ALWAYS \u3067\u3042\u308b\u4e8b\u304c\u5fc5\u8981\u3067\u3059\u3002 PostgreSQL v13\u3067\u306fObject Access Hook\u304c\u62e1\u5f35\u3055\u308c\u3001\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u30c8\u30ea\u30ac\u8a2d\u5b9a\u306a\u3057\u3067 TRUNCATE\u306e\u5b9f\u884c\u3092\u6355\u6349\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u3057\u304b\u3057\u305d\u308c\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u3001TRUNCATE\u3092\u6355\u6349\u3057\u3066GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4e00\u8cab\u6027\u3092\u4fdd\u3064\u306b\u306f\u3001 BEFORE TRUNCATE\u306e\u69cb\u6587\u30c8\u30ea\u30ac\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4ee5\u4e0b\u306f\u3001PostgreSQL v12\u4ee5\u524d\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092 dpoints \u30c6\u30fc\u30d6\u30eb\u306b\u8a2d\u5b9a\u3059\u308b\u4f8b\u3067\u3059\u3002 =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# create trigger stmt_sync before truncate on dpoints_even for statement execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; =# alter table dpoints_even enable always trigger stmt_sync;","title":"\u8a2d\u5b9a"},{"location":"gpucache/#gpu_1","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u884c\u30c8\u30ea\u30ac\u306b\u5f15\u6570\u3068\u3057\u3066 KEY=VALUE \u5f62\u5f0f\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3092\u4e0e\u3048\u308b\u4e8b\u3067\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u69cb\u6587\u30c8\u30ea\u30ac\u306e\u65b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u884c\u6570\u306e\u6700\u5927\u5024\u304c250\u4e07\u884c\u3001REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u30b5\u30a4\u30ba\u3092100MB\u3068\u3057\u3066\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002 =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger('max_num_rows=2500000,redo_buffer_size=100m'); \u884c\u30c8\u30ea\u30ac\u306e\u5f15\u6570\u306b\u4e0e\u3048\u308b\u4e8b\u306e\u3067\u304d\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 gpu_device_id=GPU_ID (default: 0) GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u78ba\u4fdd\u3059\u308b\u5bfe\u8c61\u306eGPU\u30c7\u30d0\u30a4\u30b9ID\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 max_num_rows=NROWS (default: 10485760) GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306b\u78ba\u4fdd\u3067\u304d\u308b\u884c\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 PostgreSQL\u30c6\u30fc\u30d6\u30eb\u3068\u540c\u69d8\u306b\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3067\u3082\u53ef\u8996\u6027\u5236\u5fa1\u306e\u305f\u3081\u306b\u30b3\u30df\u30c3\u30c8\u524d\u306e\u66f4\u65b0\u884c\u3092\u4fdd\u6301\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u3066 max_num_rows \u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u306a\u304a\u3001\u66f4\u65b0/\u524a\u9664\u3055\u308c\u305f\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u884c\u306f\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u30b3\u30df\u30c3\u30c8\u5f8c\u306b\u89e3\u653e\u3055\u308c\u307e\u3059\u3002 redo_buffer_size=SIZE \u3000\uff08default: 160m\uff09 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u5358\u4f4d\u3068\u3057\u3066\u3001k\u3001m\u3001g\u3092\u6307\u5b9a\u3067\u304d\u308b\u3002 gpu_sync_interval=SECONDS \u3000\uff08default: 5\uff09 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3078\u306e\u6700\u5f8c\u306e\u66f8\u304d\u8fbc\u307f\u304b\u3089 SECONDS \u79d2\u7d4c\u904e\u3059\u308b\u3068\u3001\u305f\u3068\u3048\u66f4\u65b0\u884c\u6570\u304c\u5c11\u306a\u304f\u3068\u3082\u3001REDO\u30ed\u30b0\u3092GPU\u5074\u3078\u53cd\u6620\u3057\u307e\u3059\u3002 gpu_sync_threshold=SIZE \u3000\uff08default: redo_buffer_size \u306e25%\uff09 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u66f8\u304d\u8fbc\u307f\u306e\u3046\u3061\u3001\u672a\u53cd\u6620\u5206\u306e\u5927\u304d\u3055\u304c SIZE \u30d0\u30a4\u30c8\u306b\u9054\u3059\u308b\u3068\u3001GPU\u5074\u306bREDO\u30ed\u30b0\u3092\u53cd\u6620\u3057\u307e\u3059\u3002 \u5358\u4f4d\u3068\u3057\u3066k\u3001m\u3001g\u3092\u6307\u5b9a\u3067\u304d\u308b\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba"},{"location":"gpucache/#gpu_2","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u95a2\u9023\u3057\u3066\u3001\u4ee5\u4e0b\u306ePostgreSQL\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002 pg_strom.enable_gpucache \u3000\uff08default: on\uff09 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5229\u7528\u53ef\u80fd\u3067\u3042\u308b\u5834\u5408\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 \u3053\u306e\u5024\u304c off \u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5b58\u5728\u3057\u3066\u3044\u3066\u3082\u3053\u308c\u3092\u7121\u8996\u3057\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u90fd\u5ea6\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u305d\u3046\u3068\u3057\u307e\u3059\u3002 \u306a\u304a\u3001\u672c\u8a2d\u5b9a\u306f\u30c8\u30ea\u30ac\u306b\u3088\u308bREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3078\u306e\u8ffd\u8a18\u306b\u306f\u5f71\u97ff\u3057\u307e\u305b\u3093\u3002 pg_strom.gpucache_auto_preload \u3000\uff08default: NULL\uff09 PostgreSQL\u306e\u8d77\u52d5\u6642/\u518d\u8d77\u52d5\u6642\u306b\u3001\u672c\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4e88\u3081\u69cb\u7bc9\u3057\u3066\u304a\u304d\u307e\u3059\u3002 \u66f8\u5f0f\u306f DATABASE_NAME.SCHEMA_NAME.TABLE_NAME \u3067\u3001\u8907\u6570\u500b\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3053\u308c\u3092\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u4e26\u3079\u307e\u3059\u3002 \u307e\u3060GPU\u30c7\u30d0\u30a4\u30b9\u4e0a\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u69cb\u7bc9\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u3001\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u3092\u30d5\u30eb\u30b9\u30ad\u30e3\u30f3\u3057\u3066GPU\u5074\u3078\u8ee2\u9001\u3059\u308b\u306e\u306f\u3001\u6700\u521d\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3088\u3046\u3068\u8a66\u307f\u305fPostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306e\u5f79\u5272\u3067\u3059\u3002\u3053\u308c\u306f\u901a\u5e38\u3001\u76f8\u5fdc\u306e\u6642\u9593\u3092\u8981\u3059\u308b\u51e6\u7406\u3067\u3059\u304c\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u30ed\u30fc\u30c9\u3059\u3079\u304d\u30c6\u30fc\u30d6\u30eb\u3092\u8a18\u8f09\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u521d\u56de\u5b9f\u884c\u6642\u306b\u9577\u3005\u3068\u5f85\u305f\u3055\u308c\u308b\u4e8b\u3092\u6291\u6b62\u3067\u304d\u307e\u3059\u3002 \u306a\u304a\u3001\u3053\u306e\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306b '*' \u3068\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6301\u3064\u5168\u3066\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092\u9806\u306bGPU\u3078\u30ed\u30fc\u30c9\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002\u3053\u306e\u6642\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u306f\u5168\u3066\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u9806\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3044\u304f\u4e8b\u3068\u306a\u308a\u307e\u3059\u304c\u3001postmaster\u306b\u518d\u8d77\u52d5\u3092\u4fc3\u3059\u305f\u3081\u7d42\u4e86\u30b3\u30fc\u30c9 1 \u3092\u8fd4\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u30b5\u30fc\u30d0\u306e\u8d77\u52d5\u30ed\u30b0\u306b\u300cGPUCache Startup Preloader\u300d\u304c\u7d42\u4e86\u30b3\u30fc\u30c9 1 \u3067\u7d42\u4e86\u3057\u305f\u3068\u51fa\u529b\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u308c\u306f\u7570\u5e38\u3067\u306f\u3042\u308a\u307e\u305b\u3093 LOG: database system is ready to accept connections LOG: background worker \"GPUCache Startup Preloader\" (PID 856418) exited with exit code 1 LOG: background worker \"GPUCache Startup Preloader\" (PID 856427) exited with exit code 1 LOG: create GpuCacheSharedState dpoints:164c95f71 LOG: gpucache: AllocMemory dpoints:164c95f71 (main_sz=772505600, extra_sz=0) LOG: gpucache: auto preload 'public.dpoints' (DB: postgres) LOG: create GpuCacheSharedState mytest:1773a589b LOG: gpucache: auto preload 'public.mytest' (DB: postgres) LOG: gpucache: AllocMemory mytest:1773a589b (main_sz=675028992, extra_sz=0)","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30aa\u30d7\u30b7\u30e7\u30f3"},{"location":"gpucache/#_4","text":"","title":"\u904b\u7528"},{"location":"gpucache/#gpu_3","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u53c2\u7167\u306f\u900f\u904e\u7684\u306b\u884c\u308f\u308c\u307e\u3059\u3002\u30e6\u30fc\u30b6\u306f\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u6709\u7121\u3092\u610f\u8b58\u3059\u308b\u5fc5\u8981\u306f\u306a\u304f\u3001PG-Strom\u304c\u81ea\u52d5\u7684\u306b\u5224\u5b9a\u3057\u3066\u51e6\u7406\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u306f\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u8a2d\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb dpoints \u3078\u306e\u53c2\u7167\u3092\u542b\u3080\u3082\u306e\u3067\u3059\u3002\u4e0b\u304b\u30893\u884c\u76ee\u306e\u300cGPU Cache\u300d\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u3001\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u57fa\u672c\u7684\u306a\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u3066\u304a\u308a\u3001\u3053\u306e\u30af\u30a8\u30ea\u3067\u306f dpoints \u30c6\u30fc\u30d6\u30eb\u3092\u8aad\u307f\u51fa\u3059\u306e\u3067\u306f\u306a\u304f\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u53c2\u7167\u3057\u3066\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 \u306a\u304a\u3001 max_num_rows \u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4fdd\u6301\u3067\u304d\u308b\u6700\u5927\u306e\u884c\u6570\u3001 main \u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u56fa\u5b9a\u9577\u30d5\u30a3\u30fc\u30eb\u30c9\u7528\u306e\u9818\u57df\u306e\u5927\u304d\u3055\u3001 extra \u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306f\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u5927\u304d\u3055\u3067\u3059\u3002 =# explain select pref, city, count(*) from giscity g, dpoints d where pref = 'Tokyo' and st_contains(g.geom,st_makepoint(d.x, d.y)) group by pref, city; QUERY PLAN -------------------------------------------------------------------------------------------------------- HashAggregate (cost=5638809.75..5638859.99 rows=5024 width=29) Group Key: g.pref, g.city -> Custom Scan (GpuPreAgg) (cost=5638696.71..5638759.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=631923.57..5606933.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) GPU Cache: NVIDIA Tesla V100-PCIE-16GB [max_num_rows: 12000000, main: 772.51M, extra: 0] -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (16 rows)","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5229\u7528\u3092\u78ba\u8a8d\u3059\u308b"},{"location":"gpucache/#gpu_4","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u73fe\u5728\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f pgstrom.gpucache_info \u30d3\u30e5\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | refcnt | corrupted | gpu_main_sz | gpu_extra_sz | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------+------------+--------+-----------+-------------+--------------+----------------------------+-------------------+----------------+------------------+---------------+---------------+------------------------------------------------------------------------------------------------------------------------ 12728 | postgres | 25244 | mytest | 6295279771 | 3 | f | 675028992 | 0 | 2021-05-14 03:00:18.623503 | 500000 | 36000000 | 500000 | 36000000 | 36000000 | gpu_device_id=0,max_num_rows=10485760,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 12728 | postgres | 25262 | dpoints | 5985886065 | 3 | f | 772505600 | 0 | 2021-05-14 03:00:18.524627 | 8000000 | 576000192 | 8000000 | 576000192 | 576000192 | gpu_device_id=0,max_num_rows=12000000,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 (2 rows) \u3053\u306e\u30d3\u30e5\u30fc\u3067\u8868\u793a\u3055\u308c\u308bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u72b6\u614b\u306f\u3001\u305d\u306e\u6642\u70b9\u3067\u521d\u671f\u30ed\u30fc\u30c9\u304c\u7d42\u308f\u3063\u3066\u304a\u308a\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u9818\u57df\u304c\u78ba\u4fdd\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3060\u3051\u3067\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u3064\u307e\u308a\u3001\u30c8\u30ea\u30ac\u95a2\u6570\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u304c\u521d\u671f\u30ed\u30fc\u30c9\u304c\u7d42\u308f\u3063\u3066\u3044\u306a\u3044\uff08\u307e\u3060\u8ab0\u3082\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3044\u306a\u3044\uff09\u5834\u5408\u3001\u6f5c\u5728\u7684\u306b\u78ba\u4fdd\u3055\u308c\u3046\u308bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u307e\u3060 pgstrom.gpucache_info \u306b\u306f\u73fe\u308c\u307e\u305b\u3093\u3002 \u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u610f\u5473\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 database_oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eOID\u3067\u3059 database_name GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u540d\u524d\u3067\u3059 table_oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306eOID\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 table_name GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u540d\u524d\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 signature GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4e00\u610f\u6027\u3092\u793a\u3059\u30cf\u30c3\u30b7\u30e5\u5024\u3067\u3059\u3002\u4f8b\u3048\u3070 ALTER TABLE \u306e\u524d\u5f8c\u306a\u3069\u3067\u3053\u306e\u5024\u304c\u5909\u308f\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 refcnt GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u53c2\u7167\u30ab\u30a6\u30f3\u30bf\u3067\u3059\u3002\u3053\u308c\u306f\u5fc5\u305a\u3057\u3082\u6700\u65b0\u306e\u5024\u3092\u53cd\u6620\u3057\u3066\u3044\u308b\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002 corrupted GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5185\u5bb9\u304c\u7834\u640d\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u793a\u3057\u307e\u3059\u3002 gpu_main_sz GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306b\u78ba\u4fdd\u3055\u308c\u305f\u56fa\u5b9a\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_extra_sz GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306b\u78ba\u4fdd\u3055\u308c\u305f\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 redo_write_ts REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u6700\u5f8c\u306b\u66f4\u65b0\u3057\u305f\u6642\u523b\u3067\u3059\u3002 redo_write_nitems REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_write_pos REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_read_nitems REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_read_pos REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_sync_pos REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u3046\u3061\u3001\u65e2\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3078\u306e\u9069\u7528\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u305f\u4f4d\u7f6e\u3067\u3059\u3002 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u6b8b\u308a\u5bb9\u91cf\u304c\u903c\u8feb\u3057\u3066\u304d\u305f\u969b\u306b\u3001\u591a\u6570\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u540c\u6642\u306b\u975e\u540c\u671f\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u767a\u751f\u3055\u305b\u308b\u4e8b\u3092\u907f\u3051\u308b\u305f\u3081\u3001\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002 config_options GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3067\u3059\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b"},{"location":"gpucache/#gpu_5","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b max_num_rows \u3067\u6307\u5b9a\u3057\u305f\u4ee5\u4e0a\u306e\u884c\u6570\u3092\u633f\u5165\u3057\u3088\u3046\u3068\u3057\u305f\u308a\u3001\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u306e\u30d0\u30c3\u30d5\u30a1\u9577\u304c\u80a5\u5927\u5316\u3057\u3059\u304e\u305f\u308a\u3001 \u3068\u3044\u3063\u305f\u7406\u7531\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306bREDO\u30ed\u30b0\u3092\u9069\u7528\u3067\u304d\u306a\u304b\u3063\u305f\u5834\u5408\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u7834\u640d\uff08corrupted\uff09\u72b6\u614b\u306b\u79fb\u884c\u3057\u307e\u3059\u3002 \u4e00\u5ea6GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u7834\u640d\u3059\u308b\u3068\u3001\u3053\u308c\u3092\u624b\u52d5\u3067\u5fa9\u65e7\u3059\u308b\u307e\u3067\u306f\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u53c2\u7167\u3059\u308b\u4e8b\u306f\u306a\u304f\u306a\u308a\u3001 \u307e\u305f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u66f4\u65b0\u306b\u969b\u3057\u3066\u3082REDO\u30ed\u30b0\u306e\u8a18\u9332\u3092\u884c\u308f\u306a\u304f\u306a\u308a\u307e\u3059\u3002 \uff08\u904b\u60aa\u304f\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u304c\u5b9f\u884c\u3092\u958b\u59cb\u3057\u305f\u5f8c\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u7834\u640d\u3057\u305f\u5834\u5408\u3001\u305d\u306e\u30af\u30a8\u30ea\u306f\u30a8\u30e9\u30fc\u3092\u8fd4\u3059\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002\uff09 GPU\u30d0\u30c3\u30d5\u30a1\u3092\u7834\u640d\u72b6\u614b\u304b\u3089\u5fa9\u5143\u3059\u308b\u306e\u306f pgstrom.gpucache_recovery(regclass) \u95a2\u6570\u3067\u3059\u3002 REDO\u30ed\u30b0\u3092\u9069\u7528\u3067\u304d\u306a\u304b\u3063\u305f\u539f\u56e0\u3092\u53d6\u308a\u9664\u3044\u305f\u4e0a\u3067\u3053\u306e\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u518d\u5ea6\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u521d\u671f\u30ed\u30fc\u30c9\u3092\u884c\u3044\u3001\u5143\u306e\u72b6\u614b\u3078\u306e \u5fa9\u65e7\u3092\u8a66\u307f\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001 max_num_rows \u3067\u6307\u5b9a\u3057\u305f\u4ee5\u4e0a\u306e\u884c\u6570\u3092\u633f\u5165\u3057\u3088\u3046\u3068\u3057\u305f\u5834\u5408\u3067\u3042\u308c\u3070\u3001\u30c8\u30ea\u30ac\u306e\u5b9a\u7fa9\u3092\u5909\u66f4\u3057\u3066 max_num_rows \u8a2d\u5b9a\u3092 \u62e1\u5927\u3059\u308b\u304b\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u4e00\u90e8\u306e\u884c\u3092\u524a\u9664\u3057\u305f\u5f8c\u3067\u3001 pgstrom.gpucache_recovery() \u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3068\u3044\u3046\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u7834\u640d\u3068\u5fa9\u5143"},{"location":"install/","text":"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u672c\u7ae0\u3067\u306fPG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8 \u30cf\u30fc\u30c9\u30a6\u30a7\u30a2 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30aa\u30da\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u3092\u52d5\u4f5c\u53ef\u80fd\u306a x86_64 \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306e\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u304c\u5fc5\u8981\u3067\u3059\u3002 CPU\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3001\u304a\u3088\u3073\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30c7\u30d0\u30a4\u30b9\u306b\u306f\u7279\u5225\u306a\u8981\u4ef6\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001 note002:HW Validation List \u306f\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9078\u5b9a\u306e\u4e0a\u3067\u53c2\u8003\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3092\u5229\u7528\u3059\u308b\u306b\u306fNVME\u898f\u683c\u306b\u5bfe\u5fdc\u3057\u305fSSD\u3001\u307e\u305f\u306fRoCE\u306b\u5bfe\u5fdc\u3057\u305f\u9ad8\u901fNIC\u304c\u5fc5\u8981\u3067\u3001GPU\u3068\u540c\u4e00\u306ePCIe Root Complex\u914d\u4e0b\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9 PG-Strom\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u5c11\u306a\u304f\u3068\u3082\u4e00\u500b\u306eGPU\u30c7\u30d0\u30a4\u30b9\u304c\u30b7\u30b9\u30c6\u30e0\u4e0a\u306b\u5fc5\u8981\u3067\u3059\u3002\u3053\u308c\u3089\u306fCUDA Toolkit\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u304a\u308a\u3001computing capability \u304c6.0\u4ee5\u964d\u306e\u30e2\u30c7\u30eb\uff08Pascal\u4e16\u4ee3\u4ee5\u964d\uff09\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 002: HW Validation List - List of supported GPU models \u3092\u53c2\u8003\u306bGPU\u3092\u9078\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Operating System PG-Strom\u306e\u5b9f\u884c\u306b\u306f\u3001CUDA Toolkit\u306b\u3088\u308a\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308bx86_64\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u5411\u3051\u306eLinux OS\u304c\u5fc5\u8981\u3067\u3059\u3002\u63a8\u5968\u74b0\u5883\u306fRed Hat Enterprise Linux\u307e\u305f\u306fRocky Linux\u30d0\u30fc\u30b8\u30e7\u30f3 8.x\u3067\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\uff08cuFile\u30c9\u30e9\u30a4\u30d0\uff09\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u3001CUDA Toolkit\u306b\u542b\u307e\u308c\u308bnvidia-fs\u30c9\u30e9\u30a4\u30d0\u3068\u3001Mellanox OFED (OpenFabrics Enterprise Distribution) \u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002 PostgreSQL PG-Strom v5.0\u306e\u5b9f\u884c\u306b\u306fPostgreSQL\u30d0\u30fc\u30b8\u30e7\u30f315\u4ee5\u964d\u304c\u5fc5\u8981\u3067\u3059\u3002 PG-Strom\u304c\u5185\u90e8\u7684\u306b\u5229\u7528\u3057\u3066\u3044\u308bAPI\u306e\u4e2d\u306b\u306f\u3001\u3053\u308c\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u63d0\u4f9b\u3055\u308c\u3066\u3044\u306a\u3044\u3082\u306e\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002 CUDA Toolkit PG-Strom\u306e\u5b9f\u884c\u306b\u306fCUDA Toolkit \u30d0\u30fc\u30b8\u30e7\u30f312.2update2\u4ee5\u964d\u304c\u5fc5\u8981\u3067\u3059\u3002 PG-Strom\u304c\u5185\u90e8\u7684\u306b\u5229\u7528\u3057\u3066\u3044\u308bAPI\u306e\u4e2d\u306b\u306f\u3001\u3053\u308c\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u63d0\u4f9b\u3055\u308c\u3066\u3044\u306a\u3044\u3082\u306e\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806 \u4e00\u9023\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3068\u306a\u308a\u307e\u3059\u3002 H/W\u306e\u521d\u671f\u8a2d\u5b9a OS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb MOFED\u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb CUDA Toolkit \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb HeteroDB\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PostgreSQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PostgreSQL\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u5fc5\u8981\u306b\u5fdc\u3058\u3066\uff09 PostGIS contrib/cube OS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3092\u9078\u629e\u3057\u3001\u500b\u3005\u306e\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d7\u30ed\u30bb\u30b9\u306b\u5f93\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4f5c\u696d\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306f\u3001 NVIDIA DEVELOPER ZONE \u306b\u304a\u3044\u3066\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002 Red Hat Enterprise Linux 8.x\u7cfb\u5217\uff08Rocky Linux 8.x\u7cfb\u5217\u3092\u542b\u3080\uff09\u306e\u5834\u5408\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u69cb\u6210\u306f\u3001\u30d9\u30fc\u30b9\u74b0\u5883\u3068\u3057\u3066\u300c\u6700\u5c0f\u9650\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3001\u3055\u3089\u306b\u8ffd\u52a0\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u3057\u3066\u300c\u958b\u767a\u30c4\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Red Hat Enterprise Linux 9.x\u7cfb\u5217\uff08Rocky Linux 9.x\u7cfb\u5217\u3092\u542b\u3080\uff09\u306e\u5834\u5408\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u69cb\u6210\u306f\u3001\u30d9\u30fc\u30b9\u74b0\u5883\u3068\u3057\u3066\u300c\u6700\u5c0f\u9650\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3001\u3055\u3089\u306b\u8ffd\u52a0\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u3057\u3066\u300c\u6a19\u6e96\u300d\u300c\u958b\u767a\u30c4\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30b5\u30fc\u30d0\u30fc\u3078\u306eOS\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u3001\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u30fc\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u306b\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002 \u306a\u304a\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u3067\u300c\u958b\u767a\u30c4\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067OS\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306b\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 # dnf groupinstall 'Development Tools' Tip \u30b5\u30fc\u30d0\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308bGPU\u304c\u65b0\u3057\u3059\u304e\u308b\u5834\u5408\u3001OS\u8d77\u52d5\u4e2d\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u7b49\u306e\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u5834\u5408\u3001\u30ab\u30fc\u30cd\u30eb\u8d77\u52d5\u30aa\u30d7\u30b7\u30e7\u30f3\u306b nouveau.modeset=0 \u3092\u8ffd\u52a0\u3057\u3066\u6a19\u6e96\u306e\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u30c9\u30e9\u30a4\u30d0\u3092\u7121\u52b9\u5316\u3059\u308b\u4e8b\u3067 \u554f\u984c\u3092\u56de\u907f\u3067\u304d\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 nouveau\u30c9\u30e9\u30a4\u30d0\u306e\u7121\u52b9\u5316 NVIDIA\u88fdGPU\u5411\u3051\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u4e92\u63db\u30c9\u30e9\u30a4\u30d0\u3067\u3042\u308bnouveau\u30c9\u30e9\u30a4\u30d0\u304c\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001nvidia\u30c9\u30e9\u30a4\u30d0\u3092\u30ed\u30fc\u30c9\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002 \u3053\u306e\u5834\u5408\u306f\u3001nouveau\u30c9\u30e9\u30a4\u30d0\u306e\u7121\u52b9\u5316\u8a2d\u5b9a\u3092\u884c\u3063\u305f\u4e0a\u3067\u30b7\u30b9\u30c6\u30e0\u3092\u4e00\u5ea6\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 nouveau\u30c9\u30e9\u30a4\u30d0\u3092\u7121\u52b9\u5316\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092 /etc/modprobe.d/disable-nouveau.conf \u3068\u3044\u3046\u540d\u524d\u3067\u4fdd\u5b58\u3057\u3001 dracut \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066Linux kernel\u306e\u30d6\u30fc\u30c8\u30a4\u30e1\u30fc\u30b8\u306b\u53cd\u6620\u3057\u307e\u3059\u3002 \u305d\u306e\u5f8c\u3001\u30b7\u30b9\u30c6\u30e0\u3092\u4e00\u5ea6\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 # cat > /etc/modprobe.d/disable-nouveau.conf </kernel/drivers/nvme/host/nvme-rdma.ko.xz \uff09\u3067\u306f\u306a\u304f\u3001\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f /lib/modules//extra/mlnx-nvme/host/nvme-rdma.ko \u304c\u512a\u5148\u3057\u3066\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002 $ modinfo nvme-rdma filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/mlnx-nvme/host/nvme-rdma.ko license: GPL v2 rhelversion: 9.4 srcversion: 16C0049F26768D6EA12771B depends: nvme-core,rdma_cm,ib_core,nvme-fabrics,mlx_compat retpoline: Y name: nvme_rdma vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions parm: register_always:Use memory registration even for contiguous memory regions (bool) \u65e2\u306b\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\uff08\u4f8b: nvme \uff09\u3092\u7f6e\u304d\u63db\u3048\u308b\u305f\u3081\u3001\u3053\u3053\u3067\u4e00\u5ea6\u30b7\u30b9\u30c6\u30e0\u306e\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3068\u518d\u8d77\u52d5\u3092\u884c\u3044\u307e\u3059\u3002 mlnxofedinstall \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b8c\u4e86\u5f8c\u306b\u3001 dracut -f \u3092\u5b9f\u884c\u3059\u308b\u306e\u3092\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002 Tips Linux kernel\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3068MOFED\u30c9\u30e9\u30a4\u30d0 RHEL\u7cfb\u5217\u306e\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306b\u304a\u3044\u3066\u3001MODED\u30c9\u30e9\u30a4\u30d0\u306fDKMS(Dynamic Kernel Module Support)\u3092\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002 \u305d\u306e\u305f\u3081\u3001Linux kernel\u3092\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3057\u305f\u5834\u5408\u306b\u306f\u3001\u4e0a\u8a18\u306e\u624b\u9806\u3092\u518d\u5ea6\u5b9f\u884c\u3057\u3001\u65b0\u3057\u3044Linux kernel\u306b\u5bfe\u5fdc\u3057\u305fMOFED\u30c9\u30e9\u30a4\u30d0\u3092\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u5f8c\u8ff0\u306eCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u66f4\u65b0\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067Linux kernel\u304c\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3055\u308c\u308b\u4e8b\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u305d\u306e\u5834\u5408\u3067\u3082\u540c\u69d8\u3067\u3059\u3002 heterodb-swdc\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PG-Strom\u307b\u304b\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8\u306f HeteroDB Software Distribution Center \u304b\u3089\u914d\u5e03\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u5165\u624b\u3059\u308b\u305f\u3081\u306b\u3001HeteroDB-SWDC\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u3092yum\u30b7\u30b9\u30c6\u30e0\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 HeteroDB-SWDC\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u5b9a\u7fa9\u306fheterodb-swdc\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3088\u308a\u63d0\u4f9b\u3055\u308c\u307e\u3059\u3002 Web\u30d6\u30e9\u30a6\u30b6\u306a\u3069\u3067 HeteroDB Software Distribution Center \u3078\u30a2\u30af\u30bb\u30b9\u3057\u3001\u30da\u30fc\u30b8\u306e\u5148\u982d\u306b\u30ea\u30f3\u30af\u306e\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b heterodb-swdc-1.3-1.el9.noarch.rpm \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08RHEL8\u306e\u5834\u5408\u306f heterodb-swdc-1.3-1.el8.noarch.rpm \uff09 heterodb-swdc\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u3068\u3001HeteroDB-SWDC\u304b\u3089\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u5165\u624b\u3059\u308b\u305f\u3081\u306eyum\u30b7\u30b9\u30c6\u30e0\u3078\u306e\u8a2d\u5b9a\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306bheterodb-swdc\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 # dnf install https://heterodb.github.io/swdc/yum/rhel8-noarch/heterodb-swdc-1.2-1.el8.noarch.rpm CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u672c\u7bc0\u3067\u306fCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u65e2\u306b\u6700\u65b0\u306eCUDA Toolkit\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3067\u3042\u308b\u5834\u5408\u3001\u672c\u7bc0\u306e\u521d\u671f\u8a2d\u5b9a\u3068\u5408\u81f4\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 NVIDIA\u306fCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\uff12\u901a\u308a\u306e\u65b9\u6cd5\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002\u4e00\u3064\u306f\u81ea\u5df1\u5b9f\u884c\u578b\u30a2\u30fc\u30ab\u30a4\u30d6\uff08runfile\uff09\u306b\u3088\u308b\u3082\u306e\u3002\u3082\u3046\u4e00\u3064\u306fRPM\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3088\u308b\u3082\u306e\u3067\u3001PG-Strom\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u306fRPM\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u63a8\u5968\u3057\u307e\u3059\u3002 CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u7528\u30d1\u30c3\u30b1\u30fc\u30b8\u306fNVIDIA DEVELOPER ZONE\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u9069\u5207\u306aOS\u3001\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3001\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3001\u300erpm(network)\u300f\u7248\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u300erpm(network)\u300f\u3092\u9078\u629e\u3059\u308b\u3068\u3001\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u767b\u9332\u3057\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7d4c\u7531\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u306e\u30b7\u30a7\u30eb\u30b3\u30de\u30f3\u30c9\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u30ac\u30a4\u30c0\u30f3\u30b9\u901a\u308a\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u9032\u3081\u3066\u304f\u3060\u3055\u3044\u3002 # dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo # dnf clean all # dnf install cuda-toolkit-12-5 CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u7d9a\u3044\u3066\u3001\u30c9\u30e9\u30a4\u30d0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u305f\u3081\u306e\u30b3\u30de\u30f3\u30c9\u304c\uff12\u7a2e\u985e\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u3053\u3067\u306f \u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248\u306envidia-driver \u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248\u306e\u307f\u304cGPUDirect Storage\u6a5f\u80fd\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u304a\u308a\u3001PG-Strom\u306eGPU-Direct SQL\u306f\u672c\u6a5f\u80fd\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002 Tips Volta\u4ee5\u524d\u306eGPU\u306e\u5229\u7528\u306b\u3064\u3044\u3066 \u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248nvidia\u30c9\u30e9\u30a4\u30d0\u306f\u3001Volta\u4e16\u4ee3\u4ee5\u524d\u306eGPU\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002 \u3057\u305f\u304c\u3063\u3066\u3001Volta\u307e\u305f\u306fPascal\u4e16\u4ee3\u306eGPU\u3067PG-Strom\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u30d7\u30ed\u30d7\u30e9\u30a8\u30bf\u30ea\u7248\u306e\u30c9\u30e9\u30a4\u30d0\u304cGPUDirect Storage\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308bCUDA 12.2\u3092\u5229\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 CUDA 12.2\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306f \u3053\u3061\u3089 \u304b\u3089\u5165\u624b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u7d9a\u3044\u3066\u3001GPU-Direct Storage(GDS)\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306e\u30c9\u30e9\u30a4\u30d0\u30e2\u30b8\u30e5\u30fc\u30eb nvidia-gds \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u306b\u7d9a\u3044\u3066CUDA Toolkit\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u540c\u4e00\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u540d\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 # dnf module install nvidia-driver:open-dkms # dnf install nvidia-gds-12-5 \u6b63\u5e38\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001 /usr/local/cuda \u914d\u4e0b\u306bCUDA Toolkit\u304c\u5c0e\u5165\u3055\u308c\u3066\u3044\u307e\u3059\u3002 $ ls /usr/local/cuda/ bin/ gds/ nsightee_plugins/ targets/ compute-sanitizer/ include@ nvml/ tools/ CUDA_Toolkit_Release_Notes.txt lib64@ nvvm/ version.json DOCS libnvvp/ README EULA.txt LICENSE share/ extras/ man/ src/ \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001GPU\u304c\u6b63\u3057\u304f\u8a8d\u8b58\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 nvidia-smi \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u51fa\u529b\u4f8b\u306e\u3088\u3046\u306b\u3001\u30b7\u30b9\u30c6\u30e0\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308bGPU\u306e\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 $ nvidia-smi Mon Jun 3 09:56:41 2024 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 555.42.02 Driver Version: 555.42.02 CUDA Version: 12.5 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA A100-PCIE-40GB Off | 00000000:41:00.0 Off | 0 | | N/A 58C P0 66W / 250W | 1MiB / 40960MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+ GPUDirect Storage\u306e\u78ba\u8a8d \u4e0a\u8a18\u306e\u624b\u9806\u3067CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001GPUDirect Storage\u304c\u5229\u7528\u53ef\u80fd\u306a\u72b6\u614b\u3068\u306a\u3063\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u901a\u308a\u3001 gdscheck \u30c4\u30fc\u30eb\u3092\u7528\u3044\u3066\u30b9\u30c8\u30ec\u30fc\u30b8\u30c7\u30d0\u30a4\u30b9\u6bce\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \uff08\u3053\u306e\u4f8b\u3067\u306f\u3001 nvme \u3060\u3051\u3067\u306a\u304f\u3001 nvme-rdma \u3084 rpcrdma \u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\u3082\u30ed\u30fc\u30c9\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u95a2\u9023\u3059\u308b\u6a5f\u80fd\u304c Supported \u3068\u306a\u3063\u3066\u3044\u307e\u3059\uff09 # /usr/local/cuda/gds/tools/gdscheck -p GDS release version: 1.10.0.4 nvidia_fs version: 2.20 libcufile version: 2.12 Platform: x86_64 ============ ENVIRONMENT: ============ ===================== DRIVER CONFIGURATION: ===================== NVMe : Supported NVMeOF : Supported SCSI : Unsupported ScaleFlux CSD : Unsupported NVMesh : Unsupported DDN EXAScaler : Unsupported IBM Spectrum Scale : Unsupported NFS : Supported BeeGFS : Unsupported WekaFS : Unsupported Userspace RDMA : Unsupported --Mellanox PeerDirect : Disabled --rdma library : Not Loaded (libcufile_rdma.so) --rdma devices : Not configured --rdma_device_status : Up: 0 Down: 0 ===================== CUFILE CONFIGURATION: ===================== properties.use_compat_mode : true properties.force_compat_mode : false properties.gds_rdma_write_support : true properties.use_poll_mode : false properties.poll_mode_max_size_kb : 4 properties.max_batch_io_size : 128 properties.max_batch_io_timeout_msecs : 5 properties.max_direct_io_size_kb : 16384 properties.max_device_cache_size_kb : 131072 properties.max_device_pinned_mem_size_kb : 33554432 properties.posix_pool_slab_size_kb : 4 1024 16384 properties.posix_pool_slab_count : 128 64 32 properties.rdma_peer_affinity_policy : RoundRobin properties.rdma_dynamic_routing : 0 fs.generic.posix_unaligned_writes : false fs.lustre.posix_gds_min_kb: 0 fs.beegfs.posix_gds_min_kb: 0 fs.weka.rdma_write_support: false fs.gpfs.gds_write_support: false profile.nvtx : false profile.cufile_stats : 0 miscellaneous.api_check_aggressive : false execution.max_io_threads : 4 execution.max_io_queue_depth : 128 execution.parallel_io : true execution.min_io_threshold_size_kb : 8192 execution.max_request_parallelism : 4 properties.force_odirect_mode : false properties.prefer_iouring : false ========= GPU INFO: ========= GPU index 0 NVIDIA A100-PCIE-40GB bar:1 bar size (MiB):65536 supports GDS, IOMMU State: Disabled ============== PLATFORM INFO: ============== IOMMU: disabled Nvidia Driver Info Status: Supported(Nvidia Open Driver Installed) Cuda Driver Version Installed: 12050 Platform: AS -2014CS-TR, Arch: x86_64(Linux 5.14.0-427.18.1.el9_4.x86_64) Platform verification succeeded Tips RAID\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306e\u8ffd\u52a0\u8a2d\u5b9a GPUDirect Storage\u3092\u5229\u7528\u3057\u3066Software RAID (md-raid0) \u533a\u753b\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3059\u5834\u5408\u3001 \u4ee5\u4e0b\u306e\u4e00\u884c\u3092 /lib/udev/rules.d/63-md-raid-arrays.rules \u8a2d\u5b9a\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 IMPORT{\u200bprogram}=\"/usr/sbin/mdadm --detail --export $devnode\" \u305d\u306e\u5f8c\u3001\u8a2d\u5b9a\u3092\u53cd\u6620\u3055\u305b\u308b\u305f\u3081\u306b\u30b7\u30b9\u30c6\u30e0\u3092\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u8a73\u3057\u304f\u306f NVIDIA GPUDirect Storage Installation and Troubleshooting Guide \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 PCI Bar1\u30e1\u30e2\u30ea\u306e\u8a2d\u5b9a GPU-Direct SQL\u306f\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u3092\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u4e0a\u306ePCI BAR1\u9818\u57df\uff08\u7269\u7406\u30a2\u30c9\u30ec\u30b9\u7a7a\u9593\uff09\u306b\u30de\u30c3\u30d7\u3057\u3001\u305d\u3053\u3092Destination\u3068\u3059\u308bP2P-RDMA\u8981\u6c42\u3092NVME\u6a5f\u5668\u306b\u5bfe\u3057\u3066\u884c\u3046\u4e8b\u3067\u3001\u30ed\u30b9\u306e\u306a\u3044\u9ad8\u901f\u306a\u30c7\u30fc\u30bf\u8aad\u51fa\u3057\u3092\u5b9f\u73fe\u3057\u307e\u3059\u3002 \u5341\u5206\u306a\u591a\u91cd\u5ea6\u3092\u6301\u3063\u305fP2P-RDMA\u3092\u884c\u3046\u306b\u306f\u3001GPU\u304c\u30d0\u30c3\u30d5\u30a1\u3092\u30de\u30c3\u30d7\u3059\u308b\u306e\u306b\u5341\u5206\u306aPCI BAR1\u9818\u57df\u3092\u6709\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u5927\u534a\u306eGPU\u3067\u306fPCI BAR1\u9818\u57df\u306e\u5927\u304d\u3055\u306f\u56fa\u5b9a\u3067\u3001PG-Strom\u306b\u304a\u3044\u3066\u306f\u3001\u305d\u308c\u304cGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30b5\u30a4\u30ba\u3092\u4e0a\u56de\u3063\u3066\u3044\u308b\u88fd\u54c1\u3092\u63a8\u5968\u3057\u3066\u3044\u307e\u3059\u3002 \u3057\u304b\u3057\u3001\u4e00\u90e8\u306eGPU\u88fd\u54c1\u306b\u304a\u3044\u3066\u306f\u300e\u52d5\u4f5c\u30e2\u30fc\u30c9\u300f\u3092\u5207\u308a\u66ff\u3048\u308b\u4e8b\u3067PCI BAR1\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3092\u5207\u308a\u66ff\u3048\u308b\u4e8b\u304c\u3067\u304d\u308b\u3082\u306e\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u304a\u4f7f\u3044\u306eGPU\u304c\u305d\u308c\u306b\u8a72\u5f53\u3059\u308b\u5834\u5408\u306f\u3001 NVIDIA Display Mode Selector Tool \u3092\u53c2\u7167\u306e\u4e0a\u3001PCI BAR1\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3092\u6700\u5927\u5316\u3059\u308b\u30e2\u30fc\u30c9\u3078\u3068\u5207\u308a\u66ff\u3048\u3066\u304f\u3060\u3055\u3044\u3002 2023\u5e7412\u6708\u6642\u70b9\u3067\u306f\u3001\u4ee5\u4e0b\u306eGPU\u306e\u5834\u5408\u306bNVIDIA Display Mode Selector Tool\u3092\u5229\u7528\u3057\u3066 *Display Off \u30e2\u30fc\u30c9\u3078\u3068\u5207\u308a\u66ff\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 NVIDIA L40S NVIDIA L40 NVIDIA A40 NVIDIA RTX 6000 Ada NVIDIA RTX A6000 NVIDIA RTX A5500 NVIDIA RTX A5000 \u30b7\u30b9\u30c6\u30e0\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308bGPU\u306e\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u3084PCI BAR1\u30b5\u30a4\u30ba\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f\u3001 nvidia-smi -q \u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u30e1\u30e2\u30ea\u95a2\u9023\u306e\u72b6\u614b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 $ nvidia-smi -q : FB Memory Usage Total : 46068 MiB Reserved : 685 MiB Used : 4 MiB Free : 45377 MiB BAR1 Memory Usage Total : 65536 MiB Used : 1 MiB Free : 65535 MiB : HeteroDB \u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb heterodb-extra \u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001PG-Strom\u306b\u4ee5\u4e0b\u306e\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002 \u30de\u30eb\u30c1GPU\u306e\u5bfe\u5fdc GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5bfe\u5fdc \u30e9\u30a4\u30bb\u30f3\u30b9\u7ba1\u7406\u6a5f\u80fd \u3053\u308c\u3089\u306e\u6a5f\u80fd\u3092\u4f7f\u7528\u305b\u305a\u3001\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248\u306e\u6a5f\u80fd\u306e\u307f\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f heterodb-extra \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u4e0d\u8981\u3067\u3059\u3002 \u672c\u7bc0\u306e\u5185\u5bb9\u306f\u8aad\u307f\u98db\u3070\u3057\u3066\u69cb\u3044\u307e\u305b\u3093\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001SWDC\u304b\u3089 heterodb-extra \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002 # dnf install heterodb-extra \u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u6709\u52b9\u5316 heterodb-extra \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5168\u3066\u306e\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u3001HeteroDB\u793e\u304c\u63d0\u4f9b\u3059\u308b\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u6709\u52b9\u5316\u304c\u5fc5\u8981\u3067\u3059\u3002\u30e9\u30a4\u30bb\u30f3\u30b9\u306a\u3057\u3067\u904b\u7528\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001\u305d\u306e\u5834\u5408\u3001\u4e0b\u8a18\u306e\u6a5f\u80fd\u304c\u5236\u9650\u3092\u53d7\u3051\u307e\u3059\u3002 \u30de\u30eb\u30c1GPU\u306e\u5229\u7528 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306b\u304a\u3051\u308b\u8907\u6570NVME-SSD\u306b\u3088\u308b\u30b9\u30c8\u30e9\u30a4\u30d4\u30f3\u30b0(md-raid0) GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306b\u304a\u3051\u308bNVME-oF\u30c7\u30d0\u30a4\u30b9\u306e\u5229\u7528 GPU\u7248PostGIS\u306b\u304a\u3051\u308bGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u5229\u7528 \u30e9\u30a4\u30bb\u30f3\u30b9\u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5f62\u5f0f\u3067HeteroDB\u793e\u304b\u3089\u5165\u624b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 IAgIVdKxhe+BSer3Y67jQW0+uTzYh00K6WOSH7xQ26Qcw8aeUNYqJB9YcKJTJb+QQhjmUeQpUnboNxVwLCd3HFuLXeBWMKp11/BgG0FSrkUWu/ZCtDtw0F1hEIUY7m767zAGV8y+i7BuNXGJFvRlAkxdVO3/K47ocIgoVkuzBfLvN/h9LffOydUnHPzrFHfLc0r3nNNgtyTrfvoZiXegkGM9GBTAKyq8uWu/OGonh9ybzVKOgofhDLk0rVbLohOXDhMlwDl2oMGIr83tIpCWG+BGE+TDwsJ4n71Sv6n4bi/ZBXBS498qShNHDGrbz6cNcDVBa+EuZc6HzZoF6UrljEcl= ---- VERSION:2 SERIAL_NR:HDB-TRIAL ISSUED_AT:2019-05-09 EXPIRED_AT:2019-06-08 GPU_UUID:GPU-a137b1df-53c9-197f-2801-f2dccaf9d42f \u3053\u308c\u3092 /etc/heterodb.license \u306b\u30b3\u30d4\u30fc\u3057\u3001PostgreSQL\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306bPostgreSQL\u306e\u8d77\u52d5\u30ed\u30b0\u306b\u30e9\u30a4\u30bb\u30f3\u30b9\u60c5\u5831\u304c\u51fa\u529b\u3055\u308c\u3001\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u6709\u52b9\u5316\u304c\u884c\u308f\u308c\u305f\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 : LOG: HeteroDB Extra module loaded [api_version=20231105,cufile=on,nvme_strom=off,githash=9ca2fe4d2fbb795ad2d741dcfcb9f2fe499a5bdf] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2022-11-19\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} LOG: PG-Strom version 5.0.1 built for PostgreSQL 15 (githash: 972441dbafed6679af86af40bc8613be2d73c4fd) : PostgreSQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u672c\u7bc0\u3067\u306fRPM\u306b\u3088\u308bPostgreSQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u30bd\u30fc\u30b9\u304b\u3089\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u95a2\u3057\u3066\u306f\u65e2\u306b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u6570\u591a\u304f\u5b58\u5728\u3057\u3001 ./configure \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u591a\u5c90\u306b\u308f\u305f\u308b\u4e8b\u304b\u3089\u3001\u3053\u3053\u3067\u306f\u7d39\u4ecb\u3057\u307e\u305b\u3093\u3002 Linux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u914d\u5e03\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3082PostgreSQL\u306f\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u5fc5\u305a\u3057\u3082\u6700\u65b0\u3067\u306f\u306a\u304f\u3001PG-Strom\u306e\u5bfe\u5fdc\u30d0\u30fc\u30b8\u30e7\u30f3\u3088\u308a\u3082\u53e4\u3044\u3082\u306e\u3067\u3042\u308b\u4e8b\u304c\u591a\u3005\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001Red Hat Enterprise Linux 7.x\u3067\u914d\u5e03\u3055\u308c\u3066\u3044\u308bPostgreSQL\u306fv9.2.x\u3067\u3059\u304c\u3001\u3053\u308c\u306fPostgreSQL\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3068\u3057\u3066\u65e2\u306bEOL\u3068\u306a\u3063\u3066\u3044\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3059\u3002 PostgreSQL Global Development Group\u306f\u3001\u6700\u65b0\u306ePostgreSQL\u304a\u3088\u3073\u95a2\u9023\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u914d\u5e03\u306e\u305f\u3081\u306byum\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002 EPEL\u306e\u8a2d\u5b9a\u306e\u3088\u3046\u306b\u3001yum\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u3060\u3051\u306e\u5c0f\u3055\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u305d\u306e\u5f8c\u3001PostgreSQL\u3084\u305d\u306e\u4ed6\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 yum\u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u306e\u4e00\u89a7\u306f http://yum.postgresql.org/repopackages.php \u3067\u3059\u3002 PostgreSQL\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u3068Linux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3054\u3068\u306b\u591a\u304f\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3042\u306a\u305f\u306eLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u5411\u3051\u306ePostgreSQL 15\u4ee5\u964d\u306e\u3082\u306e\u3092\u9078\u629e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30b9\u30c6\u30c3\u30d7\u3067 PostgreSQL \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3044\u307e\u3059\u3002 yum\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u5b9a\u7fa9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb OS\u6a19\u6e96\u306ePostgreSQL\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u7121\u52b9\u5316 PostgreSQL\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u4f8b\u3048\u3070PostgreSQL v16\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001PG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u306f postgresql16-server \u304a\u3088\u3073 postgresql16-devel \u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4ee5\u4e0b\u306f\u3001RHEL9\u306b\u304a\u3044\u3066PostgreSQL v16\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u624b\u9806\u306e\u4f8b\u3067\u3059\u3002 # dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm # dnf -y module disable postgresql # dnf install -y postgresql16-devel postgresql16-server Note Red Hat Enterprise Linux\u306e\u5834\u5408\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u540d postgresql \u304c\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u6a19\u6e96\u306e\u3082\u306e\u3068\u7af6\u5408\u3057\u3066\u3057\u307e\u3044\u3001PGDG\u63d0\u4f9b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001 dnf -y module disable postgresql \u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u3066\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u6a19\u6e96\u306e postgresql \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u7121\u52b9\u5316\u3057\u307e\u3059\u3002 PG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u672c\u7bc0\u3067\u306fPG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u63a8\u5968\u306fRPM\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u3059\u304c\u3001\u958b\u767a\u8005\u5411\u3051\u306b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u306e\u30d3\u30eb\u30c9\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3082\u7d39\u4ecb\u3057\u307e\u3059\u3002 RPM\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PG-Strom\u304a\u3088\u3073\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8\u306f HeteroDB Software Distribution Center \u3088\u308a\u914d\u5e03\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u65e2\u306byum\u30b7\u30b9\u30c6\u30e0\u3078\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u6e08\u307f\u3067\u3042\u308c\u3070\u3001\u305d\u308c\u307b\u3069\u4f5c\u696d\u306f\u591a\u304f\u3042\u308a\u307e\u305b\u3093\u3002 \u57fa\u76e4\u3068\u306a\u308bPostgreSQL\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3054\u3068\u306b\u5225\u500b\u306ePG-Strom\u306eRPM\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u6e96\u5099\u3055\u308c\u3066\u304a\u308a\u3001PostgreSQL v15\u7528\u3067\u3042\u308c\u3070 pg_strom-PG15 \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u3001PostgreSQL v16\u7528\u3067\u3042\u308c\u3070 pg_strom-PG16 \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u3001PostgreSQL\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30d0\u30a4\u30ca\u30ea\u4e92\u63db\u6027\u306b\u4f34\u3046\u5236\u7d04\u3067\u3059\u3002 # dnf install -y pg_strom-PG16 \u4ee5\u4e0a\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5b8c\u4e86\u3067\u3059\u3002 \u30bd\u30fc\u30b9\u304b\u3089\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u958b\u767a\u8005\u5411\u3051\u306b\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089PG-Strom\u3092\u30d3\u30eb\u30c9\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3082\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u5165\u624b RPM\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u540c\u69d8\u306b\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306etarball\u3092 HeteroDB Software Distribution Center \u304b\u3089\u5165\u624b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u305f\u3060\u3001tarball\u306e\u30ea\u30ea\u30fc\u30b9\u306b\u306f\u3042\u308b\u7a0b\u5ea6\u306e\u30bf\u30a4\u30e0\u30e9\u30b0\u304c\u751f\u3058\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u6700\u65b0\u306e\u958b\u767a\u7248\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306b\u306f PG-Strom\u306eGitHub\u30ea\u30dd\u30b8\u30c8\u30ea \u306e master \u30d6\u30e9\u30f3\u30c1\u3092\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3059\u308b\u65b9\u6cd5\u306e\u65b9\u304c\u597d\u307e\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 $ git clone https://github.com/heterodb/pg-strom.git Cloning into 'pg-strom'... remote: Counting objects: 13797, done. remote: Compressing objects: 100% (215/215), done. remote: Total 13797 (delta 208), reused 339 (delta 167), pack-reused 13400 Receiving objects: 100% (13797/13797), 11.81 MiB | 1.76 MiB/s, done. Resolving deltas: 100% (10504/10504), done. PG-Strom\u306e\u30d3\u30eb\u30c9 PG-Strom\u3092\u30d3\u30eb\u30c9\u3059\u308b\u6642\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u306f\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u306ePostgreSQL\u3068\u53b3\u5bc6\u306b\u4e00\u81f4\u3057\u3066\u3044\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070\u3001\u540c\u3058\u69cb\u9020\u4f53\u304c\u30d3\u30eb\u30c9\u6642\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u306b\u3088\u308aPostgreSQL\u3068PG-Strom\u3067\u7570\u306a\u3063\u305f\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u6301\u3063\u3066\u3057\u307e\u3063\u305f\u3068\u3059\u308c\u3070\u3001\u975e\u5e38\u306b\u767a\u898b\u306e\u96e3\u3057\u3044\u30d0\u30b0\u3092\u751f\u307f\u51fa\u3057\u3066\u3057\u307e\u3046\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 \u3057\u305f\u304c\u3063\u3066\u3001\uff08\u4e00\u8cab\u6027\u306e\u306a\u3044\u72b6\u614b\u3092\u907f\u3051\u308b\u305f\u3081\uff09PG-Strom\u306f\u72ec\u81ea\u306bconfigure\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8d70\u3089\u305b\u305f\u308a\u306f\u305b\u305a\u3001 pg_config \u3092\u4f7f\u3063\u3066PostgreSQL\u306e\u30d3\u30eb\u30c9\u6642\u8a2d\u5b9a\u3092\u53c2\u7167\u3057\u307e\u3059\u3002 pg_config \u306b\u30d1\u30b9\u304c\u901a\u3063\u3066\u304a\u308a\u3001\u305d\u308c\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u306ePostgreSQL\u306e\u3082\u306e\u3067\u3042\u308c\u3070\u3001\u305d\u306e\u307e\u307e make \u3001 make install \u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 \u76f4\u63a5\u30d1\u30b9\u304c\u901a\u3063\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001 make \u30b3\u30de\u30f3\u30c9\u306b PG_CONFIG=... \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4e0e\u3048\u3001 pg_config \u306e\u30d5\u30eb\u30d1\u30b9\u3092\u6e21\u3057\u307e\u3059\u3002 $ cd pg-strom/src $ make PG_CONFIG=/usr/pgsql-16/bin/pg_config $ sudo make install PG_CONFIG=/usr/pgsql-16/bin/pg_config \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306e\u8a2d\u5b9a \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u306e\u4f5c\u6210 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u306e\u4f5c\u6210\u304c\u6e08\u3093\u3067\u3044\u306a\u3044\u5834\u5408\u306f\u3001 initdb \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066PostgreSQL\u306e\u521d\u671f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 RPM\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u304a\u3051\u308b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u306e\u30d1\u30b9\u306f /var/lib/pgsql//data \u3067\u3059\u3002 postgresql-alternatives \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001PostgreSQL\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u62e0\u3089\u305a /var/lib/pgdata \u3067\u53c2\u7167\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 # su - postgres $ /usr/pgsql-16/bin/initdb -D /var/lib/pgdata/ The files belonging to this database system will be owned by user \"postgres\". This user must also own the server process. The database cluster will be initialized with locale \"en_US.UTF-8\". The default database encoding has accordingly been set to \"UTF8\". The default text search configuration will be set to \"english\". Data page checksums are disabled. fixing permissions on existing directory /var/lib/pgdata ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Tokyo creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling \"trust\" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D /var/lib/pgdata/ -l logfile start postgresql.conf\u306e\u7de8\u96c6 \u7d9a\u3044\u3066\u3001PostgreSQL\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308b postgresql.conf \u3092\u7de8\u96c6\u3057\u307e\u3059\u3002 PG-Strom\u3092\u52d5\u4f5c\u3055\u305b\u308b\u305f\u3081\u306b\u306f\u3001\u6700\u4f4e\u9650\u3001\u4ee5\u4e0b\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002 \u3053\u308c\u4ee5\u5916\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3064\u3044\u3066\u3082\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u7528\u9014\u3084\u60f3\u5b9a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u8e0f\u307e\u3048\u3066\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 shared_preload_libraries PG-Strom\u30e2\u30b8\u30e5\u30fc\u30eb\u306f shared_preload_libraries \u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308apostmaster\u30d7\u30ed\u30bb\u30b9\u306e\u8d77\u52d5\u6642\u306b\u30ed\u30fc\u30c9\u3055\u308c\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30aa\u30f3\u30c7\u30de\u30f3\u30c9\u3067\u306e\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30ed\u30fc\u30c9\u306f\u30b5\u30dd\u30fc\u30c8\u5bfe\u8c61\u5916\u3067\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u9805\u76ee\u306f\u5fc5\u9808\u3067\u3059\u3002 shared_preload_libraries = '$libdir/pg_strom' max_worker_processes PG-Strom\u306f\u6570\u500b\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u3092\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3067\u3042\u308b 8 \u3067\u306f\u3001\u305d\u308c\u4ee5\u5916\u306e\u51e6\u7406\u306b\u5229\u7528\u3067\u304d\u308b\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u6570\u304c\u3042\u307e\u308a\u306b\u3082\u5c11\u306a\u3059\u304e\u3066\u3057\u307e\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u305f\u5024\u3092\u8a2d\u5b9a\u3059\u3079\u304d\u3067\u3059\u3002 max_worker_processes = 100 shared_buffers \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u3088\u308a\u307e\u3059\u304c\u3001 shared_buffers \u306e\u521d\u671f\u8a2d\u5b9a\u306f\u975e\u5e38\u306b\u5c0f\u3055\u3044\u305f\u3081\u3001PG-Strom\u304c\u6709\u52b9\u306b\u6a5f\u80fd\u3059\u308b\u6c34\u6e96\u306e\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u306b\u5bfe\u3057\u3066\u306f\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3078\u306e\u8aad\u307f\u66f8\u304d\u304c\u5f8b\u901f\u8981\u56e0\u3068\u306a\u3063\u3066\u3057\u307e\u3044\u3001GPU\u306e\u4e26\u5217\u8a08\u7b97\u6a5f\u80fd\u3092\u6709\u52b9\u306b\u5229\u7528\u3067\u304d\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u305f\u5024\u3092\u8a2d\u5b9a\u3059\u3079\u304d\u3067\u3059\u3002 shared_buffers = 10GB \u660e\u3089\u304b\u306b\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u3088\u308a\u3082\u5927\u304d\u306a\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306f\u3001SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306e\u5229\u7528\u3092\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 work_mem \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u3088\u308a\u307e\u3059\u304c\u3001 work_mem \u306e\u521d\u671f\u8a2d\u5b9a\u306f\u975e\u5e38\u306b\u5c0f\u3055\u3044\u305f\u3081\u3001\u89e3\u6790\u7cfb\u30af\u30a8\u30ea\u3067\u6700\u9069\u306a\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u304c\u9078\u629e\u3055\u308c\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u5178\u578b\u7684\u306a\u4f8b\u306f\u3001\u30bd\u30fc\u30c8\u51e6\u7406\u306b\u30aa\u30f3\u30e1\u30e2\u30ea\u306e\u30af\u30a4\u30c3\u30af\u30bd\u30fc\u30c8\u3067\u306f\u306a\u304f\u3001\u30c7\u30a3\u30b9\u30af\u30d9\u30fc\u30b9\u306e\u30de\u30fc\u30b8\u30bd\u30fc\u30c8\u3092\u9078\u629e\u3059\u308b\u3068\u3044\u3063\u305f\u3082\u306e\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u305f\u5024\u3092\u8a2d\u5b9a\u3059\u3079\u304d\u3067\u3059\u3002 work_mem = 1GB OS\u306e\u30ea\u30bd\u30fc\u30b9\u5236\u9650\u306e\u62e1\u5f35 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u7279\u306b\u3001\u540c\u6642\u306b\u5927\u91cf\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30aa\u30fc\u30d7\u30f3\u3059\u308b\u4e8b\u304c\u3042\u308b\u305f\u3081\u3001\u30d7\u30ed\u30bb\u30b9\u3042\u305f\u308a\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30b9\u30af\u30ea\u30d7\u30bf\u6570\u306e\u4e0a\u9650\u3092\u62e1\u5927\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u307e\u305f\u3001PostgreSQL\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u6642\u306b\u78ba\u5b9f\u306b\u30b3\u30a2\u30c0\u30f3\u30d7\u3092\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u3001\u30b3\u30a2\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u4e0a\u9650\u3092\u5236\u9650\u3057\u306a\u3044\u3053\u3068\u3092\u63a8\u5968\u3057\u307e\u3059\u3002 PostgreSQL\u3092systemd\u7d4c\u7531\u3067\u8d77\u52d5\u3059\u308b\u5834\u5408\u3001\u30ea\u30bd\u30fc\u30b9\u5236\u9650\u306b\u95a2\u3059\u308b\u8a2d\u5b9a\u306f /etc/systemd/system/postgresql-XX.service.d/pg_strom.conf \u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002 RPM\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u5834\u5408\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4ee5\u4e0b\u306e\u5185\u5bb9\u304c\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002 \u74b0\u5883\u5909\u6570 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u306b\u95a2\u3059\u308b\u8a2d\u5b9a\u304c\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u958b\u767a\u8005\u5411\u3051\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3001\u3053\u308c\u3092\u6709\u52b9\u306b\u3057\u3066\u8d77\u52d5\u3059\u308b\u3068\u3001GPU\u5074\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306bGPU\u306e\u30b3\u30a2\u30c0\u30f3\u30d7\u3092\u751f\u6210\u3055\u305b\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u8a73\u3057\u304f\u306f CUDA-GDB:GPU core dump support \u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1 PostgreSQL\u306e\u8d77\u52d5 PostgreSQL\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002 \u6b63\u5e38\u306b\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u304c\u5b8c\u4e86\u3057\u3066\u3044\u308c\u3070\u3001\u30ed\u30b0\u306bPG-Strom\u304cGPU\u3092\u8a8d\u8b58\u3057\u305f\u4e8b\u3092\u793a\u3059\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8a18\u9332\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001NVIDIA A100 (PCIE\u7248; 40GB) \u3092\u8a8d\u8b58\u3057\u3066\u304a\u308a\u3001\u307e\u305f\u3001NVME-SSD\u3054\u3068\u306b\u8fd1\u508d\u306eGPU\u304c\u3069\u3061\u3089\u3067\u3042\u308b\u306e\u304b\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002 # systemctl start postgresql-16 # journalctl -u postgresql-16 Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB Extra module loaded [api_version=20240418,cufile=off,nvme_strom=off,githash=3ffc65428c07bb3c9d0e5c75a2973389f91dfcd4] Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2024-06-02\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: PG-Strom version 5.12.el9 built for PostgreSQL 16 (githash: ) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom binary built for CUDA 12.4 (CUDA runtime 12.5) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] WARNING: The CUDA version where this PG-Strom module binary was built for (12.4) is newer than the CUDA runtime version on this platform (12.5). It may lead unexpected behavior, and upgrade of CUDA toolkit is recommended. Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78979c134606) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:81:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:82:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c2:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c6:00:0] nvme4 (Corsair MP600 CORE) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c3:00:0] nvme5 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c1:00:0] nvme0 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c4:00:0] nvme2 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] LOG: redirecting log output to logging collector process Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] HINT: Future log output will appear in directory \"log\". Jun 02 17:28:48 buri.heterodb.com systemd[1]: Started PostgreSQL 16 database server. PG-Strom\u30a8\u30af\u30b9\u30c6\u30f3\u30b7\u30e7\u30f3\u306e\u4f5c\u6210 \u6700\u5f8c\u306b\u3001PG-Strom\u306b\u95a2\u9023\u3059\u308bSQL\u95a2\u6570\u306a\u3069\u306eDB\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u3053\u306e\u624b\u9806\u306fPostgreSQL\u306eEXTENSION\u6a5f\u80fd\u3092\u7528\u3044\u3066\u30d1\u30c3\u30b1\u30fc\u30b8\u5316\u3055\u308c\u3066\u304a\u308a\u3001SQL\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067 CREATE EXTENSION \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u3059\u3002 \u306a\u304a\u3001\u3053\u306e\u624b\u9806\u306f\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u305f\u3073\u306b\u5fc5\u8981\u306b\u306a\u308b\u4e8b\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u305f\u6642\u70b9\u3067\u65e2\u306bPG-Strom\u95a2\u9023\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u3066\u307b\u3057\u3044\u5834\u5408\u306f\u3001\u4e88\u3081 template1 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067PG-Strom\u30a8\u30af\u30b9\u30c6\u30f3\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3066\u304a\u3051\u3070\u3001 CREATE DATABASE \u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u6642\u306b\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u8a2d\u5b9a\u304c\u30b3\u30d4\u30fc\u3055\u308c\u307e\u3059\u3002 $ psql -U postgres psql (16.3) Type \"help\" for help. postgres=# CREATE EXTENSION pg_strom ; CREATE EXTENSION \u4ee5\u4e0a\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4f5c\u696d\u306f\u5b8c\u4e86\u3067\u3059\u3002 PostGIS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PG-Strom\u306f\u4e00\u90e8\u306ePostGIS\u95a2\u6570\u306eGPU\u51e6\u7406\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002 \u672c\u7bc0\u3067\u306fPostGIS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306b\u3064\u3044\u3066\u8aac\u660e\u3092\u884c\u3044\u307e\u3059\u304c\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u8aad\u307f\u98db\u3070\u3057\u3066\u304f\u3060\u3055\u3044\u3002 PostgreSQL\u3068\u540c\u69d8\u306b\u3001PostgreSQL Global Development Group\u306eyum\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089PostGIS\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001PostgreSQL v16\u5411\u3051\u306b\u30d3\u30eb\u30c9\u3055\u308c\u305fPostGIS v3.4\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3082\u306e\u3067\u3059\u3002 # dnf install postgis34_16 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u3092\u4f5c\u6210\u3057\u3066PostgreSQL\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3057\u3001SQL\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089 CREATE EXTENSION \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066Geometry\u30c7\u30fc\u30bf\u578b\u3084\u5730\u7406\u60c5\u5831\u5206\u6790\u306e\u305f\u3081\u306eSQL\u95a2\u6570\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u3053\u308c\u3067PostGIS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5b8c\u4e86\u3067\u3059\u3002 postgres=# CREATE EXTENSION postgis; CREATE EXTENSION","title":"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#_1","text":"\u672c\u7ae0\u3067\u306fPG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#_2","text":"\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30aa\u30da\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u3092\u52d5\u4f5c\u53ef\u80fd\u306a x86_64 \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306e\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u304c\u5fc5\u8981\u3067\u3059\u3002 CPU\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3001\u304a\u3088\u3073\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30c7\u30d0\u30a4\u30b9\u306b\u306f\u7279\u5225\u306a\u8981\u4ef6\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001 note002:HW Validation List \u306f\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9078\u5b9a\u306e\u4e0a\u3067\u53c2\u8003\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3092\u5229\u7528\u3059\u308b\u306b\u306fNVME\u898f\u683c\u306b\u5bfe\u5fdc\u3057\u305fSSD\u3001\u307e\u305f\u306fRoCE\u306b\u5bfe\u5fdc\u3057\u305f\u9ad8\u901fNIC\u304c\u5fc5\u8981\u3067\u3001GPU\u3068\u540c\u4e00\u306ePCIe Root Complex\u914d\u4e0b\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9 PG-Strom\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u5c11\u306a\u304f\u3068\u3082\u4e00\u500b\u306eGPU\u30c7\u30d0\u30a4\u30b9\u304c\u30b7\u30b9\u30c6\u30e0\u4e0a\u306b\u5fc5\u8981\u3067\u3059\u3002\u3053\u308c\u3089\u306fCUDA Toolkit\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u304a\u308a\u3001computing capability \u304c6.0\u4ee5\u964d\u306e\u30e2\u30c7\u30eb\uff08Pascal\u4e16\u4ee3\u4ee5\u964d\uff09\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 002: HW Validation List - List of supported GPU models \u3092\u53c2\u8003\u306bGPU\u3092\u9078\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Operating System PG-Strom\u306e\u5b9f\u884c\u306b\u306f\u3001CUDA Toolkit\u306b\u3088\u308a\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308bx86_64\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u5411\u3051\u306eLinux OS\u304c\u5fc5\u8981\u3067\u3059\u3002\u63a8\u5968\u74b0\u5883\u306fRed Hat Enterprise Linux\u307e\u305f\u306fRocky Linux\u30d0\u30fc\u30b8\u30e7\u30f3 8.x\u3067\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\uff08cuFile\u30c9\u30e9\u30a4\u30d0\uff09\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u3001CUDA Toolkit\u306b\u542b\u307e\u308c\u308bnvidia-fs\u30c9\u30e9\u30a4\u30d0\u3068\u3001Mellanox OFED (OpenFabrics Enterprise Distribution) \u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002 PostgreSQL PG-Strom v5.0\u306e\u5b9f\u884c\u306b\u306fPostgreSQL\u30d0\u30fc\u30b8\u30e7\u30f315\u4ee5\u964d\u304c\u5fc5\u8981\u3067\u3059\u3002 PG-Strom\u304c\u5185\u90e8\u7684\u306b\u5229\u7528\u3057\u3066\u3044\u308bAPI\u306e\u4e2d\u306b\u306f\u3001\u3053\u308c\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u63d0\u4f9b\u3055\u308c\u3066\u3044\u306a\u3044\u3082\u306e\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002 CUDA Toolkit PG-Strom\u306e\u5b9f\u884c\u306b\u306fCUDA Toolkit \u30d0\u30fc\u30b8\u30e7\u30f312.2update2\u4ee5\u964d\u304c\u5fc5\u8981\u3067\u3059\u3002 PG-Strom\u304c\u5185\u90e8\u7684\u306b\u5229\u7528\u3057\u3066\u3044\u308bAPI\u306e\u4e2d\u306b\u306f\u3001\u3053\u308c\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u63d0\u4f9b\u3055\u308c\u3066\u3044\u306a\u3044\u3082\u306e\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002","title":"\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8"},{"location":"install/#_3","text":"\u4e00\u9023\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3068\u306a\u308a\u307e\u3059\u3002 H/W\u306e\u521d\u671f\u8a2d\u5b9a OS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb MOFED\u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb CUDA Toolkit \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb HeteroDB\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PostgreSQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PostgreSQL\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u5fc5\u8981\u306b\u5fdc\u3058\u3066\uff09 PostGIS contrib/cube","title":"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806"},{"location":"install/#os","text":"CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3092\u9078\u629e\u3057\u3001\u500b\u3005\u306e\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d7\u30ed\u30bb\u30b9\u306b\u5f93\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4f5c\u696d\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306f\u3001 NVIDIA DEVELOPER ZONE \u306b\u304a\u3044\u3066\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002 Red Hat Enterprise Linux 8.x\u7cfb\u5217\uff08Rocky Linux 8.x\u7cfb\u5217\u3092\u542b\u3080\uff09\u306e\u5834\u5408\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u69cb\u6210\u306f\u3001\u30d9\u30fc\u30b9\u74b0\u5883\u3068\u3057\u3066\u300c\u6700\u5c0f\u9650\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3001\u3055\u3089\u306b\u8ffd\u52a0\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u3057\u3066\u300c\u958b\u767a\u30c4\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Red Hat Enterprise Linux 9.x\u7cfb\u5217\uff08Rocky Linux 9.x\u7cfb\u5217\u3092\u542b\u3080\uff09\u306e\u5834\u5408\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u69cb\u6210\u306f\u3001\u30d9\u30fc\u30b9\u74b0\u5883\u3068\u3057\u3066\u300c\u6700\u5c0f\u9650\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3001\u3055\u3089\u306b\u8ffd\u52a0\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u3057\u3066\u300c\u6a19\u6e96\u300d\u300c\u958b\u767a\u30c4\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30b5\u30fc\u30d0\u30fc\u3078\u306eOS\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u3001\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u30fc\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u306b\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002 \u306a\u304a\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u3067\u300c\u958b\u767a\u30c4\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067OS\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306b\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 # dnf groupinstall 'Development Tools' Tip \u30b5\u30fc\u30d0\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308bGPU\u304c\u65b0\u3057\u3059\u304e\u308b\u5834\u5408\u3001OS\u8d77\u52d5\u4e2d\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u7b49\u306e\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u5834\u5408\u3001\u30ab\u30fc\u30cd\u30eb\u8d77\u52d5\u30aa\u30d7\u30b7\u30e7\u30f3\u306b nouveau.modeset=0 \u3092\u8ffd\u52a0\u3057\u3066\u6a19\u6e96\u306e\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u30c9\u30e9\u30a4\u30d0\u3092\u7121\u52b9\u5316\u3059\u308b\u4e8b\u3067 \u554f\u984c\u3092\u56de\u907f\u3067\u304d\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002","title":"OS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#nouveau","text":"NVIDIA\u88fdGPU\u5411\u3051\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u4e92\u63db\u30c9\u30e9\u30a4\u30d0\u3067\u3042\u308bnouveau\u30c9\u30e9\u30a4\u30d0\u304c\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001nvidia\u30c9\u30e9\u30a4\u30d0\u3092\u30ed\u30fc\u30c9\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002 \u3053\u306e\u5834\u5408\u306f\u3001nouveau\u30c9\u30e9\u30a4\u30d0\u306e\u7121\u52b9\u5316\u8a2d\u5b9a\u3092\u884c\u3063\u305f\u4e0a\u3067\u30b7\u30b9\u30c6\u30e0\u3092\u4e00\u5ea6\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 nouveau\u30c9\u30e9\u30a4\u30d0\u3092\u7121\u52b9\u5316\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092 /etc/modprobe.d/disable-nouveau.conf \u3068\u3044\u3046\u540d\u524d\u3067\u4fdd\u5b58\u3057\u3001 dracut \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066Linux kernel\u306e\u30d6\u30fc\u30c8\u30a4\u30e1\u30fc\u30b8\u306b\u53cd\u6620\u3057\u307e\u3059\u3002 \u305d\u306e\u5f8c\u3001\u30b7\u30b9\u30c6\u30e0\u3092\u4e00\u5ea6\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 # cat > /etc/modprobe.d/disable-nouveau.conf </kernel/drivers/nvme/host/nvme-rdma.ko.xz \uff09\u3067\u306f\u306a\u304f\u3001\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f /lib/modules//extra/mlnx-nvme/host/nvme-rdma.ko \u304c\u512a\u5148\u3057\u3066\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002 $ modinfo nvme-rdma filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/mlnx-nvme/host/nvme-rdma.ko license: GPL v2 rhelversion: 9.4 srcversion: 16C0049F26768D6EA12771B depends: nvme-core,rdma_cm,ib_core,nvme-fabrics,mlx_compat retpoline: Y name: nvme_rdma vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions parm: register_always:Use memory registration even for contiguous memory regions (bool) \u65e2\u306b\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\uff08\u4f8b: nvme \uff09\u3092\u7f6e\u304d\u63db\u3048\u308b\u305f\u3081\u3001\u3053\u3053\u3067\u4e00\u5ea6\u30b7\u30b9\u30c6\u30e0\u306e\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3068\u518d\u8d77\u52d5\u3092\u884c\u3044\u307e\u3059\u3002 mlnxofedinstall \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b8c\u4e86\u5f8c\u306b\u3001 dracut -f \u3092\u5b9f\u884c\u3059\u308b\u306e\u3092\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002 Tips Linux kernel\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3068MOFED\u30c9\u30e9\u30a4\u30d0 RHEL\u7cfb\u5217\u306e\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306b\u304a\u3044\u3066\u3001MODED\u30c9\u30e9\u30a4\u30d0\u306fDKMS(Dynamic Kernel Module Support)\u3092\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002 \u305d\u306e\u305f\u3081\u3001Linux kernel\u3092\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3057\u305f\u5834\u5408\u306b\u306f\u3001\u4e0a\u8a18\u306e\u624b\u9806\u3092\u518d\u5ea6\u5b9f\u884c\u3057\u3001\u65b0\u3057\u3044Linux kernel\u306b\u5bfe\u5fdc\u3057\u305fMOFED\u30c9\u30e9\u30a4\u30d0\u3092\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u5f8c\u8ff0\u306eCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u66f4\u65b0\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067Linux kernel\u304c\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3055\u308c\u308b\u4e8b\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u305d\u306e\u5834\u5408\u3067\u3082\u540c\u69d8\u3067\u3059\u3002","title":"MOFED\u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#heterodb-swdc","text":"PG-Strom\u307b\u304b\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8\u306f HeteroDB Software Distribution Center \u304b\u3089\u914d\u5e03\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u5165\u624b\u3059\u308b\u305f\u3081\u306b\u3001HeteroDB-SWDC\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u3092yum\u30b7\u30b9\u30c6\u30e0\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 HeteroDB-SWDC\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u5b9a\u7fa9\u306fheterodb-swdc\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3088\u308a\u63d0\u4f9b\u3055\u308c\u307e\u3059\u3002 Web\u30d6\u30e9\u30a6\u30b6\u306a\u3069\u3067 HeteroDB Software Distribution Center \u3078\u30a2\u30af\u30bb\u30b9\u3057\u3001\u30da\u30fc\u30b8\u306e\u5148\u982d\u306b\u30ea\u30f3\u30af\u306e\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b heterodb-swdc-1.3-1.el9.noarch.rpm \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08RHEL8\u306e\u5834\u5408\u306f heterodb-swdc-1.3-1.el8.noarch.rpm \uff09 heterodb-swdc\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u3068\u3001HeteroDB-SWDC\u304b\u3089\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u5165\u624b\u3059\u308b\u305f\u3081\u306eyum\u30b7\u30b9\u30c6\u30e0\u3078\u306e\u8a2d\u5b9a\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306bheterodb-swdc\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 # dnf install https://heterodb.github.io/swdc/yum/rhel8-noarch/heterodb-swdc-1.2-1.el8.noarch.rpm","title":"heterodb-swdc\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#cuda-toolkit","text":"\u672c\u7bc0\u3067\u306fCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u65e2\u306b\u6700\u65b0\u306eCUDA Toolkit\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3067\u3042\u308b\u5834\u5408\u3001\u672c\u7bc0\u306e\u521d\u671f\u8a2d\u5b9a\u3068\u5408\u81f4\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 NVIDIA\u306fCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\uff12\u901a\u308a\u306e\u65b9\u6cd5\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002\u4e00\u3064\u306f\u81ea\u5df1\u5b9f\u884c\u578b\u30a2\u30fc\u30ab\u30a4\u30d6\uff08runfile\uff09\u306b\u3088\u308b\u3082\u306e\u3002\u3082\u3046\u4e00\u3064\u306fRPM\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3088\u308b\u3082\u306e\u3067\u3001PG-Strom\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u306fRPM\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u63a8\u5968\u3057\u307e\u3059\u3002 CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u7528\u30d1\u30c3\u30b1\u30fc\u30b8\u306fNVIDIA DEVELOPER ZONE\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u9069\u5207\u306aOS\u3001\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3001\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3001\u300erpm(network)\u300f\u7248\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u300erpm(network)\u300f\u3092\u9078\u629e\u3059\u308b\u3068\u3001\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u767b\u9332\u3057\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7d4c\u7531\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u306e\u30b7\u30a7\u30eb\u30b3\u30de\u30f3\u30c9\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u30ac\u30a4\u30c0\u30f3\u30b9\u901a\u308a\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u9032\u3081\u3066\u304f\u3060\u3055\u3044\u3002 # dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo # dnf clean all # dnf install cuda-toolkit-12-5 CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u7d9a\u3044\u3066\u3001\u30c9\u30e9\u30a4\u30d0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u305f\u3081\u306e\u30b3\u30de\u30f3\u30c9\u304c\uff12\u7a2e\u985e\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u3053\u3067\u306f \u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248\u306envidia-driver \u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248\u306e\u307f\u304cGPUDirect Storage\u6a5f\u80fd\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u304a\u308a\u3001PG-Strom\u306eGPU-Direct SQL\u306f\u672c\u6a5f\u80fd\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002 Tips Volta\u4ee5\u524d\u306eGPU\u306e\u5229\u7528\u306b\u3064\u3044\u3066 \u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248nvidia\u30c9\u30e9\u30a4\u30d0\u306f\u3001Volta\u4e16\u4ee3\u4ee5\u524d\u306eGPU\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002 \u3057\u305f\u304c\u3063\u3066\u3001Volta\u307e\u305f\u306fPascal\u4e16\u4ee3\u306eGPU\u3067PG-Strom\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u30d7\u30ed\u30d7\u30e9\u30a8\u30bf\u30ea\u7248\u306e\u30c9\u30e9\u30a4\u30d0\u304cGPUDirect Storage\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308bCUDA 12.2\u3092\u5229\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 CUDA 12.2\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306f \u3053\u3061\u3089 \u304b\u3089\u5165\u624b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u7d9a\u3044\u3066\u3001GPU-Direct Storage(GDS)\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306e\u30c9\u30e9\u30a4\u30d0\u30e2\u30b8\u30e5\u30fc\u30eb nvidia-gds \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u306b\u7d9a\u3044\u3066CUDA Toolkit\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u540c\u4e00\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u540d\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 # dnf module install nvidia-driver:open-dkms # dnf install nvidia-gds-12-5 \u6b63\u5e38\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001 /usr/local/cuda \u914d\u4e0b\u306bCUDA Toolkit\u304c\u5c0e\u5165\u3055\u308c\u3066\u3044\u307e\u3059\u3002 $ ls /usr/local/cuda/ bin/ gds/ nsightee_plugins/ targets/ compute-sanitizer/ include@ nvml/ tools/ CUDA_Toolkit_Release_Notes.txt lib64@ nvvm/ version.json DOCS libnvvp/ README EULA.txt LICENSE share/ extras/ man/ src/ \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001GPU\u304c\u6b63\u3057\u304f\u8a8d\u8b58\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 nvidia-smi \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u51fa\u529b\u4f8b\u306e\u3088\u3046\u306b\u3001\u30b7\u30b9\u30c6\u30e0\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308bGPU\u306e\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 $ nvidia-smi Mon Jun 3 09:56:41 2024 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 555.42.02 Driver Version: 555.42.02 CUDA Version: 12.5 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA A100-PCIE-40GB Off | 00000000:41:00.0 Off | 0 | | N/A 58C P0 66W / 250W | 1MiB / 40960MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+","title":"CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#gpudirect-storage","text":"\u4e0a\u8a18\u306e\u624b\u9806\u3067CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001GPUDirect Storage\u304c\u5229\u7528\u53ef\u80fd\u306a\u72b6\u614b\u3068\u306a\u3063\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u901a\u308a\u3001 gdscheck \u30c4\u30fc\u30eb\u3092\u7528\u3044\u3066\u30b9\u30c8\u30ec\u30fc\u30b8\u30c7\u30d0\u30a4\u30b9\u6bce\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \uff08\u3053\u306e\u4f8b\u3067\u306f\u3001 nvme \u3060\u3051\u3067\u306a\u304f\u3001 nvme-rdma \u3084 rpcrdma \u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\u3082\u30ed\u30fc\u30c9\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u95a2\u9023\u3059\u308b\u6a5f\u80fd\u304c Supported \u3068\u306a\u3063\u3066\u3044\u307e\u3059\uff09 # /usr/local/cuda/gds/tools/gdscheck -p GDS release version: 1.10.0.4 nvidia_fs version: 2.20 libcufile version: 2.12 Platform: x86_64 ============ ENVIRONMENT: ============ ===================== DRIVER CONFIGURATION: ===================== NVMe : Supported NVMeOF : Supported SCSI : Unsupported ScaleFlux CSD : Unsupported NVMesh : Unsupported DDN EXAScaler : Unsupported IBM Spectrum Scale : Unsupported NFS : Supported BeeGFS : Unsupported WekaFS : Unsupported Userspace RDMA : Unsupported --Mellanox PeerDirect : Disabled --rdma library : Not Loaded (libcufile_rdma.so) --rdma devices : Not configured --rdma_device_status : Up: 0 Down: 0 ===================== CUFILE CONFIGURATION: ===================== properties.use_compat_mode : true properties.force_compat_mode : false properties.gds_rdma_write_support : true properties.use_poll_mode : false properties.poll_mode_max_size_kb : 4 properties.max_batch_io_size : 128 properties.max_batch_io_timeout_msecs : 5 properties.max_direct_io_size_kb : 16384 properties.max_device_cache_size_kb : 131072 properties.max_device_pinned_mem_size_kb : 33554432 properties.posix_pool_slab_size_kb : 4 1024 16384 properties.posix_pool_slab_count : 128 64 32 properties.rdma_peer_affinity_policy : RoundRobin properties.rdma_dynamic_routing : 0 fs.generic.posix_unaligned_writes : false fs.lustre.posix_gds_min_kb: 0 fs.beegfs.posix_gds_min_kb: 0 fs.weka.rdma_write_support: false fs.gpfs.gds_write_support: false profile.nvtx : false profile.cufile_stats : 0 miscellaneous.api_check_aggressive : false execution.max_io_threads : 4 execution.max_io_queue_depth : 128 execution.parallel_io : true execution.min_io_threshold_size_kb : 8192 execution.max_request_parallelism : 4 properties.force_odirect_mode : false properties.prefer_iouring : false ========= GPU INFO: ========= GPU index 0 NVIDIA A100-PCIE-40GB bar:1 bar size (MiB):65536 supports GDS, IOMMU State: Disabled ============== PLATFORM INFO: ============== IOMMU: disabled Nvidia Driver Info Status: Supported(Nvidia Open Driver Installed) Cuda Driver Version Installed: 12050 Platform: AS -2014CS-TR, Arch: x86_64(Linux 5.14.0-427.18.1.el9_4.x86_64) Platform verification succeeded Tips RAID\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306e\u8ffd\u52a0\u8a2d\u5b9a GPUDirect Storage\u3092\u5229\u7528\u3057\u3066Software RAID (md-raid0) \u533a\u753b\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3059\u5834\u5408\u3001 \u4ee5\u4e0b\u306e\u4e00\u884c\u3092 /lib/udev/rules.d/63-md-raid-arrays.rules \u8a2d\u5b9a\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 IMPORT{\u200bprogram}=\"/usr/sbin/mdadm --detail --export $devnode\" \u305d\u306e\u5f8c\u3001\u8a2d\u5b9a\u3092\u53cd\u6620\u3055\u305b\u308b\u305f\u3081\u306b\u30b7\u30b9\u30c6\u30e0\u3092\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u8a73\u3057\u304f\u306f NVIDIA GPUDirect Storage Installation and Troubleshooting Guide \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"GPUDirect Storage\u306e\u78ba\u8a8d"},{"location":"install/#pci-bar1","text":"GPU-Direct SQL\u306f\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u3092\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u4e0a\u306ePCI BAR1\u9818\u57df\uff08\u7269\u7406\u30a2\u30c9\u30ec\u30b9\u7a7a\u9593\uff09\u306b\u30de\u30c3\u30d7\u3057\u3001\u305d\u3053\u3092Destination\u3068\u3059\u308bP2P-RDMA\u8981\u6c42\u3092NVME\u6a5f\u5668\u306b\u5bfe\u3057\u3066\u884c\u3046\u4e8b\u3067\u3001\u30ed\u30b9\u306e\u306a\u3044\u9ad8\u901f\u306a\u30c7\u30fc\u30bf\u8aad\u51fa\u3057\u3092\u5b9f\u73fe\u3057\u307e\u3059\u3002 \u5341\u5206\u306a\u591a\u91cd\u5ea6\u3092\u6301\u3063\u305fP2P-RDMA\u3092\u884c\u3046\u306b\u306f\u3001GPU\u304c\u30d0\u30c3\u30d5\u30a1\u3092\u30de\u30c3\u30d7\u3059\u308b\u306e\u306b\u5341\u5206\u306aPCI BAR1\u9818\u57df\u3092\u6709\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u5927\u534a\u306eGPU\u3067\u306fPCI BAR1\u9818\u57df\u306e\u5927\u304d\u3055\u306f\u56fa\u5b9a\u3067\u3001PG-Strom\u306b\u304a\u3044\u3066\u306f\u3001\u305d\u308c\u304cGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30b5\u30a4\u30ba\u3092\u4e0a\u56de\u3063\u3066\u3044\u308b\u88fd\u54c1\u3092\u63a8\u5968\u3057\u3066\u3044\u307e\u3059\u3002 \u3057\u304b\u3057\u3001\u4e00\u90e8\u306eGPU\u88fd\u54c1\u306b\u304a\u3044\u3066\u306f\u300e\u52d5\u4f5c\u30e2\u30fc\u30c9\u300f\u3092\u5207\u308a\u66ff\u3048\u308b\u4e8b\u3067PCI BAR1\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3092\u5207\u308a\u66ff\u3048\u308b\u4e8b\u304c\u3067\u304d\u308b\u3082\u306e\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u304a\u4f7f\u3044\u306eGPU\u304c\u305d\u308c\u306b\u8a72\u5f53\u3059\u308b\u5834\u5408\u306f\u3001 NVIDIA Display Mode Selector Tool \u3092\u53c2\u7167\u306e\u4e0a\u3001PCI BAR1\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3092\u6700\u5927\u5316\u3059\u308b\u30e2\u30fc\u30c9\u3078\u3068\u5207\u308a\u66ff\u3048\u3066\u304f\u3060\u3055\u3044\u3002 2023\u5e7412\u6708\u6642\u70b9\u3067\u306f\u3001\u4ee5\u4e0b\u306eGPU\u306e\u5834\u5408\u306bNVIDIA Display Mode Selector Tool\u3092\u5229\u7528\u3057\u3066 *Display Off \u30e2\u30fc\u30c9\u3078\u3068\u5207\u308a\u66ff\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 NVIDIA L40S NVIDIA L40 NVIDIA A40 NVIDIA RTX 6000 Ada NVIDIA RTX A6000 NVIDIA RTX A5500 NVIDIA RTX A5000 \u30b7\u30b9\u30c6\u30e0\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308bGPU\u306e\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u3084PCI BAR1\u30b5\u30a4\u30ba\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f\u3001 nvidia-smi -q \u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u30e1\u30e2\u30ea\u95a2\u9023\u306e\u72b6\u614b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 $ nvidia-smi -q : FB Memory Usage Total : 46068 MiB Reserved : 685 MiB Used : 4 MiB Free : 45377 MiB BAR1 Memory Usage Total : 65536 MiB Used : 1 MiB Free : 65535 MiB :","title":"PCI Bar1\u30e1\u30e2\u30ea\u306e\u8a2d\u5b9a"},{"location":"install/#heterodb","text":"heterodb-extra \u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001PG-Strom\u306b\u4ee5\u4e0b\u306e\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002 \u30de\u30eb\u30c1GPU\u306e\u5bfe\u5fdc GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5bfe\u5fdc \u30e9\u30a4\u30bb\u30f3\u30b9\u7ba1\u7406\u6a5f\u80fd \u3053\u308c\u3089\u306e\u6a5f\u80fd\u3092\u4f7f\u7528\u305b\u305a\u3001\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248\u306e\u6a5f\u80fd\u306e\u307f\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f heterodb-extra \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u4e0d\u8981\u3067\u3059\u3002 \u672c\u7bc0\u306e\u5185\u5bb9\u306f\u8aad\u307f\u98db\u3070\u3057\u3066\u69cb\u3044\u307e\u305b\u3093\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001SWDC\u304b\u3089 heterodb-extra \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002 # dnf install heterodb-extra","title":"HeteroDB \u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb"},{"location":"install/#_5","text":"heterodb-extra \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5168\u3066\u306e\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u3001HeteroDB\u793e\u304c\u63d0\u4f9b\u3059\u308b\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u6709\u52b9\u5316\u304c\u5fc5\u8981\u3067\u3059\u3002\u30e9\u30a4\u30bb\u30f3\u30b9\u306a\u3057\u3067\u904b\u7528\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001\u305d\u306e\u5834\u5408\u3001\u4e0b\u8a18\u306e\u6a5f\u80fd\u304c\u5236\u9650\u3092\u53d7\u3051\u307e\u3059\u3002 \u30de\u30eb\u30c1GPU\u306e\u5229\u7528 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306b\u304a\u3051\u308b\u8907\u6570NVME-SSD\u306b\u3088\u308b\u30b9\u30c8\u30e9\u30a4\u30d4\u30f3\u30b0(md-raid0) GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306b\u304a\u3051\u308bNVME-oF\u30c7\u30d0\u30a4\u30b9\u306e\u5229\u7528 GPU\u7248PostGIS\u306b\u304a\u3051\u308bGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u5229\u7528 \u30e9\u30a4\u30bb\u30f3\u30b9\u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5f62\u5f0f\u3067HeteroDB\u793e\u304b\u3089\u5165\u624b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 IAgIVdKxhe+BSer3Y67jQW0+uTzYh00K6WOSH7xQ26Qcw8aeUNYqJB9YcKJTJb+QQhjmUeQpUnboNxVwLCd3HFuLXeBWMKp11/BgG0FSrkUWu/ZCtDtw0F1hEIUY7m767zAGV8y+i7BuNXGJFvRlAkxdVO3/K47ocIgoVkuzBfLvN/h9LffOydUnHPzrFHfLc0r3nNNgtyTrfvoZiXegkGM9GBTAKyq8uWu/OGonh9ybzVKOgofhDLk0rVbLohOXDhMlwDl2oMGIr83tIpCWG+BGE+TDwsJ4n71Sv6n4bi/ZBXBS498qShNHDGrbz6cNcDVBa+EuZc6HzZoF6UrljEcl= ---- VERSION:2 SERIAL_NR:HDB-TRIAL ISSUED_AT:2019-05-09 EXPIRED_AT:2019-06-08 GPU_UUID:GPU-a137b1df-53c9-197f-2801-f2dccaf9d42f \u3053\u308c\u3092 /etc/heterodb.license \u306b\u30b3\u30d4\u30fc\u3057\u3001PostgreSQL\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306bPostgreSQL\u306e\u8d77\u52d5\u30ed\u30b0\u306b\u30e9\u30a4\u30bb\u30f3\u30b9\u60c5\u5831\u304c\u51fa\u529b\u3055\u308c\u3001\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u6709\u52b9\u5316\u304c\u884c\u308f\u308c\u305f\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 : LOG: HeteroDB Extra module loaded [api_version=20231105,cufile=on,nvme_strom=off,githash=9ca2fe4d2fbb795ad2d741dcfcb9f2fe499a5bdf] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2022-11-19\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} LOG: PG-Strom version 5.0.1 built for PostgreSQL 15 (githash: 972441dbafed6679af86af40bc8613be2d73c4fd) :","title":"\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u6709\u52b9\u5316"},{"location":"install/#postgresql","text":"\u672c\u7bc0\u3067\u306fRPM\u306b\u3088\u308bPostgreSQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u30bd\u30fc\u30b9\u304b\u3089\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u95a2\u3057\u3066\u306f\u65e2\u306b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u6570\u591a\u304f\u5b58\u5728\u3057\u3001 ./configure \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u591a\u5c90\u306b\u308f\u305f\u308b\u4e8b\u304b\u3089\u3001\u3053\u3053\u3067\u306f\u7d39\u4ecb\u3057\u307e\u305b\u3093\u3002 Linux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u914d\u5e03\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3082PostgreSQL\u306f\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u5fc5\u305a\u3057\u3082\u6700\u65b0\u3067\u306f\u306a\u304f\u3001PG-Strom\u306e\u5bfe\u5fdc\u30d0\u30fc\u30b8\u30e7\u30f3\u3088\u308a\u3082\u53e4\u3044\u3082\u306e\u3067\u3042\u308b\u4e8b\u304c\u591a\u3005\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001Red Hat Enterprise Linux 7.x\u3067\u914d\u5e03\u3055\u308c\u3066\u3044\u308bPostgreSQL\u306fv9.2.x\u3067\u3059\u304c\u3001\u3053\u308c\u306fPostgreSQL\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3068\u3057\u3066\u65e2\u306bEOL\u3068\u306a\u3063\u3066\u3044\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3059\u3002 PostgreSQL Global Development Group\u306f\u3001\u6700\u65b0\u306ePostgreSQL\u304a\u3088\u3073\u95a2\u9023\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u914d\u5e03\u306e\u305f\u3081\u306byum\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002 EPEL\u306e\u8a2d\u5b9a\u306e\u3088\u3046\u306b\u3001yum\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u3060\u3051\u306e\u5c0f\u3055\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u305d\u306e\u5f8c\u3001PostgreSQL\u3084\u305d\u306e\u4ed6\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 yum\u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u306e\u4e00\u89a7\u306f http://yum.postgresql.org/repopackages.php \u3067\u3059\u3002 PostgreSQL\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u3068Linux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3054\u3068\u306b\u591a\u304f\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3042\u306a\u305f\u306eLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u5411\u3051\u306ePostgreSQL 15\u4ee5\u964d\u306e\u3082\u306e\u3092\u9078\u629e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30b9\u30c6\u30c3\u30d7\u3067 PostgreSQL \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3044\u307e\u3059\u3002 yum\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u5b9a\u7fa9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb OS\u6a19\u6e96\u306ePostgreSQL\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u7121\u52b9\u5316 PostgreSQL\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u4f8b\u3048\u3070PostgreSQL v16\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001PG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u306f postgresql16-server \u304a\u3088\u3073 postgresql16-devel \u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4ee5\u4e0b\u306f\u3001RHEL9\u306b\u304a\u3044\u3066PostgreSQL v16\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u624b\u9806\u306e\u4f8b\u3067\u3059\u3002 # dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm # dnf -y module disable postgresql # dnf install -y postgresql16-devel postgresql16-server Note Red Hat Enterprise Linux\u306e\u5834\u5408\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u540d postgresql \u304c\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u6a19\u6e96\u306e\u3082\u306e\u3068\u7af6\u5408\u3057\u3066\u3057\u307e\u3044\u3001PGDG\u63d0\u4f9b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001 dnf -y module disable postgresql \u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u3066\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u6a19\u6e96\u306e postgresql \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u7121\u52b9\u5316\u3057\u307e\u3059\u3002","title":"PostgreSQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#pg-strom","text":"\u672c\u7bc0\u3067\u306fPG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u63a8\u5968\u306fRPM\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u3059\u304c\u3001\u958b\u767a\u8005\u5411\u3051\u306b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u306e\u30d3\u30eb\u30c9\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3082\u7d39\u4ecb\u3057\u307e\u3059\u3002","title":"PG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#rpm","text":"PG-Strom\u304a\u3088\u3073\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8\u306f HeteroDB Software Distribution Center \u3088\u308a\u914d\u5e03\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u65e2\u306byum\u30b7\u30b9\u30c6\u30e0\u3078\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u6e08\u307f\u3067\u3042\u308c\u3070\u3001\u305d\u308c\u307b\u3069\u4f5c\u696d\u306f\u591a\u304f\u3042\u308a\u307e\u305b\u3093\u3002 \u57fa\u76e4\u3068\u306a\u308bPostgreSQL\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3054\u3068\u306b\u5225\u500b\u306ePG-Strom\u306eRPM\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u6e96\u5099\u3055\u308c\u3066\u304a\u308a\u3001PostgreSQL v15\u7528\u3067\u3042\u308c\u3070 pg_strom-PG15 \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u3001PostgreSQL v16\u7528\u3067\u3042\u308c\u3070 pg_strom-PG16 \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u3001PostgreSQL\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30d0\u30a4\u30ca\u30ea\u4e92\u63db\u6027\u306b\u4f34\u3046\u5236\u7d04\u3067\u3059\u3002 # dnf install -y pg_strom-PG16 \u4ee5\u4e0a\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5b8c\u4e86\u3067\u3059\u3002","title":"RPM\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#_6","text":"\u958b\u767a\u8005\u5411\u3051\u306b\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089PG-Strom\u3092\u30d3\u30eb\u30c9\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3082\u7d39\u4ecb\u3057\u307e\u3059\u3002","title":"\u30bd\u30fc\u30b9\u304b\u3089\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#_7","text":"RPM\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u540c\u69d8\u306b\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306etarball\u3092 HeteroDB Software Distribution Center \u304b\u3089\u5165\u624b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u305f\u3060\u3001tarball\u306e\u30ea\u30ea\u30fc\u30b9\u306b\u306f\u3042\u308b\u7a0b\u5ea6\u306e\u30bf\u30a4\u30e0\u30e9\u30b0\u304c\u751f\u3058\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u6700\u65b0\u306e\u958b\u767a\u7248\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306b\u306f PG-Strom\u306eGitHub\u30ea\u30dd\u30b8\u30c8\u30ea \u306e master \u30d6\u30e9\u30f3\u30c1\u3092\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3059\u308b\u65b9\u6cd5\u306e\u65b9\u304c\u597d\u307e\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 $ git clone https://github.com/heterodb/pg-strom.git Cloning into 'pg-strom'... remote: Counting objects: 13797, done. remote: Compressing objects: 100% (215/215), done. remote: Total 13797 (delta 208), reused 339 (delta 167), pack-reused 13400 Receiving objects: 100% (13797/13797), 11.81 MiB | 1.76 MiB/s, done. Resolving deltas: 100% (10504/10504), done.","title":"\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u5165\u624b"},{"location":"install/#pg-strom_1","text":"PG-Strom\u3092\u30d3\u30eb\u30c9\u3059\u308b\u6642\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u306f\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u306ePostgreSQL\u3068\u53b3\u5bc6\u306b\u4e00\u81f4\u3057\u3066\u3044\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070\u3001\u540c\u3058\u69cb\u9020\u4f53\u304c\u30d3\u30eb\u30c9\u6642\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u306b\u3088\u308aPostgreSQL\u3068PG-Strom\u3067\u7570\u306a\u3063\u305f\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u6301\u3063\u3066\u3057\u307e\u3063\u305f\u3068\u3059\u308c\u3070\u3001\u975e\u5e38\u306b\u767a\u898b\u306e\u96e3\u3057\u3044\u30d0\u30b0\u3092\u751f\u307f\u51fa\u3057\u3066\u3057\u307e\u3046\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 \u3057\u305f\u304c\u3063\u3066\u3001\uff08\u4e00\u8cab\u6027\u306e\u306a\u3044\u72b6\u614b\u3092\u907f\u3051\u308b\u305f\u3081\uff09PG-Strom\u306f\u72ec\u81ea\u306bconfigure\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8d70\u3089\u305b\u305f\u308a\u306f\u305b\u305a\u3001 pg_config \u3092\u4f7f\u3063\u3066PostgreSQL\u306e\u30d3\u30eb\u30c9\u6642\u8a2d\u5b9a\u3092\u53c2\u7167\u3057\u307e\u3059\u3002 pg_config \u306b\u30d1\u30b9\u304c\u901a\u3063\u3066\u304a\u308a\u3001\u305d\u308c\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u306ePostgreSQL\u306e\u3082\u306e\u3067\u3042\u308c\u3070\u3001\u305d\u306e\u307e\u307e make \u3001 make install \u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 \u76f4\u63a5\u30d1\u30b9\u304c\u901a\u3063\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001 make \u30b3\u30de\u30f3\u30c9\u306b PG_CONFIG=... \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4e0e\u3048\u3001 pg_config \u306e\u30d5\u30eb\u30d1\u30b9\u3092\u6e21\u3057\u307e\u3059\u3002 $ cd pg-strom/src $ make PG_CONFIG=/usr/pgsql-16/bin/pg_config $ sudo make install PG_CONFIG=/usr/pgsql-16/bin/pg_config","title":"PG-Strom\u306e\u30d3\u30eb\u30c9"},{"location":"install/#_8","text":"","title":"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306e\u8a2d\u5b9a"},{"location":"install/#_9","text":"\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u306e\u4f5c\u6210\u304c\u6e08\u3093\u3067\u3044\u306a\u3044\u5834\u5408\u306f\u3001 initdb \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066PostgreSQL\u306e\u521d\u671f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 RPM\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u304a\u3051\u308b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u306e\u30d1\u30b9\u306f /var/lib/pgsql//data \u3067\u3059\u3002 postgresql-alternatives \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001PostgreSQL\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u62e0\u3089\u305a /var/lib/pgdata \u3067\u53c2\u7167\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 # su - postgres $ /usr/pgsql-16/bin/initdb -D /var/lib/pgdata/ The files belonging to this database system will be owned by user \"postgres\". This user must also own the server process. The database cluster will be initialized with locale \"en_US.UTF-8\". The default database encoding has accordingly been set to \"UTF8\". The default text search configuration will be set to \"english\". Data page checksums are disabled. fixing permissions on existing directory /var/lib/pgdata ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Tokyo creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling \"trust\" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D /var/lib/pgdata/ -l logfile start","title":"\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u306e\u4f5c\u6210"},{"location":"install/#postgresqlconf","text":"\u7d9a\u3044\u3066\u3001PostgreSQL\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308b postgresql.conf \u3092\u7de8\u96c6\u3057\u307e\u3059\u3002 PG-Strom\u3092\u52d5\u4f5c\u3055\u305b\u308b\u305f\u3081\u306b\u306f\u3001\u6700\u4f4e\u9650\u3001\u4ee5\u4e0b\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002 \u3053\u308c\u4ee5\u5916\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3064\u3044\u3066\u3082\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u7528\u9014\u3084\u60f3\u5b9a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u8e0f\u307e\u3048\u3066\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 shared_preload_libraries PG-Strom\u30e2\u30b8\u30e5\u30fc\u30eb\u306f shared_preload_libraries \u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308apostmaster\u30d7\u30ed\u30bb\u30b9\u306e\u8d77\u52d5\u6642\u306b\u30ed\u30fc\u30c9\u3055\u308c\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30aa\u30f3\u30c7\u30de\u30f3\u30c9\u3067\u306e\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30ed\u30fc\u30c9\u306f\u30b5\u30dd\u30fc\u30c8\u5bfe\u8c61\u5916\u3067\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u9805\u76ee\u306f\u5fc5\u9808\u3067\u3059\u3002 shared_preload_libraries = '$libdir/pg_strom' max_worker_processes PG-Strom\u306f\u6570\u500b\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u3092\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3067\u3042\u308b 8 \u3067\u306f\u3001\u305d\u308c\u4ee5\u5916\u306e\u51e6\u7406\u306b\u5229\u7528\u3067\u304d\u308b\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u6570\u304c\u3042\u307e\u308a\u306b\u3082\u5c11\u306a\u3059\u304e\u3066\u3057\u307e\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u305f\u5024\u3092\u8a2d\u5b9a\u3059\u3079\u304d\u3067\u3059\u3002 max_worker_processes = 100 shared_buffers \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u3088\u308a\u307e\u3059\u304c\u3001 shared_buffers \u306e\u521d\u671f\u8a2d\u5b9a\u306f\u975e\u5e38\u306b\u5c0f\u3055\u3044\u305f\u3081\u3001PG-Strom\u304c\u6709\u52b9\u306b\u6a5f\u80fd\u3059\u308b\u6c34\u6e96\u306e\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u306b\u5bfe\u3057\u3066\u306f\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3078\u306e\u8aad\u307f\u66f8\u304d\u304c\u5f8b\u901f\u8981\u56e0\u3068\u306a\u3063\u3066\u3057\u307e\u3044\u3001GPU\u306e\u4e26\u5217\u8a08\u7b97\u6a5f\u80fd\u3092\u6709\u52b9\u306b\u5229\u7528\u3067\u304d\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u305f\u5024\u3092\u8a2d\u5b9a\u3059\u3079\u304d\u3067\u3059\u3002 shared_buffers = 10GB \u660e\u3089\u304b\u306b\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u3088\u308a\u3082\u5927\u304d\u306a\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306f\u3001SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306e\u5229\u7528\u3092\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 work_mem \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u3088\u308a\u307e\u3059\u304c\u3001 work_mem \u306e\u521d\u671f\u8a2d\u5b9a\u306f\u975e\u5e38\u306b\u5c0f\u3055\u3044\u305f\u3081\u3001\u89e3\u6790\u7cfb\u30af\u30a8\u30ea\u3067\u6700\u9069\u306a\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u304c\u9078\u629e\u3055\u308c\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u5178\u578b\u7684\u306a\u4f8b\u306f\u3001\u30bd\u30fc\u30c8\u51e6\u7406\u306b\u30aa\u30f3\u30e1\u30e2\u30ea\u306e\u30af\u30a4\u30c3\u30af\u30bd\u30fc\u30c8\u3067\u306f\u306a\u304f\u3001\u30c7\u30a3\u30b9\u30af\u30d9\u30fc\u30b9\u306e\u30de\u30fc\u30b8\u30bd\u30fc\u30c8\u3092\u9078\u629e\u3059\u308b\u3068\u3044\u3063\u305f\u3082\u306e\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u305f\u5024\u3092\u8a2d\u5b9a\u3059\u3079\u304d\u3067\u3059\u3002 work_mem = 1GB","title":"postgresql.conf\u306e\u7de8\u96c6"},{"location":"install/#os_1","text":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u7279\u306b\u3001\u540c\u6642\u306b\u5927\u91cf\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30aa\u30fc\u30d7\u30f3\u3059\u308b\u4e8b\u304c\u3042\u308b\u305f\u3081\u3001\u30d7\u30ed\u30bb\u30b9\u3042\u305f\u308a\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30b9\u30af\u30ea\u30d7\u30bf\u6570\u306e\u4e0a\u9650\u3092\u62e1\u5927\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u307e\u305f\u3001PostgreSQL\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u6642\u306b\u78ba\u5b9f\u306b\u30b3\u30a2\u30c0\u30f3\u30d7\u3092\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u3001\u30b3\u30a2\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u4e0a\u9650\u3092\u5236\u9650\u3057\u306a\u3044\u3053\u3068\u3092\u63a8\u5968\u3057\u307e\u3059\u3002 PostgreSQL\u3092systemd\u7d4c\u7531\u3067\u8d77\u52d5\u3059\u308b\u5834\u5408\u3001\u30ea\u30bd\u30fc\u30b9\u5236\u9650\u306b\u95a2\u3059\u308b\u8a2d\u5b9a\u306f /etc/systemd/system/postgresql-XX.service.d/pg_strom.conf \u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002 RPM\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u5834\u5408\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4ee5\u4e0b\u306e\u5185\u5bb9\u304c\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002 \u74b0\u5883\u5909\u6570 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u306b\u95a2\u3059\u308b\u8a2d\u5b9a\u304c\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u958b\u767a\u8005\u5411\u3051\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3001\u3053\u308c\u3092\u6709\u52b9\u306b\u3057\u3066\u8d77\u52d5\u3059\u308b\u3068\u3001GPU\u5074\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306bGPU\u306e\u30b3\u30a2\u30c0\u30f3\u30d7\u3092\u751f\u6210\u3055\u305b\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u8a73\u3057\u304f\u306f CUDA-GDB:GPU core dump support \u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1","title":"OS\u306e\u30ea\u30bd\u30fc\u30b9\u5236\u9650\u306e\u62e1\u5f35"},{"location":"install/#postgresql_1","text":"PostgreSQL\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002 \u6b63\u5e38\u306b\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u304c\u5b8c\u4e86\u3057\u3066\u3044\u308c\u3070\u3001\u30ed\u30b0\u306bPG-Strom\u304cGPU\u3092\u8a8d\u8b58\u3057\u305f\u4e8b\u3092\u793a\u3059\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8a18\u9332\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001NVIDIA A100 (PCIE\u7248; 40GB) \u3092\u8a8d\u8b58\u3057\u3066\u304a\u308a\u3001\u307e\u305f\u3001NVME-SSD\u3054\u3068\u306b\u8fd1\u508d\u306eGPU\u304c\u3069\u3061\u3089\u3067\u3042\u308b\u306e\u304b\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002 # systemctl start postgresql-16 # journalctl -u postgresql-16 Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB Extra module loaded [api_version=20240418,cufile=off,nvme_strom=off,githash=3ffc65428c07bb3c9d0e5c75a2973389f91dfcd4] Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2024-06-02\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: PG-Strom version 5.12.el9 built for PostgreSQL 16 (githash: ) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom binary built for CUDA 12.4 (CUDA runtime 12.5) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] WARNING: The CUDA version where this PG-Strom module binary was built for (12.4) is newer than the CUDA runtime version on this platform (12.5). It may lead unexpected behavior, and upgrade of CUDA toolkit is recommended. Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78979c134606) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:81:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:82:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c2:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c6:00:0] nvme4 (Corsair MP600 CORE) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c3:00:0] nvme5 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c1:00:0] nvme0 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c4:00:0] nvme2 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] LOG: redirecting log output to logging collector process Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] HINT: Future log output will appear in directory \"log\". Jun 02 17:28:48 buri.heterodb.com systemd[1]: Started PostgreSQL 16 database server.","title":"PostgreSQL\u306e\u8d77\u52d5"},{"location":"install/#pg-strom_2","text":"\u6700\u5f8c\u306b\u3001PG-Strom\u306b\u95a2\u9023\u3059\u308bSQL\u95a2\u6570\u306a\u3069\u306eDB\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u3053\u306e\u624b\u9806\u306fPostgreSQL\u306eEXTENSION\u6a5f\u80fd\u3092\u7528\u3044\u3066\u30d1\u30c3\u30b1\u30fc\u30b8\u5316\u3055\u308c\u3066\u304a\u308a\u3001SQL\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067 CREATE EXTENSION \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u3059\u3002 \u306a\u304a\u3001\u3053\u306e\u624b\u9806\u306f\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u305f\u3073\u306b\u5fc5\u8981\u306b\u306a\u308b\u4e8b\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u305f\u6642\u70b9\u3067\u65e2\u306bPG-Strom\u95a2\u9023\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u3066\u307b\u3057\u3044\u5834\u5408\u306f\u3001\u4e88\u3081 template1 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067PG-Strom\u30a8\u30af\u30b9\u30c6\u30f3\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3066\u304a\u3051\u3070\u3001 CREATE DATABASE \u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u6642\u306b\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u8a2d\u5b9a\u304c\u30b3\u30d4\u30fc\u3055\u308c\u307e\u3059\u3002 $ psql -U postgres psql (16.3) Type \"help\" for help. postgres=# CREATE EXTENSION pg_strom ; CREATE EXTENSION \u4ee5\u4e0a\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4f5c\u696d\u306f\u5b8c\u4e86\u3067\u3059\u3002","title":"PG-Strom\u30a8\u30af\u30b9\u30c6\u30f3\u30b7\u30e7\u30f3\u306e\u4f5c\u6210"},{"location":"install/#postgis","text":"PG-Strom\u306f\u4e00\u90e8\u306ePostGIS\u95a2\u6570\u306eGPU\u51e6\u7406\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002 \u672c\u7bc0\u3067\u306fPostGIS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306b\u3064\u3044\u3066\u8aac\u660e\u3092\u884c\u3044\u307e\u3059\u304c\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u8aad\u307f\u98db\u3070\u3057\u3066\u304f\u3060\u3055\u3044\u3002 PostgreSQL\u3068\u540c\u69d8\u306b\u3001PostgreSQL Global Development Group\u306eyum\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089PostGIS\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001PostgreSQL v16\u5411\u3051\u306b\u30d3\u30eb\u30c9\u3055\u308c\u305fPostGIS v3.4\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3082\u306e\u3067\u3059\u3002 # dnf install postgis34_16 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u3092\u4f5c\u6210\u3057\u3066PostgreSQL\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3057\u3001SQL\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089 CREATE EXTENSION \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066Geometry\u30c7\u30fc\u30bf\u578b\u3084\u5730\u7406\u60c5\u5831\u5206\u6790\u306e\u305f\u3081\u306eSQL\u95a2\u6570\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u3053\u308c\u3067PostGIS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5b8c\u4e86\u3067\u3059\u3002 postgres=# CREATE EXTENSION postgis; CREATE EXTENSION","title":"PostGIS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"operations/","text":"\u57fa\u672c\u7684\u306a\u64cd\u4f5c GPU\u30aa\u30d5\u30ed\u30fc\u30c9\u306e\u78ba\u8a8d \u30af\u30a8\u30ea\u304cGPU\u3067\u5b9f\u884c\u3055\u308c\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f EXPLAIN \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 SQL\u51e6\u7406\u306f\u5185\u90e8\u7684\u306b\u3044\u304f\u3064\u304b\u306e\u8981\u7d20\u306b\u5206\u89e3\u3055\u308c\u51e6\u7406\u3055\u308c\u307e\u3059\u304c\u3001PG-Strom\u304cGPU\u3092\u9069\u7528\u3057\u3066\u4e26\u5217\u51e6\u7406\u3092\u884c\u3046\u306e\u306fSCAN\u3001JOIN\u3001GROUP BY\u306e\u5404\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u3002\u6a19\u6e96\u3067PostgreSQL\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b\u5404\u51e6\u7406\u306e\u4ee3\u308f\u308a\u306b\u3001GpuScan\u3001GpuJoin\u3001GpuPreAgg\u304c\u8868\u793a\u3055\u308c\u305f\u5834\u5408\u3001\u305d\u306e\u30af\u30a8\u30ea\u306fGPU\u306b\u3088\u3063\u3066\u51e6\u7406\u3055\u308c\u308b\u4e8b\u3068\u306a\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306f EXPLAIN \u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u4f8b\u3067\u3059\u3002 postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 NATURAL JOIN t2 GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=989186.82..989190.94 rows=27 width=20) Group Key: t0.cat -> Sort (cost=989186.82..989187.29 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=989175.89..989179.67 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=14744.40..875804.46 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1833360.36 rows=99996736 width=12) Depth 1: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) Depth 2: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.bid JoinQuals: (t0.bid = t2.bid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) -> Seq Scan on t2 (cost=0.00..1935.00 rows=100000 width=4) (21 rows) \u5b9f\u884c\u8a08\u753b\u306e\u4e2d\u306b\u898b\u6163\u308c\u306a\u3044\u51e6\u7406\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u4e8b\u306b\u6c17\u304c\u4ed8\u304b\u308c\u305f\u3067\u3057\u3087\u3046\u3002 CustomScan\u6a5f\u69cb\u3092\u7528\u3044\u3066GpuJoin\u304a\u3088\u3073GpuPreAgg\u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u3067GpuJoin\u306f t0 \u3068 t1 \u3001\u304a\u3088\u3073 t2 \u3068\u306eJOIN\u51e6\u7406\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u53d7\u3051\u53d6\u308bGpuPreAgg\u306f\u5217 cat \u306b\u3088\u308bGROUP BY\u51e6\u7406\u3092GPU\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002 PostgreSQL\u304c\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u3092\u69cb\u7bc9\u3059\u308b\u904e\u7a0b\u3067PG-Strom\u306f\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u4ecb\u5165\u3057\u3001SCAN\u3001JOIN\u3001GROUP BY\u306e\u5404\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPU\u3067\u5b9f\u884c\u53ef\u80fd\u3067\u3042\u308b\u5834\u5408\u3001\u305d\u306e\u30b3\u30b9\u30c8\u3092\u7b97\u51fa\u3057\u3066PostgreSQL\u306e\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u5b9f\u884c\u8a08\u753b\u306e\u5019\u88dc\u3092\u63d0\u793a\u3057\u307e\u3059\u3002 \u63a8\u5b9a\u3055\u308c\u305f\u30b3\u30b9\u30c8\u5024\u304cCPU\u3067\u5b9f\u884c\u3059\u308b\u4ed6\u306e\u5b9f\u884c\u8a08\u753b\u3088\u308a\u3082\u5c0f\u3055\u306a\u5024\u3067\u3042\u308b\u5834\u5408\u3001GPU\u3092\u7528\u3044\u305f\u4ee3\u66ff\u306e\u5b9f\u884c\u8a08\u753b\u304c\u63a1\u7528\u3055\u308c\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPU\u3067\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u5c11\u306a\u304f\u3068\u3082\u6f14\u7b97\u5f0f\u307e\u305f\u306f\u95a2\u6570\u3001\u304a\u3088\u3073\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u578b\u304cPG-Strom\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 int \u3084 float \u3068\u3044\u3063\u305f\u6570\u5024\u578b\u3001 date \u3084 timestamp \u3068\u3044\u3063\u305f\u65e5\u4ed8\u6642\u523b\u578b\u3001 text \u306e\u3088\u3046\u306a\u6587\u5b57\u5217\u578b\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\u307e\u305f\u3001\u56db\u5247\u6f14\u7b97\u3084\u5927\u5c0f\u6bd4\u8f03\u3068\u3044\u3063\u305f\u6570\u591a\u304f\u306e\u30d3\u30eb\u30c8\u30a4\u30f3\u6f14\u7b97\u5b50\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u8a73\u7d30\u306a\u4e00\u89a7\u306b\u95a2\u3057\u3066\u306f \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 CPU+GPU\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u4e26\u5217 PG-Strom\u306fPostgreSQL\u306eCPU\u4e26\u5217\u5b9f\u884c\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 PostgreSQL\u306eCPU\u4e26\u5217\u5b9f\u884c\u306f\u3001Gather\u30ce\u30fc\u30c9\u304c\u3044\u304f\u3064\u304b\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30d7\u30ed\u30bb\u30b9\u3092\u8d77\u52d5\u3057\u3001\u5404\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u304c\"\u90e8\u5206\u7684\u306b\"\u5b9f\u884c\u3057\u305f\u30af\u30a8\u30ea\u306e\u7d50\u679c\u3092\u5f8c\u3067\u7d50\u5408\u3059\u308b\u5f62\u3067\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002 GpuJoin\u3084GpuPreAgg\u3068\u3044\u3063\u305fPG-Strom\u306e\u51e6\u7406\u306f\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u5074\u3067\u306e\u5b9f\u884c\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u500b\u3005\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u4e92\u3044\u306bGPU\u3092\u4f7f\u7528\u3057\u3066\u51e6\u7406\u3092\u9032\u3081\u307e\u3059\u3002\u901a\u5e38\u3001GPU\u3078\u30c7\u30fc\u30bf\u3092\u4f9b\u7d66\u3059\u308b\u305f\u3081\u306b\u500b\u3005\u306eCPU\u30b3\u30a2\u304c\u30d0\u30c3\u30d5\u30a1\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u305f\u3081\u306e\u51e6\u7406\u901f\u5ea6\u306f\u3001GPU\u3067\u306eSQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u51e6\u7406\u901f\u5ea6\u306b\u6bd4\u3079\u3066\u305a\u3063\u3068\u9045\u3044\u305f\u3081\u3001CPU\u4e26\u5217\u3068GPU\u4e26\u5217\u3092\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u3067\u5229\u7528\u3059\u308b\u4e8b\u3067\u51e6\u7406\u901f\u5ea6\u306e\u5411\u4e0a\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 \u305f\u3060\u3057\u3001GPU\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306aCUDA\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306f\u5404\u30d7\u30ed\u30bb\u30b9\u3054\u3068\u306b\u4f5c\u6210\u3055\u308c\u3001CUDA\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3092\u751f\u6210\u3059\u308b\u305f\u3073\u306b\u3042\u308b\u7a0b\u5ea6\u306eGPU\u30ea\u30bd\u30fc\u30b9\u304c\u6d88\u8cbb\u3055\u308c\u308b\u305f\u3081\u3001\u5e38\u306bCPU\u4e26\u5217\u5ea6\u304c\u9ad8\u3051\u308c\u3070\u826f\u3044\u3068\u3044\u3046\u8a33\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002 Gather\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u304c\u5b9f\u884c\u53ef\u80fd\u306a\u3082\u306e\u3067\u3059\u30021\u5104\u884c\u3092\u4fdd\u6301\u3059\u308b t0 \u30c6\u30fc\u30d6\u30eb\u30924\u30d7\u30ed\u30bb\u30b9\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u3068\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u30d7\u30ed\u30bb\u30b9\u3067\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u305f\u3081\u3001\u30d7\u30ed\u30bb\u30b9\u3042\u305f\u308a2000\u4e07\u884c\u3092GpuJoin\u304a\u3088\u3073GpuPreAgg\u3067\u51e6\u7406\u3057\u3001\u305d\u306e\u7d50\u679c\u3092Gather\u30ce\u30fc\u30c9\u3067\u7d50\u5408\u3057\u307e\u3059\u3002 # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 GROUP by cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=955705.47..955720.93 rows=27 width=20) Group Key: t0.cat -> Sort (cost=955705.47..955707.36 rows=756 width=44) Sort Key: t0.cat -> Gather (cost=955589.95..955669.33 rows=756 width=44) Workers Planned: 4 -> Parallel Custom Scan (GpuPreAgg) (cost=954589.95..954593.73 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on t0 (cost=27682.82..841218.52 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1083384.84 rows=24999184 width=8) Depth 1: GpuHashJoin (nrows 24999184...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows) \u4e0b\u4f4d\u30d7\u30e9\u30f3\u306e\u5f15\u304d\u4e0a\u3052 \u203b\u672c\u7bc0\u306e\u5185\u5bb9\u306f\u6709\u52b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u6700\u65b0\u306e\u5b9f\u88c5\u3092\u8e0f\u307e\u3048\u305f\u66f8\u304d\u76f4\u3057\u304c\u5fc5\u8981\u3067\u3059\u3002 PG-Strom\u306fSCAN\u3001JOIN\u3001GROUP BY\u306e\u5404\u51e6\u7406\u3092GPU\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u304c\u3001\u3053\u308c\u306b\u5bfe\u5fdc\u3059\u308bPostgreSQL\u6a19\u6e96\u306e\u51e6\u7406\u3092\u5358\u7d14\u306b\u7f6e\u304d\u63db\u3048\u305f\u3060\u3051\u3067\u306f\u56f0\u3063\u305f\u4e8b\u614b\u304c\u767a\u751f\u3057\u307e\u3059\u3002 SCAN\u304c\u7d42\u308f\u3063\u305f\u5f8c\u306e\u30c7\u30fc\u30bf\u3092\u3044\u3063\u305f\u3093\u30db\u30b9\u30c8\u5074\u306e\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u623b\u3057\u3001\u6b21\u306b\u305d\u308c\u3092JOIN\u3059\u308b\u305f\u3081\u306b\u518d\u3073GPU\u3078\u3068\u30b3\u30d4\u30fc\u3057\u3001\u3055\u3089\u306bGROUP BY\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u518d\u3073\u30db\u30b9\u30c8\u5074\u306e\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u623b\u3057\u30fb\u30fb\u30fb\u3068\u3044\u3063\u305f\u5f62\u3067\u3001CPU\u3068GPU\u306e\u9593\u3067\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u304c\u767a\u751f\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u3059\u3002 \u3053\u308c\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u3001PG-Strom\u306f\u4e0b\u4f4d\u30d7\u30e9\u30f3\u3092\u5f15\u304d\u4e0a\u3052\u3066\u4e00\u5ea6\u306eGPU Kernel\u306e\u5b9f\u884c\u3067\u51e6\u7406\u3057\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u30e2\u30fc\u30c9\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u4e0b\u4f4d\u30d7\u30e9\u30f3\u306e\u5f15\u304d\u4e0a\u3052\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 SCAN + JOIN SCAN + GROUP BY SCAN + JOIN + GROUP BY \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u3001\u4e0b\u4f4d\u30d7\u30e9\u30f3\u306e\u5f15\u304d\u4e0a\u3052\u3092\u5168\u304f\u884c\u308f\u306a\u3044\u30b1\u30fc\u30b9\u3067\u3059\u3002 GpuScan\u306e\u5b9f\u884c\u7d50\u679c\u3092GpuJoin\u304c\u53d7\u53d6\u308a\u3001\u3055\u3089\u306b\u305d\u306e\u5b9f\u884c\u7d50\u679c\u3092GpuPreAgg\u304c\u53d7\u3051\u53d6\u3063\u3066\u6700\u7d42\u7d50\u679c\u3092\u751f\u6210\u3059\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=1239991.03..1239995.15 rows=27 width=20) Group Key: t0.cat -> Sort (cost=1239991.03..1239991.50 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=1239980.10..1239983.88 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) -> Custom Scan (GpuJoin) (cost=50776.43..1199522.96 rows=33332245 width=12) GPU Projection: t0.cat, t1.ax Depth 1: GpuHashJoin (nrows 33332245...33332245) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Custom Scan (GpuScan) on t0 (cost=12634.49..1187710.85 rows=33332245 width=8) GPU Projection: cat, aid GPU Filter: (aid < bid) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows) \u3053\u306e\u5834\u5408\u3001\u5404\u5b9f\u884c\u30b9\u30c6\u30fc\u30b8\u306b\u304a\u3044\u3066GPU\u3068\u30db\u30b9\u30c8\u30d0\u30c3\u30d5\u30a1\u306e\u9593\u3067\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u304c\u767a\u751f\u3059\u308b\u305f\u3081\u3001\u5b9f\u884c\u52b9\u7387\u306f\u3088\u304f\u3042\u308a\u307e\u305b\u3093\u3002 \u4e00\u65b9\u3001\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u3001\u4e0b\u4f4d\u30ce\u30fc\u30c9\u306e\u5f15\u304d\u4e0a\u3052\u3092\u884c\u3063\u305f\u3082\u306e\u3067\u3059\u3002 # EXPLAIN ANALYZE SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=903669.50..903673.62 rows=27 width=20) (actual time=7761.630..7761.644 rows=27 loops=1) Group Key: t0.cat -> Sort (cost=903669.50..903669.97 rows=189 width=44) (actual time=7761.621..7761.626 rows=27 loops=1) Sort Key: t0.cat Sort Method: quicksort Memory: 28kB -> Custom Scan (GpuPreAgg) (cost=903658.57..903662.35 rows=189 width=44) (actual time=7761.531..7761.540 rows=27 loops=1) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=12483.41..863201.43 rows=33332245 width=12) (never executed) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=12634.49..1187710.85 rows=33332245 width=8) (actual time=59.623..5557.052 rows=100000000 loops=1) Outer Scan Filter: (aid < bid) Rows Removed by Outer Scan Filter: 50002874 Depth 1: GpuHashJoin (plan nrows: 33332245...33332245, actual nrows: 49997126...49997126) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size plan: 10.39MB, exec: 64.00MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (actual time=0.013..15.303 rows=100000 loops=1) Planning time: 0.506 ms Execution time: 8495.391 ms (21 rows) \u307e\u305a\u3001\u30c6\u30fc\u30d6\u30eb t0 \u3078\u306e\u30b9\u30ad\u30e3\u30f3\u304cGpuJoin\u306e\u5b9f\u884c\u8a08\u753b\u306b\u57cb\u3081\u8fbc\u307e\u308c\u3001GpuScan\u304c\u6d88\u3048\u3066\u3044\u308b\u4e8b\u306b\u304a\u6c17\u4ed8\u304d\u3067\u3057\u3087\u3046\u3002 \u3053\u308c\u306fGpuJoin\u304c\u914d\u4e0b\u306eGpuScan\u3092\u5f15\u304d\u4e0a\u3052\u3001\u4e00\u4f53\u5316\u3057\u305fGPU\u30ab\u30fc\u30cd\u30eb\u95a2\u6570\u3067WHERE\u53e5\u306e\u51e6\u7406\u3082\u884c\u3063\u305f\u4e8b\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002 \u52a0\u3048\u3066\u5947\u5999\u306a\u3053\u3068\u306b\u3001 EXPLAIN ANALYZE \u306e\u7d50\u679c\u306b\u306fGpuJoin\u304c(never executed)\u3068\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u306fGpuPreAgg\u304c\u914d\u4e0b\u306eGpuJoin\u3092\u5f15\u304d\u4e0a\u3052\u3001\u4e00\u4f53\u5316\u3057\u305fGPU\u30ab\u30fc\u30cd\u30eb\u95a2\u6570\u3067JOIN\u3068GROUP BY\u3092\u5b9f\u884c\u3057\u305f\u4e8b\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002 SCAN\u51e6\u7406\u306e\u5f15\u304d\u4e0a\u3052\u306f pg_strom.pullup_outer_scan \u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u3063\u3066\u5236\u5fa1\u3067\u304d\u307e\u3059\u3002 \u307e\u305f\u3001JOIN\u51e6\u7406\u306e\u5f15\u304d\u4e0a\u3052\u306f pg_strom.pullup_outer_join \u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u3063\u3066\u5236\u5fa1\u3067\u304d\u307e\u3059\u3002 \u3044\u305a\u308c\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f on \u306b\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001\u901a\u5e38\u306f\u3053\u308c\u3092\u7121\u52b9\u5316\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u30c8\u30e9\u30d6\u30eb\u6642\u306e\u554f\u984c\u5207\u308a\u5206\u3051\u624b\u6bb5\u306e\u4e00\u3064\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 GpuJoin\u306b\u304a\u3051\u308bInner Pinned Buffer \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002 PG-Strom\u304c\u30c6\u30fc\u30d6\u30eb\u3092\u7d50\u5408\u3059\u308b\u969b\u3001\u901a\u5e38\u306f\u6700\u3082\u30b5\u30a4\u30ba\u306e\u5927\u304d\u306a\u30c6\u30fc\u30d6\u30eb\uff08\u3053\u306e\u5834\u5408\u306f lineorder \u3067\u3001OUTER\u8868\u3068\u547c\u3073\u307e\u3059\uff09\u3092\u975e\u540c\u671f\u7684\u306b\u8aad\u307f\u8fbc\u307f\u306a\u304c\u3089\u3001\u4ed6\u306e\u30c6\u30fc\u30d6\u30eb\u3068\u306e\u7d50\u5408\u51e6\u7406\u304a\u3088\u3073\u96c6\u8a08\u51e6\u7406\u3092\u9032\u3081\u307e\u3059\u3002 JOIN\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5236\u7d04\u4e0a\u3001\u4e88\u3081\u305d\u308c\u4ee5\u5916\u306e\u30c6\u30fc\u30d6\u30eb\uff08\u3053\u306e\u5834\u5408\u306f date1 \u3001 part \u3001 supplier \u3067\u3001INNER\u8868\u3068\u547c\u3073\u307e\u3059\uff09\u3092\u30e1\u30e2\u30ea\u4e0a\u306b\u8aad\u307f\u51fa\u3057\u3001\u307e\u305fJOIN\u30ad\u30fc\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u8a08\u7b97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30c6\u30fc\u30d6\u30eb\u306fOUTER\u8868\u307b\u3069\u5927\u304d\u306a\u30b5\u30a4\u30ba\u3067\u306f\u306a\u3044\u3082\u306e\u306e\u3001\u6570GB\u3092\u8d8a\u3048\u308b\u3088\u3046\u306aINNER\u30d0\u30c3\u30d5\u30a1\u306e\u6e96\u5099\u306f\u76f8\u5fdc\u306b\u91cd\u3044\u51e6\u7406\u3068\u306a\u308a\u307e\u3059\u3002 GpuJoin\u306f\u901a\u5e38\u3001PostgreSQL\u306eAPI\u3092\u901a\u3057\u3066INNER\u8868\u3092\u4e00\u884c\u3054\u3068\u306b\u8aad\u307f\u51fa\u3057\u3001\u305d\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u8a08\u7b97\u3059\u308b\u3068\u3068\u3082\u306b\u5171\u6709\u30e1\u30e2\u30ea\u4e0a\u306eINNER\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002GPU-Service\u30d7\u30ed\u30bb\u30b9\u306f\u3001\u3053\u306eINNER\u30d0\u30c3\u30d5\u30a1\u3092GPU\u30e1\u30e2\u30ea\u306b\u8ee2\u9001\u3057\u3001\u305d\u3053\u3067\u306f\u3058\u3081\u3066OUTER\u8868\u3092\u8aad\u307f\u51fa\u3057\u3066JOIN\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 INNER\u8868\u304c\u76f8\u5fdc\u306b\u5927\u304d\u304fGPU\u3067\u5b9f\u884c\u53ef\u80fd\u306a\u691c\u7d22\u6761\u4ef6\u3092\u542b\u3080\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306e\u3088\u3046\u306b\u3001GpuJoin\u306e\u914d\u4e0b\u306bGpuScan\u304c\u5b58\u5728\u3059\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308a\u5f97\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001INNER\u8868\u306f\u3044\u3063\u305f\u3093GpuScan\u306b\u3088\u3063\u3066GPU\u3067\u51e6\u7406\u3055\u308c\u305f\u5f8c\u3001\u305d\u306e\u5b9f\u884c\u7d50\u679c\u3092CPU\u5074\u306b\u623b\u3057\u3001\u3055\u3089\u306bINNER\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305f\u5f8c\u3067\u3082\u3046\u4e00\u5ea6GPU\u3078\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002\u305a\u3044\u3076\u3093\u3068\u7121\u99c4\u306a\u30c7\u30fc\u30bf\u306e\u6d41\u308c\u304c\u5b58\u5728\u3059\u308b\u3088\u3046\u306b\u898b\u3048\u307e\u3059\u3002 =# explain select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_brand1 between 'MFGR#2221' and 'MFGR#2228' and s_region = 'ASIA' group by d_year, p_brand1; QUERY PLAN --------------------------------------------------------------------------------------------------------------- GroupAggregate (cost=31007186.70..31023043.21 rows=6482 width=46) Group Key: date1.d_year, part.p_brand1 -> Sort (cost=31007186.70..31011130.57 rows=1577548 width=20) Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuJoin) on lineorder (cost=275086.19..30844784.03 rows=1577548 width=20) GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue GPU Join Quals [1]: (part.p_partkey = lineorder.lo_partkey) ... [nrows: 5994236000 -> 7804495] GPU Outer Hash [1]: lineorder.lo_partkey GPU Inner Hash [1]: part.p_partkey GPU Join Quals [2]: (supplier.s_suppkey = lineorder.lo_suppkey) ... [nrows: 7804495 -> 1577548] GPU Outer Hash [2]: lineorder.lo_suppkey GPU Inner Hash [2]: supplier.s_suppkey GPU Join Quals [3]: (date1.d_datekey = lineorder.lo_orderdate) ... [nrows: 1577548 -> 1577548] GPU Outer Hash [3]: lineorder.lo_orderdate GPU Inner Hash [3]: date1.d_datekey GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on part (cost=0.00..59258.00 rows=2604 width=14) Filter: ((p_brand1 >= 'MFGR#2221'::bpchar) AND (p_brand1 <= 'MFGR#2228'::bpchar)) -> Custom Scan (GpuScan) on supplier (cost=100.00..190348.83 rows=2019384 width=6) GPU Projection: s_suppkey GPU Pinned Buffer: enabled GPU Scan Quals: (s_region = 'ASIA'::bpchar) [rows: 9990357 -> 2019384] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=8) (24 rows) \u3053\u306e\u3088\u3046\u306b\u3001INNER\u8868\u306e\u8aad\u51fa\u3057\u3084INNER\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u306e\u969b\u306bCPU\u3068GPU\u306e\u9593\u3067\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u3001 Pinned Inner Buffer \u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u8a2d\u5b9a\u3059\u308b\u4e8b\u3067\u3001GpuJoin\u306e\u5b9f\u884c\u958b\u59cb\u30ea\u30fc\u30c9\u30bf\u30a4\u30e0\u306e\u77ed\u7e2e\u3084\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u524a\u6e1b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4e0a\u306e\u5b9f\u884c\u8a08\u753b\u3067\u306f\u3001 supplier \u8868\u306e\u8aad\u51fa\u3057\u304cGpuScan\u306b\u3088\u308a\u884c\u308f\u308c\u308b\u4e8b\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u7d71\u8a08\u60c5\u5831\u306b\u3088\u308c\u3070\u7d04200\u4e07\u884c\u304c\u8aad\u307f\u51fa\u3055\u308c\u308b\u3068\u63a8\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u4e00\u65b9\u3067\u3001 GPU Pinned Buffer: enabled \u306e\u51fa\u529b\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u3001INNER\u8868\u306e\u63a8\u5b9a\u30b5\u30a4\u30ba\u304c pg_strom.pinned_inner_buffer_threshold \u306e\u8a2d\u5b9a\u5024\u3092\u8d8a\u3048\u308b\u5834\u5408\u3001GpuScan\u306e\u51e6\u7406\u7d50\u679c\u3092\u305d\u306e\u307e\u307eGPU\u30e1\u30e2\u30ea\u306b\u6b8b\u3057\u3066\u304a\u304d\u3001\u305d\u308c\u3092\u6b21\u306eGpuJoin\u3067INNER\u30d0\u30c3\u30d5\u30a1\u306e\u4e00\u90e8\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u3068\u3044\u3046\u6a5f\u80fd\u3067\u3059\uff08\u5fc5\u8981\u3067\u3042\u308c\u3070\u30cf\u30c3\u30b7\u30e5\u5024\u306e\u8a08\u7b97\u3082GPU\u3067\u884c\u3044\u307e\u3059\uff09\u3002 \u305d\u306e\u305f\u3081\u3001 supplier \u8868\u306e\u5185\u5bb9\u306fGPU-Direct SQL\u306b\u3088\u3063\u3066\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089GPU\u3078\u3068\u8aad\u307f\u51fa\u3055\u308c\u305f\u5f8c\u3001CPU\u5074\u306b\u623b\u3055\u308c\u305f\u308a\u3001\u518d\u5ea6GPU\u3078\u30ed\u30fc\u30c9\u3055\u308c\u305f\u308a\u3059\u308b\u3053\u3068\u306a\u304f\u3001\u6b21\u306eGpuJoin\u3067\u5229\u7528\u3055\u308c\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u4e00\u65b9\u3067Pinned Inner Buffer\u306e\u4f7f\u7528\u306b\u306f\u82e5\u5e72\u306e\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5\u3082\u3042\u308b\u305f\u3081\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u7121\u52b9\u5316\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u672c\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u660e\u793a\u7684\u306b pg_strom.pinned_inner_buffer_threshold \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 Pinned Inner Buffer\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u3001CPU\u5074\u306fINNER\u30d0\u30c3\u30d5\u30a1\u306e\u5185\u5bb9\u3092\u5b8c\u5168\u306b\u306f\u4fdd\u6301\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001TOAST\u5316\u3055\u308c\u305f\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u3092GPU\u3067\u53c2\u7167\u3057\u305f\u5834\u5408\u306a\u3069\u3001CPU Fallback\u51e6\u7406\u3092\u884c\u3046\u4e8b\u304c\u3067\u304d\u305a\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305b\u307e\u3059\u3002\u307e\u305f\u3001CPU Fallback\u3092\u5229\u7528\u3057\u3066\u5b9f\u88c5\u3055\u308c\u3066\u3044\u308bRIGHT/FULL OUTER JOIN\u3082\u540c\u69d8\u306e\u7406\u7531\u3067Pinned Inner Buffer\u3068\u5171\u5b58\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002 \u30ca\u30ec\u30c3\u30b8\u30d9\u30fc\u30b9 PG-Strom\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306ewiki\u30b5\u30a4\u30c8\u306b\u306f\u3001\u30ce\u30fc\u30c8\u3068\u547c\u3070\u308c\u308b\u8a73\u7d30\u306a\u6280\u8853\u60c5\u5831\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002 https://github.com/heterodb/pg-strom/wiki","title":"\u57fa\u672c\u7684\u306a\u64cd\u4f5c"},{"location":"operations/#_1","text":"","title":"\u57fa\u672c\u7684\u306a\u64cd\u4f5c"},{"location":"operations/#gpu","text":"\u30af\u30a8\u30ea\u304cGPU\u3067\u5b9f\u884c\u3055\u308c\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f EXPLAIN \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 SQL\u51e6\u7406\u306f\u5185\u90e8\u7684\u306b\u3044\u304f\u3064\u304b\u306e\u8981\u7d20\u306b\u5206\u89e3\u3055\u308c\u51e6\u7406\u3055\u308c\u307e\u3059\u304c\u3001PG-Strom\u304cGPU\u3092\u9069\u7528\u3057\u3066\u4e26\u5217\u51e6\u7406\u3092\u884c\u3046\u306e\u306fSCAN\u3001JOIN\u3001GROUP BY\u306e\u5404\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u3002\u6a19\u6e96\u3067PostgreSQL\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b\u5404\u51e6\u7406\u306e\u4ee3\u308f\u308a\u306b\u3001GpuScan\u3001GpuJoin\u3001GpuPreAgg\u304c\u8868\u793a\u3055\u308c\u305f\u5834\u5408\u3001\u305d\u306e\u30af\u30a8\u30ea\u306fGPU\u306b\u3088\u3063\u3066\u51e6\u7406\u3055\u308c\u308b\u4e8b\u3068\u306a\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306f EXPLAIN \u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u4f8b\u3067\u3059\u3002 postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 NATURAL JOIN t2 GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=989186.82..989190.94 rows=27 width=20) Group Key: t0.cat -> Sort (cost=989186.82..989187.29 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=989175.89..989179.67 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=14744.40..875804.46 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1833360.36 rows=99996736 width=12) Depth 1: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) Depth 2: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.bid JoinQuals: (t0.bid = t2.bid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) -> Seq Scan on t2 (cost=0.00..1935.00 rows=100000 width=4) (21 rows) \u5b9f\u884c\u8a08\u753b\u306e\u4e2d\u306b\u898b\u6163\u308c\u306a\u3044\u51e6\u7406\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u4e8b\u306b\u6c17\u304c\u4ed8\u304b\u308c\u305f\u3067\u3057\u3087\u3046\u3002 CustomScan\u6a5f\u69cb\u3092\u7528\u3044\u3066GpuJoin\u304a\u3088\u3073GpuPreAgg\u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u3067GpuJoin\u306f t0 \u3068 t1 \u3001\u304a\u3088\u3073 t2 \u3068\u306eJOIN\u51e6\u7406\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u53d7\u3051\u53d6\u308bGpuPreAgg\u306f\u5217 cat \u306b\u3088\u308bGROUP BY\u51e6\u7406\u3092GPU\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002 PostgreSQL\u304c\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u3092\u69cb\u7bc9\u3059\u308b\u904e\u7a0b\u3067PG-Strom\u306f\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u4ecb\u5165\u3057\u3001SCAN\u3001JOIN\u3001GROUP BY\u306e\u5404\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPU\u3067\u5b9f\u884c\u53ef\u80fd\u3067\u3042\u308b\u5834\u5408\u3001\u305d\u306e\u30b3\u30b9\u30c8\u3092\u7b97\u51fa\u3057\u3066PostgreSQL\u306e\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u5b9f\u884c\u8a08\u753b\u306e\u5019\u88dc\u3092\u63d0\u793a\u3057\u307e\u3059\u3002 \u63a8\u5b9a\u3055\u308c\u305f\u30b3\u30b9\u30c8\u5024\u304cCPU\u3067\u5b9f\u884c\u3059\u308b\u4ed6\u306e\u5b9f\u884c\u8a08\u753b\u3088\u308a\u3082\u5c0f\u3055\u306a\u5024\u3067\u3042\u308b\u5834\u5408\u3001GPU\u3092\u7528\u3044\u305f\u4ee3\u66ff\u306e\u5b9f\u884c\u8a08\u753b\u304c\u63a1\u7528\u3055\u308c\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPU\u3067\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u5c11\u306a\u304f\u3068\u3082\u6f14\u7b97\u5f0f\u307e\u305f\u306f\u95a2\u6570\u3001\u304a\u3088\u3073\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u578b\u304cPG-Strom\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 int \u3084 float \u3068\u3044\u3063\u305f\u6570\u5024\u578b\u3001 date \u3084 timestamp \u3068\u3044\u3063\u305f\u65e5\u4ed8\u6642\u523b\u578b\u3001 text \u306e\u3088\u3046\u306a\u6587\u5b57\u5217\u578b\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\u307e\u305f\u3001\u56db\u5247\u6f14\u7b97\u3084\u5927\u5c0f\u6bd4\u8f03\u3068\u3044\u3063\u305f\u6570\u591a\u304f\u306e\u30d3\u30eb\u30c8\u30a4\u30f3\u6f14\u7b97\u5b50\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u8a73\u7d30\u306a\u4e00\u89a7\u306b\u95a2\u3057\u3066\u306f \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"GPU\u30aa\u30d5\u30ed\u30fc\u30c9\u306e\u78ba\u8a8d"},{"location":"operations/#cpugpu","text":"PG-Strom\u306fPostgreSQL\u306eCPU\u4e26\u5217\u5b9f\u884c\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 PostgreSQL\u306eCPU\u4e26\u5217\u5b9f\u884c\u306f\u3001Gather\u30ce\u30fc\u30c9\u304c\u3044\u304f\u3064\u304b\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30d7\u30ed\u30bb\u30b9\u3092\u8d77\u52d5\u3057\u3001\u5404\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u304c\"\u90e8\u5206\u7684\u306b\"\u5b9f\u884c\u3057\u305f\u30af\u30a8\u30ea\u306e\u7d50\u679c\u3092\u5f8c\u3067\u7d50\u5408\u3059\u308b\u5f62\u3067\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002 GpuJoin\u3084GpuPreAgg\u3068\u3044\u3063\u305fPG-Strom\u306e\u51e6\u7406\u306f\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u5074\u3067\u306e\u5b9f\u884c\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u500b\u3005\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u4e92\u3044\u306bGPU\u3092\u4f7f\u7528\u3057\u3066\u51e6\u7406\u3092\u9032\u3081\u307e\u3059\u3002\u901a\u5e38\u3001GPU\u3078\u30c7\u30fc\u30bf\u3092\u4f9b\u7d66\u3059\u308b\u305f\u3081\u306b\u500b\u3005\u306eCPU\u30b3\u30a2\u304c\u30d0\u30c3\u30d5\u30a1\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u305f\u3081\u306e\u51e6\u7406\u901f\u5ea6\u306f\u3001GPU\u3067\u306eSQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u51e6\u7406\u901f\u5ea6\u306b\u6bd4\u3079\u3066\u305a\u3063\u3068\u9045\u3044\u305f\u3081\u3001CPU\u4e26\u5217\u3068GPU\u4e26\u5217\u3092\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u3067\u5229\u7528\u3059\u308b\u4e8b\u3067\u51e6\u7406\u901f\u5ea6\u306e\u5411\u4e0a\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 \u305f\u3060\u3057\u3001GPU\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306aCUDA\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306f\u5404\u30d7\u30ed\u30bb\u30b9\u3054\u3068\u306b\u4f5c\u6210\u3055\u308c\u3001CUDA\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3092\u751f\u6210\u3059\u308b\u305f\u3073\u306b\u3042\u308b\u7a0b\u5ea6\u306eGPU\u30ea\u30bd\u30fc\u30b9\u304c\u6d88\u8cbb\u3055\u308c\u308b\u305f\u3081\u3001\u5e38\u306bCPU\u4e26\u5217\u5ea6\u304c\u9ad8\u3051\u308c\u3070\u826f\u3044\u3068\u3044\u3046\u8a33\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002 Gather\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u304c\u5b9f\u884c\u53ef\u80fd\u306a\u3082\u306e\u3067\u3059\u30021\u5104\u884c\u3092\u4fdd\u6301\u3059\u308b t0 \u30c6\u30fc\u30d6\u30eb\u30924\u30d7\u30ed\u30bb\u30b9\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u3068\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u30d7\u30ed\u30bb\u30b9\u3067\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u305f\u3081\u3001\u30d7\u30ed\u30bb\u30b9\u3042\u305f\u308a2000\u4e07\u884c\u3092GpuJoin\u304a\u3088\u3073GpuPreAgg\u3067\u51e6\u7406\u3057\u3001\u305d\u306e\u7d50\u679c\u3092Gather\u30ce\u30fc\u30c9\u3067\u7d50\u5408\u3057\u307e\u3059\u3002 # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 GROUP by cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=955705.47..955720.93 rows=27 width=20) Group Key: t0.cat -> Sort (cost=955705.47..955707.36 rows=756 width=44) Sort Key: t0.cat -> Gather (cost=955589.95..955669.33 rows=756 width=44) Workers Planned: 4 -> Parallel Custom Scan (GpuPreAgg) (cost=954589.95..954593.73 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on t0 (cost=27682.82..841218.52 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1083384.84 rows=24999184 width=8) Depth 1: GpuHashJoin (nrows 24999184...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows)","title":"CPU+GPU\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u4e26\u5217"},{"location":"operations/#_2","text":"\u203b\u672c\u7bc0\u306e\u5185\u5bb9\u306f\u6709\u52b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u6700\u65b0\u306e\u5b9f\u88c5\u3092\u8e0f\u307e\u3048\u305f\u66f8\u304d\u76f4\u3057\u304c\u5fc5\u8981\u3067\u3059\u3002 PG-Strom\u306fSCAN\u3001JOIN\u3001GROUP BY\u306e\u5404\u51e6\u7406\u3092GPU\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u304c\u3001\u3053\u308c\u306b\u5bfe\u5fdc\u3059\u308bPostgreSQL\u6a19\u6e96\u306e\u51e6\u7406\u3092\u5358\u7d14\u306b\u7f6e\u304d\u63db\u3048\u305f\u3060\u3051\u3067\u306f\u56f0\u3063\u305f\u4e8b\u614b\u304c\u767a\u751f\u3057\u307e\u3059\u3002 SCAN\u304c\u7d42\u308f\u3063\u305f\u5f8c\u306e\u30c7\u30fc\u30bf\u3092\u3044\u3063\u305f\u3093\u30db\u30b9\u30c8\u5074\u306e\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u623b\u3057\u3001\u6b21\u306b\u305d\u308c\u3092JOIN\u3059\u308b\u305f\u3081\u306b\u518d\u3073GPU\u3078\u3068\u30b3\u30d4\u30fc\u3057\u3001\u3055\u3089\u306bGROUP BY\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u518d\u3073\u30db\u30b9\u30c8\u5074\u306e\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u623b\u3057\u30fb\u30fb\u30fb\u3068\u3044\u3063\u305f\u5f62\u3067\u3001CPU\u3068GPU\u306e\u9593\u3067\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u304c\u767a\u751f\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u3059\u3002 \u3053\u308c\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u3001PG-Strom\u306f\u4e0b\u4f4d\u30d7\u30e9\u30f3\u3092\u5f15\u304d\u4e0a\u3052\u3066\u4e00\u5ea6\u306eGPU Kernel\u306e\u5b9f\u884c\u3067\u51e6\u7406\u3057\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u30e2\u30fc\u30c9\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u4e0b\u4f4d\u30d7\u30e9\u30f3\u306e\u5f15\u304d\u4e0a\u3052\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 SCAN + JOIN SCAN + GROUP BY SCAN + JOIN + GROUP BY \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u3001\u4e0b\u4f4d\u30d7\u30e9\u30f3\u306e\u5f15\u304d\u4e0a\u3052\u3092\u5168\u304f\u884c\u308f\u306a\u3044\u30b1\u30fc\u30b9\u3067\u3059\u3002 GpuScan\u306e\u5b9f\u884c\u7d50\u679c\u3092GpuJoin\u304c\u53d7\u53d6\u308a\u3001\u3055\u3089\u306b\u305d\u306e\u5b9f\u884c\u7d50\u679c\u3092GpuPreAgg\u304c\u53d7\u3051\u53d6\u3063\u3066\u6700\u7d42\u7d50\u679c\u3092\u751f\u6210\u3059\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=1239991.03..1239995.15 rows=27 width=20) Group Key: t0.cat -> Sort (cost=1239991.03..1239991.50 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=1239980.10..1239983.88 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) -> Custom Scan (GpuJoin) (cost=50776.43..1199522.96 rows=33332245 width=12) GPU Projection: t0.cat, t1.ax Depth 1: GpuHashJoin (nrows 33332245...33332245) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Custom Scan (GpuScan) on t0 (cost=12634.49..1187710.85 rows=33332245 width=8) GPU Projection: cat, aid GPU Filter: (aid < bid) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows) \u3053\u306e\u5834\u5408\u3001\u5404\u5b9f\u884c\u30b9\u30c6\u30fc\u30b8\u306b\u304a\u3044\u3066GPU\u3068\u30db\u30b9\u30c8\u30d0\u30c3\u30d5\u30a1\u306e\u9593\u3067\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u304c\u767a\u751f\u3059\u308b\u305f\u3081\u3001\u5b9f\u884c\u52b9\u7387\u306f\u3088\u304f\u3042\u308a\u307e\u305b\u3093\u3002 \u4e00\u65b9\u3001\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u3001\u4e0b\u4f4d\u30ce\u30fc\u30c9\u306e\u5f15\u304d\u4e0a\u3052\u3092\u884c\u3063\u305f\u3082\u306e\u3067\u3059\u3002 # EXPLAIN ANALYZE SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=903669.50..903673.62 rows=27 width=20) (actual time=7761.630..7761.644 rows=27 loops=1) Group Key: t0.cat -> Sort (cost=903669.50..903669.97 rows=189 width=44) (actual time=7761.621..7761.626 rows=27 loops=1) Sort Key: t0.cat Sort Method: quicksort Memory: 28kB -> Custom Scan (GpuPreAgg) (cost=903658.57..903662.35 rows=189 width=44) (actual time=7761.531..7761.540 rows=27 loops=1) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=12483.41..863201.43 rows=33332245 width=12) (never executed) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=12634.49..1187710.85 rows=33332245 width=8) (actual time=59.623..5557.052 rows=100000000 loops=1) Outer Scan Filter: (aid < bid) Rows Removed by Outer Scan Filter: 50002874 Depth 1: GpuHashJoin (plan nrows: 33332245...33332245, actual nrows: 49997126...49997126) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size plan: 10.39MB, exec: 64.00MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (actual time=0.013..15.303 rows=100000 loops=1) Planning time: 0.506 ms Execution time: 8495.391 ms (21 rows) \u307e\u305a\u3001\u30c6\u30fc\u30d6\u30eb t0 \u3078\u306e\u30b9\u30ad\u30e3\u30f3\u304cGpuJoin\u306e\u5b9f\u884c\u8a08\u753b\u306b\u57cb\u3081\u8fbc\u307e\u308c\u3001GpuScan\u304c\u6d88\u3048\u3066\u3044\u308b\u4e8b\u306b\u304a\u6c17\u4ed8\u304d\u3067\u3057\u3087\u3046\u3002 \u3053\u308c\u306fGpuJoin\u304c\u914d\u4e0b\u306eGpuScan\u3092\u5f15\u304d\u4e0a\u3052\u3001\u4e00\u4f53\u5316\u3057\u305fGPU\u30ab\u30fc\u30cd\u30eb\u95a2\u6570\u3067WHERE\u53e5\u306e\u51e6\u7406\u3082\u884c\u3063\u305f\u4e8b\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002 \u52a0\u3048\u3066\u5947\u5999\u306a\u3053\u3068\u306b\u3001 EXPLAIN ANALYZE \u306e\u7d50\u679c\u306b\u306fGpuJoin\u304c(never executed)\u3068\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u306fGpuPreAgg\u304c\u914d\u4e0b\u306eGpuJoin\u3092\u5f15\u304d\u4e0a\u3052\u3001\u4e00\u4f53\u5316\u3057\u305fGPU\u30ab\u30fc\u30cd\u30eb\u95a2\u6570\u3067JOIN\u3068GROUP BY\u3092\u5b9f\u884c\u3057\u305f\u4e8b\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002 SCAN\u51e6\u7406\u306e\u5f15\u304d\u4e0a\u3052\u306f pg_strom.pullup_outer_scan \u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u3063\u3066\u5236\u5fa1\u3067\u304d\u307e\u3059\u3002 \u307e\u305f\u3001JOIN\u51e6\u7406\u306e\u5f15\u304d\u4e0a\u3052\u306f pg_strom.pullup_outer_join \u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u3063\u3066\u5236\u5fa1\u3067\u304d\u307e\u3059\u3002 \u3044\u305a\u308c\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f on \u306b\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001\u901a\u5e38\u306f\u3053\u308c\u3092\u7121\u52b9\u5316\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u30c8\u30e9\u30d6\u30eb\u6642\u306e\u554f\u984c\u5207\u308a\u5206\u3051\u624b\u6bb5\u306e\u4e00\u3064\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002","title":"\u4e0b\u4f4d\u30d7\u30e9\u30f3\u306e\u5f15\u304d\u4e0a\u3052"},{"location":"operations/#gpujoininner-pinned-buffer","text":"\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002 PG-Strom\u304c\u30c6\u30fc\u30d6\u30eb\u3092\u7d50\u5408\u3059\u308b\u969b\u3001\u901a\u5e38\u306f\u6700\u3082\u30b5\u30a4\u30ba\u306e\u5927\u304d\u306a\u30c6\u30fc\u30d6\u30eb\uff08\u3053\u306e\u5834\u5408\u306f lineorder \u3067\u3001OUTER\u8868\u3068\u547c\u3073\u307e\u3059\uff09\u3092\u975e\u540c\u671f\u7684\u306b\u8aad\u307f\u8fbc\u307f\u306a\u304c\u3089\u3001\u4ed6\u306e\u30c6\u30fc\u30d6\u30eb\u3068\u306e\u7d50\u5408\u51e6\u7406\u304a\u3088\u3073\u96c6\u8a08\u51e6\u7406\u3092\u9032\u3081\u307e\u3059\u3002 JOIN\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5236\u7d04\u4e0a\u3001\u4e88\u3081\u305d\u308c\u4ee5\u5916\u306e\u30c6\u30fc\u30d6\u30eb\uff08\u3053\u306e\u5834\u5408\u306f date1 \u3001 part \u3001 supplier \u3067\u3001INNER\u8868\u3068\u547c\u3073\u307e\u3059\uff09\u3092\u30e1\u30e2\u30ea\u4e0a\u306b\u8aad\u307f\u51fa\u3057\u3001\u307e\u305fJOIN\u30ad\u30fc\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u8a08\u7b97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30c6\u30fc\u30d6\u30eb\u306fOUTER\u8868\u307b\u3069\u5927\u304d\u306a\u30b5\u30a4\u30ba\u3067\u306f\u306a\u3044\u3082\u306e\u306e\u3001\u6570GB\u3092\u8d8a\u3048\u308b\u3088\u3046\u306aINNER\u30d0\u30c3\u30d5\u30a1\u306e\u6e96\u5099\u306f\u76f8\u5fdc\u306b\u91cd\u3044\u51e6\u7406\u3068\u306a\u308a\u307e\u3059\u3002 GpuJoin\u306f\u901a\u5e38\u3001PostgreSQL\u306eAPI\u3092\u901a\u3057\u3066INNER\u8868\u3092\u4e00\u884c\u3054\u3068\u306b\u8aad\u307f\u51fa\u3057\u3001\u305d\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u8a08\u7b97\u3059\u308b\u3068\u3068\u3082\u306b\u5171\u6709\u30e1\u30e2\u30ea\u4e0a\u306eINNER\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002GPU-Service\u30d7\u30ed\u30bb\u30b9\u306f\u3001\u3053\u306eINNER\u30d0\u30c3\u30d5\u30a1\u3092GPU\u30e1\u30e2\u30ea\u306b\u8ee2\u9001\u3057\u3001\u305d\u3053\u3067\u306f\u3058\u3081\u3066OUTER\u8868\u3092\u8aad\u307f\u51fa\u3057\u3066JOIN\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 INNER\u8868\u304c\u76f8\u5fdc\u306b\u5927\u304d\u304fGPU\u3067\u5b9f\u884c\u53ef\u80fd\u306a\u691c\u7d22\u6761\u4ef6\u3092\u542b\u3080\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306e\u3088\u3046\u306b\u3001GpuJoin\u306e\u914d\u4e0b\u306bGpuScan\u304c\u5b58\u5728\u3059\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308a\u5f97\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001INNER\u8868\u306f\u3044\u3063\u305f\u3093GpuScan\u306b\u3088\u3063\u3066GPU\u3067\u51e6\u7406\u3055\u308c\u305f\u5f8c\u3001\u305d\u306e\u5b9f\u884c\u7d50\u679c\u3092CPU\u5074\u306b\u623b\u3057\u3001\u3055\u3089\u306bINNER\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305f\u5f8c\u3067\u3082\u3046\u4e00\u5ea6GPU\u3078\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002\u305a\u3044\u3076\u3093\u3068\u7121\u99c4\u306a\u30c7\u30fc\u30bf\u306e\u6d41\u308c\u304c\u5b58\u5728\u3059\u308b\u3088\u3046\u306b\u898b\u3048\u307e\u3059\u3002 =# explain select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_brand1 between 'MFGR#2221' and 'MFGR#2228' and s_region = 'ASIA' group by d_year, p_brand1; QUERY PLAN --------------------------------------------------------------------------------------------------------------- GroupAggregate (cost=31007186.70..31023043.21 rows=6482 width=46) Group Key: date1.d_year, part.p_brand1 -> Sort (cost=31007186.70..31011130.57 rows=1577548 width=20) Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuJoin) on lineorder (cost=275086.19..30844784.03 rows=1577548 width=20) GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue GPU Join Quals [1]: (part.p_partkey = lineorder.lo_partkey) ... [nrows: 5994236000 -> 7804495] GPU Outer Hash [1]: lineorder.lo_partkey GPU Inner Hash [1]: part.p_partkey GPU Join Quals [2]: (supplier.s_suppkey = lineorder.lo_suppkey) ... [nrows: 7804495 -> 1577548] GPU Outer Hash [2]: lineorder.lo_suppkey GPU Inner Hash [2]: supplier.s_suppkey GPU Join Quals [3]: (date1.d_datekey = lineorder.lo_orderdate) ... [nrows: 1577548 -> 1577548] GPU Outer Hash [3]: lineorder.lo_orderdate GPU Inner Hash [3]: date1.d_datekey GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on part (cost=0.00..59258.00 rows=2604 width=14) Filter: ((p_brand1 >= 'MFGR#2221'::bpchar) AND (p_brand1 <= 'MFGR#2228'::bpchar)) -> Custom Scan (GpuScan) on supplier (cost=100.00..190348.83 rows=2019384 width=6) GPU Projection: s_suppkey GPU Pinned Buffer: enabled GPU Scan Quals: (s_region = 'ASIA'::bpchar) [rows: 9990357 -> 2019384] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=8) (24 rows) \u3053\u306e\u3088\u3046\u306b\u3001INNER\u8868\u306e\u8aad\u51fa\u3057\u3084INNER\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u306e\u969b\u306bCPU\u3068GPU\u306e\u9593\u3067\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u3001 Pinned Inner Buffer \u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u8a2d\u5b9a\u3059\u308b\u4e8b\u3067\u3001GpuJoin\u306e\u5b9f\u884c\u958b\u59cb\u30ea\u30fc\u30c9\u30bf\u30a4\u30e0\u306e\u77ed\u7e2e\u3084\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u524a\u6e1b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4e0a\u306e\u5b9f\u884c\u8a08\u753b\u3067\u306f\u3001 supplier \u8868\u306e\u8aad\u51fa\u3057\u304cGpuScan\u306b\u3088\u308a\u884c\u308f\u308c\u308b\u4e8b\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u7d71\u8a08\u60c5\u5831\u306b\u3088\u308c\u3070\u7d04200\u4e07\u884c\u304c\u8aad\u307f\u51fa\u3055\u308c\u308b\u3068\u63a8\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u4e00\u65b9\u3067\u3001 GPU Pinned Buffer: enabled \u306e\u51fa\u529b\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u3001INNER\u8868\u306e\u63a8\u5b9a\u30b5\u30a4\u30ba\u304c pg_strom.pinned_inner_buffer_threshold \u306e\u8a2d\u5b9a\u5024\u3092\u8d8a\u3048\u308b\u5834\u5408\u3001GpuScan\u306e\u51e6\u7406\u7d50\u679c\u3092\u305d\u306e\u307e\u307eGPU\u30e1\u30e2\u30ea\u306b\u6b8b\u3057\u3066\u304a\u304d\u3001\u305d\u308c\u3092\u6b21\u306eGpuJoin\u3067INNER\u30d0\u30c3\u30d5\u30a1\u306e\u4e00\u90e8\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u3068\u3044\u3046\u6a5f\u80fd\u3067\u3059\uff08\u5fc5\u8981\u3067\u3042\u308c\u3070\u30cf\u30c3\u30b7\u30e5\u5024\u306e\u8a08\u7b97\u3082GPU\u3067\u884c\u3044\u307e\u3059\uff09\u3002 \u305d\u306e\u305f\u3081\u3001 supplier \u8868\u306e\u5185\u5bb9\u306fGPU-Direct SQL\u306b\u3088\u3063\u3066\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089GPU\u3078\u3068\u8aad\u307f\u51fa\u3055\u308c\u305f\u5f8c\u3001CPU\u5074\u306b\u623b\u3055\u308c\u305f\u308a\u3001\u518d\u5ea6GPU\u3078\u30ed\u30fc\u30c9\u3055\u308c\u305f\u308a\u3059\u308b\u3053\u3068\u306a\u304f\u3001\u6b21\u306eGpuJoin\u3067\u5229\u7528\u3055\u308c\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u4e00\u65b9\u3067Pinned Inner Buffer\u306e\u4f7f\u7528\u306b\u306f\u82e5\u5e72\u306e\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5\u3082\u3042\u308b\u305f\u3081\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u7121\u52b9\u5316\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u672c\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u660e\u793a\u7684\u306b pg_strom.pinned_inner_buffer_threshold \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 Pinned Inner Buffer\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u3001CPU\u5074\u306fINNER\u30d0\u30c3\u30d5\u30a1\u306e\u5185\u5bb9\u3092\u5b8c\u5168\u306b\u306f\u4fdd\u6301\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001TOAST\u5316\u3055\u308c\u305f\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u3092GPU\u3067\u53c2\u7167\u3057\u305f\u5834\u5408\u306a\u3069\u3001CPU Fallback\u51e6\u7406\u3092\u884c\u3046\u4e8b\u304c\u3067\u304d\u305a\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305b\u307e\u3059\u3002\u307e\u305f\u3001CPU Fallback\u3092\u5229\u7528\u3057\u3066\u5b9f\u88c5\u3055\u308c\u3066\u3044\u308bRIGHT/FULL OUTER JOIN\u3082\u540c\u69d8\u306e\u7406\u7531\u3067Pinned Inner Buffer\u3068\u5171\u5b58\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002","title":"GpuJoin\u306b\u304a\u3051\u308bInner Pinned Buffer"},{"location":"operations/#_3","text":"PG-Strom\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306ewiki\u30b5\u30a4\u30c8\u306b\u306f\u3001\u30ce\u30fc\u30c8\u3068\u547c\u3070\u308c\u308b\u8a73\u7d30\u306a\u6280\u8853\u60c5\u5831\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002 https://github.com/heterodb/pg-strom/wiki","title":"\u30ca\u30ec\u30c3\u30b8\u30d9\u30fc\u30b9"},{"location":"partition/","text":"\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3 \u672c\u7ae0\u3067\u306fPostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u6a5f\u80fd\u3068PG-Strom\u3092\u4f75\u7528\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u306a\u304a\u3001\u672c\u7ae0\u306e\u5185\u5bb9\u306f PostgreSQL v11\u4ee5\u964d \u3067PG-Strom\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u3067\u3059\u3002 PostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u6a5f\u80fd\u306b\u3064\u3044\u3066\u3001\u8a73\u3057\u304f\u306f PostgreSQL\u6587\u66f8\uff1a\u30c6\u30fc\u30d6\u30eb\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u6982\u8981 PostgreSQL v10\u306b\u304a\u3044\u3066\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u6a5f\u80fd\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u3057\u305f\u3002 \u3053\u308c\u306f\u3001\u8ad6\u7406\u7684\u306b\u306f\u4e00\u500b\u306e\u5927\u304d\u306a\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b\u3082\u306e\u3092\u7269\u7406\u7684\u306b\u3088\u308a\u5c0f\u3055\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u5206\u5272\u3057\u3066\u683c\u7d0d\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3001\u691c\u7d22\u6761\u4ef6\u3088\u308a\u660e\u3089\u304b\u306b\u30b9\u30ad\u30e3\u30f3\u306e\u5fc5\u8981\u304c\u306a\u3044\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u305f\u308a\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u7269\u7406\u7684\u306b\u5206\u6563\u3055\u305b\u308b\u4e8b\u3067\u3088\u308a\u5e83\u3044I/O\u5e2f\u57df\u3092\u78ba\u4fdd\u3059\u308b\u306a\u3069\u306e\u5229\u70b9\u304c\u3042\u308a\u307e\u3059\u3002 PostgreSQL v10\u3067\u306f\u7bc4\u56f2\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3001\u30ea\u30b9\u30c8\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u306e2\u7a2e\u985e\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3001\u3055\u3089\u306bPostgreSQL v11\u3067\u306f\u30cf\u30c3\u30b7\u30e5\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u306b\u52a0\u3048\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u540c\u58eb\u306eJOIN\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u56f3\u306f\u3001\u65e5\u4ed8\u578b\uff08DATE\u578b\uff09\u306e\u30ad\u30fc\u5024\u3092\u7528\u3044\u305f\u7bc4\u56f2\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002 \u30ad\u30fc\u5024 2018-05-30 \u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u306f\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb tbl_2018 \u306b\u632f\u308a\u5206\u3051\u3089\u308c\u3001\u540c\u69d8\u306b\u3001\u30ad\u30fc\u5024 2014-03-21 \u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u306f\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb tbl_2014 \u306b\u632f\u308a\u5206\u3051\u3089\u308c\u308b\u30fb\u30fb\u30fb\u3068\u3044\u3063\u305f\u5177\u5408\u3067\u3059\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u6642\u3001\u4f8b\u3048\u3070 WHERE ymd > '2016-07-01'::date \u3068\u3044\u3046\u6761\u4ef6\u53e5\u304c\u4ed8\u52a0\u3055\u308c\u3066\u3044\u308b\u3068\u3001 tbl_2014 \u304a\u3088\u3073 tbl_2015 \u306b\u8a72\u5f53\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u304c\u5b58\u5728\u3057\u306a\u3044\u4e8b\u306f\u81ea\u660e\u3067\u3059\u306e\u3067\u3001PostgreSQL\u306e\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306f tbl_2016 \u3001 tbl_2017 \u3001 tbl_2018 \u3060\u3051\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u7d50\u5408\u3059\u308b Append \u30ce\u30fc\u30c9\u3092\u631f\u3080\u4e8b\u3067\u3001\u3042\u305f\u304b\u3082\u5358\u4e00\u306e\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30ec\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u51fa\u3057\u305f\u304b\u306e\u3088\u3046\u306b\u632f\u821e\u3046\u5b9f\u884c\u8a08\u753b\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 PostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3068PG-Strom\u3092\u4f75\u7528\u3059\u308b\u5834\u5408\u3001\u307e\u305a\u3001\u30b9\u30ad\u30e3\u30f3\u304c\u5fc5\u8981\u3067\u3042\u308b\u3068\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u304c\u5224\u65ad\u3057\u305f\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u5bfe\u3057\u3001\u500b\u3005\u306b\u5b9f\u884c\u30b3\u30b9\u30c8\u3092\u63a8\u5b9a\u3057\u305f\u4e0a\u3067 GpuScan \u304c\u9078\u629e\u3055\u308c\u308b\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001 GpuScan \u306e\u5b9f\u884c\u7d50\u679c\u3092 Append \u30ce\u30fc\u30c9\u3067\u675f\u306d\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u305f\u3060\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u7d9a\u304d\u3001JOIN\u3084GROUP BY\u306a\u3069PG-Strom\u3067\u9ad8\u901f\u5316\u304c\u53ef\u80fd\u306a\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u6700\u9069\u5316\u306e\u89b3\u70b9\u304b\u3089\u691c\u8a0e\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4f8b\u3048\u3070\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u3066\u3044\u306a\u3044\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3066\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u3068JOIN\u3057\u3001GROUP BY\u306b\u3088\u308b\u96c6\u8a08\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\u5834\u5408\u3001\u6761\u4ef6\u304c\u63c3\u3048\u3070\u3001\u5404\u30b9\u30c6\u30c3\u30d7\u9593\u306e\u30c7\u30fc\u30bf\u4ea4\u63db\u306fGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u3067\u884c\u3046\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306fGPU\u3068CPU\u306e\u9593\u306e\u30c7\u30fc\u30bf\u79fb\u52d5\u3092\u6700\u5c0f\u5316\u3059\u308b\u3068\u3044\u3046\u89b3\u70b9\u304b\u3089\u3001\u6700\u3082PG-Strom\u304c\u5f97\u610f\u3068\u3059\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u3002 \u4e00\u65b9\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u540c\u69d8\u306e\u51e6\u7406\u3092\u884c\u3046\u5834\u5408\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u3068JOIN\u3084GROUP BY\u306e\u9593\u306b Append \u51e6\u7406\u304c\u631f\u307e\u3063\u3066\u3057\u307e\u3046\u306e\u304c\u8ab2\u984c\u3067\u3059\u3002\u3053\u306e\u5b9f\u884c\u8a08\u753b\u306e\u4e0b\u3067\u306f\u3001GpuScan\u304c\u51e6\u7406\u3057\u305f\u30c7\u30fc\u30bf\u3092\u4e00\u5ea6\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u3078\u8ee2\u9001\u3057\u3001 Append \u51e6\u7406\u3092\u884c\u3063\u305f\u4e0a\u3067\u3001\u305d\u306e\u5f8c\u306eGpuJoin\u3084GpuPreAgg\u51e6\u7406\u3092\u884c\u3046\u305f\u3081\u306b\u518d\u3073\u30c7\u30fc\u30bf\u3092GPU\u3078\u8ee2\u9001\u3059\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u6c7a\u3057\u3066\u52b9\u7387\u306e\u826f\u3044\u51e6\u7406\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u3053\u306e\u3088\u3046\u306aCPU-GPU\u9593\u306e\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u3092\u907f\u3051\u308b\u305f\u3081\u3001PG-Strom\u306f\u53ef\u80fd\u306a\u9650\u308aJOIN\u3084GROUP BY\u3092 Append \u3088\u308a\u3082\u5148\u306b\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3092\u8a66\u307f\u307e\u3059\u3002 \u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u304c\u6210\u529f\u308c\u3070\u3001\u30c7\u30fc\u30bf\u4ea4\u63db\u3092\u52b9\u7387\u5316\u3067\u304d\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u7279\u306bGROUP BY\u51e6\u7406\u306b\u3088\u3063\u3066\u884c\u6570\u3092\u5927\u5e45\u306b\u524a\u6e1b\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308b\u305f\u3081\u3001 Append \u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u306e\u8ca0\u8377\u3092\u9855\u8457\u306b\u6e1b\u3089\u3059\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u65e5\u4ed8\u578b\uff08date\u578b\uff09\u306e\u30d5\u30a3\u30fc\u30eb\u30c9 ymd \u3092\u30ad\u30fc\u3068\u3057\u3066\u5e74\u5358\u4f4d\u3067\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308b pt \u306b\u5bfe\u3057\u3066\u3001JOIN\u3068GROUP BY\u3092\u542b\u3080\u30af\u30a8\u30ea\u3092\u6295\u5165\u3057\u305f\u6642\u306e\u5b9f\u884c\u8a08\u753b\u3067\u3059\u3002 \u691c\u7d22\u6761\u4ef6\u306b\u3088\u308a2016\u5e74\u4ee5\u524d\u306e\u30c7\u30fc\u30bf\u3092\u542b\u3080\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306f\u81ea\u660e\u306b\u6392\u9664\u3055\u308c\u3001\u3055\u3089\u306b pt_2017 \u3001 pt_2018 \u3001 pt_2019 \u5404\u30c6\u30fc\u30d6\u30eb\u306eJOIN\u3068GROUP BY\u51e6\u7406\u304c\u4e00\u4f53\u3068\u306a\u3063\u3066 Append \u306e\u524d\u306b\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 # EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- HashAggregate (cost=196410.07..196412.57 rows=200 width=48) Group Key: pt_2017.cat -> Gather (cost=66085.69..196389.07 rows=1200 width=72) Workers Planned: 2 -> Parallel Append (cost=65085.69..195269.07 rows=600 width=72) -> Parallel Custom Scan (GpuPreAgg) (cost=65085.69..65089.69 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2017 (cost=32296.64..74474.20 rows=1050772 width=40) Outer Scan: pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050772...2521854) HashKeys: pt_2017.aid JoinQuals: (pt_2017.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65078.35..65082.35 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2018 (cost=32296.65..74465.75 rows=1050649 width=40) Outer Scan: pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050649...2521557) HashKeys: pt_2018.aid JoinQuals: (pt_2018.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65093.03..65097.03 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2019 (cost=32296.65..74482.64 rows=1050896 width=40) Outer Scan: pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050896...2522151) HashKeys: pt_2019.aid JoinQuals: (pt_2019.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (38 rows) \u8a2d\u5b9a\u3068\u904b\u7528 \u4ee5\u4e0b\u306eGUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308a\u3001PG-Strom\u306fJOIN\u3084GROUP BY\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3078\u306e\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 \u30d1\u30e9\u30e1\u30fc\u30bf\u540d \u578b \u521d\u671f\u5024 \u8aac\u660e pg_strom.enable_partitionwise_gpujoin bool on GpuJoin\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002PostgreSQL v10\u4ee5\u964d\u3067\u306e\u307f\u5bfe\u5fdc\u3002 pg_strom.enable_partitionwise_gpupreagg bool on GpuPreAgg\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002PostgreSQL v10\u4ee5\u964d\u3067\u306e\u307f\u5bfe\u5fdc\u3002 \u3053\u308c\u3089\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u521d\u671f\u5024\u306f on \u3067\u3059\u304c\u3001\u3053\u308c\u3092 off \u306b\u3057\u305f\u5834\u5408\u3001\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u51e6\u7406\u306f\u884c\u308f\u308c\u307e\u305b\u3093\u3002 EXPLAIN\u30b3\u30de\u30f3\u30c9\u3067\u524d\u7bc0\u306e\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u8a08\u753b\u3092\u8868\u793a\u3057\u305f\u3068\u3053\u308d\u3001\u5b9f\u884c\u8a08\u753b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u5316\u3057\u3066\u3044\u307e\u3059\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u306f GpuScan \u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u51e6\u7406\u7d50\u679c\u306f\u4e00\u5ea6\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u306b\u8fd4\u3055\u308c\u3001 Append \u306b\u3088\u3063\u3066\u7d50\u5408\u3055\u308c\u305f\u5f8c\u3001\u518d\u3073 GpuJoin \u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306bGPU\u3078\u3068\u8ee2\u9001\u3055\u308c\u307e\u3059\u3002 postgres=# set pg_strom.enable_partitionwise_gpujoin = off; SET postgres=# set pg_strom.enable_partitionwise_gpupreagg = off; SET postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date group by cat; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate (cost=341392.92..341399.42 rows=200 width=48) Group Key: pt.cat -> Sort (cost=341392.92..341393.92 rows=400 width=72) Sort Key: pt.cat -> Gather (cost=341333.63..341375.63 rows=400 width=72) Workers Planned: 2 -> Partial HashAggregate (cost=340333.63..340335.63 rows=200 width=72) Group Key: pt.cat -> Parallel Custom Scan (GpuJoin) (cost=283591.92..283591.92 rows=7565562 width=40) Depth 1: GpuHashJoin (nrows 3152318...7565562) HashKeys: pt.aid JoinQuals: (pt.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Append (cost=28540.80..200673.34 rows=3152318 width=36) -> Parallel Custom Scan (GpuScan) on pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (21 rows) SSD\u3068GPU\u306e\u914d\u7f6e\u306b\u95a2\u3059\u308b\u8003\u616e PostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3068SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3092\u4f75\u7528\u3059\u308b\u5834\u5408\u3001\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u304c\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092\u4fdd\u5b58\u3059\u308bNVMe-SSD\u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u7269\u7406\u7684\u306a\u914d\u7f6e\u306b\u306f\u7279\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002 \u5236\u9650\u4e8b\u9805 \u5b9f\u9a13\u7684\u6a5f\u80fd GpuJoin\u3068GpuPreAgg\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3078\u306e\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u306f\u3001\u73fe\u6642\u70b9\u3067\u306f\u5b9f\u9a13\u7684\u306a\u6a5f\u80fd\u3067\u3042\u308a\u3001\u4e88\u671f\u305b\u306c\u4e0d\u5177\u5408\u3084\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u5834\u5408\u306f pg_strom.enable_partitionwise_gpujoin \u3084 pg_strom.enable_partitionwise_gpupreagg \u3092\u7528\u3044\u3066\u5f53\u8a72\u6a5f\u80fd\u3092\u7121\u52b9\u5316\u3059\u308b\u3068\u5171\u306b\u3001 PG-Strom Issues \u3078\u969c\u5bb3\u30ec\u30dd\u30fc\u30c8\u3092\u304a\u9858\u3044\u3057\u307e\u3059\u3002","title":"\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3"},{"location":"partition/#_1","text":"\u672c\u7ae0\u3067\u306fPostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u6a5f\u80fd\u3068PG-Strom\u3092\u4f75\u7528\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u306a\u304a\u3001\u672c\u7ae0\u306e\u5185\u5bb9\u306f PostgreSQL v11\u4ee5\u964d \u3067PG-Strom\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u3067\u3059\u3002 PostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u6a5f\u80fd\u306b\u3064\u3044\u3066\u3001\u8a73\u3057\u304f\u306f PostgreSQL\u6587\u66f8\uff1a\u30c6\u30fc\u30d6\u30eb\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3"},{"location":"partition/#_2","text":"PostgreSQL v10\u306b\u304a\u3044\u3066\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u6a5f\u80fd\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u3057\u305f\u3002 \u3053\u308c\u306f\u3001\u8ad6\u7406\u7684\u306b\u306f\u4e00\u500b\u306e\u5927\u304d\u306a\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b\u3082\u306e\u3092\u7269\u7406\u7684\u306b\u3088\u308a\u5c0f\u3055\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u5206\u5272\u3057\u3066\u683c\u7d0d\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3001\u691c\u7d22\u6761\u4ef6\u3088\u308a\u660e\u3089\u304b\u306b\u30b9\u30ad\u30e3\u30f3\u306e\u5fc5\u8981\u304c\u306a\u3044\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u305f\u308a\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u7269\u7406\u7684\u306b\u5206\u6563\u3055\u305b\u308b\u4e8b\u3067\u3088\u308a\u5e83\u3044I/O\u5e2f\u57df\u3092\u78ba\u4fdd\u3059\u308b\u306a\u3069\u306e\u5229\u70b9\u304c\u3042\u308a\u307e\u3059\u3002 PostgreSQL v10\u3067\u306f\u7bc4\u56f2\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3001\u30ea\u30b9\u30c8\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u306e2\u7a2e\u985e\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3001\u3055\u3089\u306bPostgreSQL v11\u3067\u306f\u30cf\u30c3\u30b7\u30e5\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u306b\u52a0\u3048\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u540c\u58eb\u306eJOIN\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u56f3\u306f\u3001\u65e5\u4ed8\u578b\uff08DATE\u578b\uff09\u306e\u30ad\u30fc\u5024\u3092\u7528\u3044\u305f\u7bc4\u56f2\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002 \u30ad\u30fc\u5024 2018-05-30 \u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u306f\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb tbl_2018 \u306b\u632f\u308a\u5206\u3051\u3089\u308c\u3001\u540c\u69d8\u306b\u3001\u30ad\u30fc\u5024 2014-03-21 \u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u306f\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb tbl_2014 \u306b\u632f\u308a\u5206\u3051\u3089\u308c\u308b\u30fb\u30fb\u30fb\u3068\u3044\u3063\u305f\u5177\u5408\u3067\u3059\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u6642\u3001\u4f8b\u3048\u3070 WHERE ymd > '2016-07-01'::date \u3068\u3044\u3046\u6761\u4ef6\u53e5\u304c\u4ed8\u52a0\u3055\u308c\u3066\u3044\u308b\u3068\u3001 tbl_2014 \u304a\u3088\u3073 tbl_2015 \u306b\u8a72\u5f53\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u304c\u5b58\u5728\u3057\u306a\u3044\u4e8b\u306f\u81ea\u660e\u3067\u3059\u306e\u3067\u3001PostgreSQL\u306e\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306f tbl_2016 \u3001 tbl_2017 \u3001 tbl_2018 \u3060\u3051\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u7d50\u5408\u3059\u308b Append \u30ce\u30fc\u30c9\u3092\u631f\u3080\u4e8b\u3067\u3001\u3042\u305f\u304b\u3082\u5358\u4e00\u306e\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30ec\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u51fa\u3057\u305f\u304b\u306e\u3088\u3046\u306b\u632f\u821e\u3046\u5b9f\u884c\u8a08\u753b\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 PostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3068PG-Strom\u3092\u4f75\u7528\u3059\u308b\u5834\u5408\u3001\u307e\u305a\u3001\u30b9\u30ad\u30e3\u30f3\u304c\u5fc5\u8981\u3067\u3042\u308b\u3068\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u304c\u5224\u65ad\u3057\u305f\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u5bfe\u3057\u3001\u500b\u3005\u306b\u5b9f\u884c\u30b3\u30b9\u30c8\u3092\u63a8\u5b9a\u3057\u305f\u4e0a\u3067 GpuScan \u304c\u9078\u629e\u3055\u308c\u308b\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001 GpuScan \u306e\u5b9f\u884c\u7d50\u679c\u3092 Append \u30ce\u30fc\u30c9\u3067\u675f\u306d\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u305f\u3060\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u7d9a\u304d\u3001JOIN\u3084GROUP BY\u306a\u3069PG-Strom\u3067\u9ad8\u901f\u5316\u304c\u53ef\u80fd\u306a\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u6700\u9069\u5316\u306e\u89b3\u70b9\u304b\u3089\u691c\u8a0e\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4f8b\u3048\u3070\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u3066\u3044\u306a\u3044\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3066\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u3068JOIN\u3057\u3001GROUP BY\u306b\u3088\u308b\u96c6\u8a08\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\u5834\u5408\u3001\u6761\u4ef6\u304c\u63c3\u3048\u3070\u3001\u5404\u30b9\u30c6\u30c3\u30d7\u9593\u306e\u30c7\u30fc\u30bf\u4ea4\u63db\u306fGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u3067\u884c\u3046\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306fGPU\u3068CPU\u306e\u9593\u306e\u30c7\u30fc\u30bf\u79fb\u52d5\u3092\u6700\u5c0f\u5316\u3059\u308b\u3068\u3044\u3046\u89b3\u70b9\u304b\u3089\u3001\u6700\u3082PG-Strom\u304c\u5f97\u610f\u3068\u3059\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u3002 \u4e00\u65b9\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u540c\u69d8\u306e\u51e6\u7406\u3092\u884c\u3046\u5834\u5408\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u3068JOIN\u3084GROUP BY\u306e\u9593\u306b Append \u51e6\u7406\u304c\u631f\u307e\u3063\u3066\u3057\u307e\u3046\u306e\u304c\u8ab2\u984c\u3067\u3059\u3002\u3053\u306e\u5b9f\u884c\u8a08\u753b\u306e\u4e0b\u3067\u306f\u3001GpuScan\u304c\u51e6\u7406\u3057\u305f\u30c7\u30fc\u30bf\u3092\u4e00\u5ea6\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u3078\u8ee2\u9001\u3057\u3001 Append \u51e6\u7406\u3092\u884c\u3063\u305f\u4e0a\u3067\u3001\u305d\u306e\u5f8c\u306eGpuJoin\u3084GpuPreAgg\u51e6\u7406\u3092\u884c\u3046\u305f\u3081\u306b\u518d\u3073\u30c7\u30fc\u30bf\u3092GPU\u3078\u8ee2\u9001\u3059\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u6c7a\u3057\u3066\u52b9\u7387\u306e\u826f\u3044\u51e6\u7406\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u3053\u306e\u3088\u3046\u306aCPU-GPU\u9593\u306e\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u3092\u907f\u3051\u308b\u305f\u3081\u3001PG-Strom\u306f\u53ef\u80fd\u306a\u9650\u308aJOIN\u3084GROUP BY\u3092 Append \u3088\u308a\u3082\u5148\u306b\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3092\u8a66\u307f\u307e\u3059\u3002 \u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u304c\u6210\u529f\u308c\u3070\u3001\u30c7\u30fc\u30bf\u4ea4\u63db\u3092\u52b9\u7387\u5316\u3067\u304d\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u7279\u306bGROUP BY\u51e6\u7406\u306b\u3088\u3063\u3066\u884c\u6570\u3092\u5927\u5e45\u306b\u524a\u6e1b\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308b\u305f\u3081\u3001 Append \u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u306e\u8ca0\u8377\u3092\u9855\u8457\u306b\u6e1b\u3089\u3059\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u65e5\u4ed8\u578b\uff08date\u578b\uff09\u306e\u30d5\u30a3\u30fc\u30eb\u30c9 ymd \u3092\u30ad\u30fc\u3068\u3057\u3066\u5e74\u5358\u4f4d\u3067\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308b pt \u306b\u5bfe\u3057\u3066\u3001JOIN\u3068GROUP BY\u3092\u542b\u3080\u30af\u30a8\u30ea\u3092\u6295\u5165\u3057\u305f\u6642\u306e\u5b9f\u884c\u8a08\u753b\u3067\u3059\u3002 \u691c\u7d22\u6761\u4ef6\u306b\u3088\u308a2016\u5e74\u4ee5\u524d\u306e\u30c7\u30fc\u30bf\u3092\u542b\u3080\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306f\u81ea\u660e\u306b\u6392\u9664\u3055\u308c\u3001\u3055\u3089\u306b pt_2017 \u3001 pt_2018 \u3001 pt_2019 \u5404\u30c6\u30fc\u30d6\u30eb\u306eJOIN\u3068GROUP BY\u51e6\u7406\u304c\u4e00\u4f53\u3068\u306a\u3063\u3066 Append \u306e\u524d\u306b\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 # EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- HashAggregate (cost=196410.07..196412.57 rows=200 width=48) Group Key: pt_2017.cat -> Gather (cost=66085.69..196389.07 rows=1200 width=72) Workers Planned: 2 -> Parallel Append (cost=65085.69..195269.07 rows=600 width=72) -> Parallel Custom Scan (GpuPreAgg) (cost=65085.69..65089.69 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2017 (cost=32296.64..74474.20 rows=1050772 width=40) Outer Scan: pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050772...2521854) HashKeys: pt_2017.aid JoinQuals: (pt_2017.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65078.35..65082.35 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2018 (cost=32296.65..74465.75 rows=1050649 width=40) Outer Scan: pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050649...2521557) HashKeys: pt_2018.aid JoinQuals: (pt_2018.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65093.03..65097.03 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2019 (cost=32296.65..74482.64 rows=1050896 width=40) Outer Scan: pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050896...2522151) HashKeys: pt_2019.aid JoinQuals: (pt_2019.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (38 rows)","title":"\u6982\u8981"},{"location":"partition/#_3","text":"\u4ee5\u4e0b\u306eGUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308a\u3001PG-Strom\u306fJOIN\u3084GROUP BY\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3078\u306e\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 \u30d1\u30e9\u30e1\u30fc\u30bf\u540d \u578b \u521d\u671f\u5024 \u8aac\u660e pg_strom.enable_partitionwise_gpujoin bool on GpuJoin\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002PostgreSQL v10\u4ee5\u964d\u3067\u306e\u307f\u5bfe\u5fdc\u3002 pg_strom.enable_partitionwise_gpupreagg bool on GpuPreAgg\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002PostgreSQL v10\u4ee5\u964d\u3067\u306e\u307f\u5bfe\u5fdc\u3002 \u3053\u308c\u3089\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u521d\u671f\u5024\u306f on \u3067\u3059\u304c\u3001\u3053\u308c\u3092 off \u306b\u3057\u305f\u5834\u5408\u3001\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u51e6\u7406\u306f\u884c\u308f\u308c\u307e\u305b\u3093\u3002 EXPLAIN\u30b3\u30de\u30f3\u30c9\u3067\u524d\u7bc0\u306e\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u8a08\u753b\u3092\u8868\u793a\u3057\u305f\u3068\u3053\u308d\u3001\u5b9f\u884c\u8a08\u753b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u5316\u3057\u3066\u3044\u307e\u3059\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u306f GpuScan \u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u51e6\u7406\u7d50\u679c\u306f\u4e00\u5ea6\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u306b\u8fd4\u3055\u308c\u3001 Append \u306b\u3088\u3063\u3066\u7d50\u5408\u3055\u308c\u305f\u5f8c\u3001\u518d\u3073 GpuJoin \u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306bGPU\u3078\u3068\u8ee2\u9001\u3055\u308c\u307e\u3059\u3002 postgres=# set pg_strom.enable_partitionwise_gpujoin = off; SET postgres=# set pg_strom.enable_partitionwise_gpupreagg = off; SET postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date group by cat; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate (cost=341392.92..341399.42 rows=200 width=48) Group Key: pt.cat -> Sort (cost=341392.92..341393.92 rows=400 width=72) Sort Key: pt.cat -> Gather (cost=341333.63..341375.63 rows=400 width=72) Workers Planned: 2 -> Partial HashAggregate (cost=340333.63..340335.63 rows=200 width=72) Group Key: pt.cat -> Parallel Custom Scan (GpuJoin) (cost=283591.92..283591.92 rows=7565562 width=40) Depth 1: GpuHashJoin (nrows 3152318...7565562) HashKeys: pt.aid JoinQuals: (pt.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Append (cost=28540.80..200673.34 rows=3152318 width=36) -> Parallel Custom Scan (GpuScan) on pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (21 rows)","title":"\u8a2d\u5b9a\u3068\u904b\u7528"},{"location":"partition/#ssdgpu","text":"PostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3068SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3092\u4f75\u7528\u3059\u308b\u5834\u5408\u3001\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u304c\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092\u4fdd\u5b58\u3059\u308bNVMe-SSD\u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u7269\u7406\u7684\u306a\u914d\u7f6e\u306b\u306f\u7279\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002","title":"SSD\u3068GPU\u306e\u914d\u7f6e\u306b\u95a2\u3059\u308b\u8003\u616e"},{"location":"partition/#_4","text":"\u5b9f\u9a13\u7684\u6a5f\u80fd GpuJoin\u3068GpuPreAgg\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3078\u306e\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u306f\u3001\u73fe\u6642\u70b9\u3067\u306f\u5b9f\u9a13\u7684\u306a\u6a5f\u80fd\u3067\u3042\u308a\u3001\u4e88\u671f\u305b\u306c\u4e0d\u5177\u5408\u3084\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u5834\u5408\u306f pg_strom.enable_partitionwise_gpujoin \u3084 pg_strom.enable_partitionwise_gpupreagg \u3092\u7528\u3044\u3066\u5f53\u8a72\u6a5f\u80fd\u3092\u7121\u52b9\u5316\u3059\u308b\u3068\u5171\u306b\u3001 PG-Strom Issues \u3078\u969c\u5bb3\u30ec\u30dd\u30fc\u30c8\u3092\u304a\u9858\u3044\u3057\u307e\u3059\u3002","title":"\u5236\u9650\u4e8b\u9805"},{"location":"postgis/","text":"GPU\u7248PostGIS \u672c\u7ae0\u3067\u306fGPU\u7248PostGIS\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u6982\u8981 PostGIS\u3068\u306f\u3001\u5730\u7406\u7a7a\u9593\u60c5\u5831\u3092\u53d6\u308a\u6271\u3046\u305f\u3081\u306ePostgreSQL\u5411\u3051\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3059\u3002 \u70b9\u3001\u7dda\u5206\u3001\u30dd\u30ea\u30b4\u30f3\u306a\u3069\u5730\u7406\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u6271\u3046\u305f\u3081\u306e\u30c7\u30fc\u30bf\u578b\uff08 Geometry \uff09\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u307b\u304b\u3001\u8ddd\u96e2\u306e\u8a08\u7b97\u3084\u5305\u542b\u3001\u4ea4\u5dee\u95a2\u4fc2\u306e\u5224\u5b9a\u306a\u3069\u3001\u5730\u7406\u30c7\u30fc\u30bf\u8981\u7d20\u3092\u8a55\u4fa1\u3059\u308b\u305f\u3081\u306e\u95a2\u6570\u3084\u6f14\u7b97\u5b50\u3092\u6570\u591a\u304f\u53d6\u308a\u63c3\u3048\u3066\u3044\u307e\u3059\u3002 \u307e\u305f\u3001\u4e00\u90e8\u306e\u6f14\u7b97\u5b50\u306b\u3064\u3044\u3066\u306fPostgreSQL\u306eGiST(Generalized Search Tree)\u306e\u4ed5\u7d44\u307f\u3092\u7528\u3044\u3066R\u6728\u306b\u3088\u308b\u9ad8\u901f\u306a\u691c\u7d22\u3082\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 2001\u5e74\u306b\u6700\u521d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u516c\u958b\u3055\u308c\u3066\u4ee5\u964d\u300120\u5e74\u4ee5\u4e0a\u306b\u308f\u305f\u308a\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306b\u3088\u3063\u3066\u6a5f\u80fd\u5f37\u5316\u3084\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u304c\u884c\u308f\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089PostGIS\u306e\u63d0\u4f9b\u3059\u308b\u95a2\u6570\u3084\u6f14\u7b97\u5b50\u306f\u3001\u7dcf\u6570\u3067500\u3092\u8d85\u3048\u308b\u975e\u5e38\u306b\u5927\u898f\u6a21\u306a\u3082\u306e\u3067\u3059\u3002 \u305d\u306e\u305f\u3081\u3001PG-Strom\u3067\u306f\u6bd4\u8f03\u7684\u5229\u7528\u983b\u5ea6\u306e\u9ad8\u3044\u3044\u304f\u3064\u304b\u306ePostGIS\u95a2\u6570\u3060\u3051\u3092GPU\u7528\u306b\u79fb\u690d\u3057\u3066\u3044\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306aPostGIS\u95a2\u6570\u304c\u305d\u308c\u306b\u8a72\u5f53\u3057\u307e\u3059\u3002 geometry st_point(float8 lon,float8 lat) \u7d4c\u5ea6\u7def\u5ea6\u304b\u3089\u3001\u70b9\uff08Point\uff09\u3067\u3042\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u578b\u3092\u751f\u6210\u3059\u308b\u3002 bool st_contains(geometry a,geometry b) \u30b8\u30aa\u30e1\u30c8\u30eaa\u304c\u30b8\u30aa\u30e1\u30c8\u30eab\u304c\u5305\u542b\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u3002 bool st_crosses(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u304c\u4ea4\u5dee\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u3002 text st_relate(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u306e\u95a2\u4fc2\u3092 DE-9IM(Dimensionally Extended 9-Intersection Model) \u306e\u884c\u5217\u8868\u73fe\u3068\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002 \u307e\u305f\u3001\u30c6\u30fc\u30d6\u30eb\u540c\u58eb\u306e\u7d50\u5408\u6761\u4ef6\u304cGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u306e\u5229\u7528\u306b\u9069\u3059\u308b\u5834\u5408\u3001GpuJoin\u306fGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u3092GPU\u5074\u306b\u30ed\u30fc\u30c9\u3057\u3001\u7d50\u5408\u3059\u3079\u304d\u884c\u306e\u7d5e\u308a\u8fbc\u307f\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u3053\u308c\u306f\u4f8b\u3048\u3070\u3001GPS\u304b\u3089\u53d6\u5f97\u3057\u305f\u30e2\u30d0\u30a4\u30eb\u6a5f\u5668\u306e\u4f4d\u7f6e\uff08\u70b9\uff09\u3068\u30a8\u30ea\u30a2\u5b9a\u7fa9\u30c7\u30fc\u30bf\uff08\u30dd\u30ea\u30b4\u30f3\uff09\u3092\u7a81\u304d\u5408\u308f\u305b\u308b\u3068\u3044\u3063\u305f\u51e6\u7406\u306e\u9ad8\u901f\u5316\u306b\u5bc4\u4e0e\u3057\u307e\u3059\u3002 PostGIS\u306e\u5229\u7528 GPU\u7248PostGIS\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u7279\u5225\u306a\u8a2d\u5b9a\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002 PostGIS\u3092\u30d1\u30c3\u30b1\u30fc\u30b8\u53c8\u306f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001 CREATE EXTENSION \u69cb\u6587\u3092\u7528\u3044\u3066\u30b8\u30aa\u30e1\u30c8\u30ea\u30c7\u30fc\u30bf\u578b\u3084PostGIS\u95a2\u6570\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308c\u3070\u3001PG-Strom\u306f\u30af\u30a8\u30ea\u306b\u51fa\u73fe\u3057\u305fPostGIS\u95a2\u6570\u304cGPU\u3067\u5b9f\u884c\u53ef\u80fd\u304b\u3069\u3046\u304b\u3092\u81ea\u52d5\u7684\u306b\u5224\u5b9a\u3057\u307e\u3059\u3002 PostGIS\u81ea\u4f53\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u306f\u3001 PostGIS\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u306b\u306fGPU\u5b9f\u884c\u53ef\u80fd\u306aPostGIS\u95a2\u6570\u3067\u3042\u308b st_contains() \u3068 st_makepoint() \u3092\u4f7f\u7528\u3057\u3066\u304a\u308a\u3001\u30b8\u30aa\u30e1\u30c8\u30ea\u578b\u306e\u5b9a\u6570 'polygon ((10 10,30 10,30 20,10 20,10 10))' \u306e\u7bc4\u56f2\u5185\u306b\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u4e8c\u6b21\u5143\u306e\u70b9\u304c\u542b\u307e\u308c\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u95a2\u6570\u304c GPU Filter: \u306e\u4e00\u90e8\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u4e8b\u304b\u3089\u3082\u5206\u304b\u308b\u3088\u3046\u306b\u3001PG-Strom\u306f\u5bfe\u5fdc\u6e08\u307f\u306ePostGIS\u95a2\u6570\u3092\u81ea\u52d5\u7684\u306b\u691c\u51fa\u3057\u3001\u53ef\u80fd\u306a\u9650\u308aGPU\u3067\u5b9f\u884c\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002 =# explain select * from dpoints where st_contains('polygon ((10 10,30 10,30 20,10 20,10 10))', st_makepoint(x,y)); QUERY PLAN ------------------------------------------------------------------------------------------ Custom Scan (GpuScan) on dpoints (cost=1397205.10..12627630.76 rows=800 width=28) GPU Filter: st_contains('01030000000100000005000000000000000000244000000000000024400000000000003E4000000000000024400000000000003E4000000000000034400000000000002440000000000000344000000000000024400000000000002440'::geometry, st_makepoint(x, y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) (3 rows) GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9 st_contains() \u3084 st_crosses() \u306a\u3069\u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u306e\u95a2\u4fc2\u6027\u3092\u8a55\u4fa1\u3059\u308bPostGIS\u95a2\u6570\u306e\u4e00\u90e8\u306f\u3001GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001CPU\u3060\u3051\u3092\u7528\u3044\u3066\u691c\u7d22\u3092\u884c\u3046\u5834\u5408\u306b\u3082\u9ad8\u901f\u306a\u7d5e\u308a\u8fbc\u307f\u3092\u884c\u3046\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 PG-Strom\u306eGpuJoin\u3067\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u540c\u58eb\u306e\u7d50\u5408\u6761\u4ef6\u304cGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u3067\u9ad8\u901f\u5316\u53ef\u80fd\u306a\u5834\u5408\u3001\u7d50\u5408\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u306e\u4e2d\u8eab\u3060\u3051\u3067\u306a\u304f\u3001GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3082\u540c\u6642\u306bGPU\u5074\u3078\u8ee2\u9001\u3057\u3001\u7d50\u5408\u5bfe\u8c61\u306e\u884c\u3092\u9ad8\u901f\u306b\u7d5e\u308a\u8fbc\u3080\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u306e\u51e6\u7406\u306f\u901a\u5e38\u3001CPU\u3088\u308a\u3082\u9065\u304b\u306b\u9ad8\u3044\u4e26\u5217\u5ea6\u3067\u5b9f\u884c\u3055\u308c\u308b\u305f\u3081\u3001\u304b\u306a\u308a\u306e\u9ad8\u901f\u5316\u3092\u671f\u5f85\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4e00\u65b9\u3001GpuScan\u306f\u30c6\u30fc\u30d6\u30eb\u5358\u4f53\u306e\u30b9\u30ad\u30e3\u30f3\u306bGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001CPU\u306b\u3088\u308bIndexScan\u3067\u306e\u7d5e\u308a\u8fbc\u307f\u306e\u65b9\u304c\u9ad8\u901f\u3067\u3042\u308b\u4e8b\u304c\u591a\u3044\u304b\u3089\u3067\u3059\u3002 \u30b8\u30aa\u30e1\u30c8\u30ea\u30c7\u30fc\u30bf\u306bGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u3001 CREATE INDEX \u69cb\u6587\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u5e02\u753a\u6751\u306e\u5883\u754c\u7dda\u30c7\u30fc\u30bf\uff08giscity\u30c6\u30fc\u30d6\u30eb\u306egeom\u5217\uff09\u306b\u5bfe\u3057\u3066GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u3082\u306e\u3067\u3059\u3002 =# CREATE INDEX on giscity USING gist (geom); CREATE INDEX \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u3001\u5e02\u753a\u6751\u306e\u5883\u754c\u7dda\u30c7\u30fc\u30bf\uff08giscity\u30c6\u30fc\u30d6\u30eb\uff09\u3068\u7def\u5ea6\u7d4c\u5ea6\u30c7\u30fc\u30bf\uff08dpoints\u30c6\u30fc\u30d6\u30eb\uff09\u3092\u7a81\u304d\u5408\u308f\u305b\u3001\u30dd\u30ea\u30b4\u30f3\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u305f\u5e02\u753a\u6751\u306e\u9818\u57df\u5185\u306b\u542b\u307e\u308c\u308b\u7def\u5ea6\u7d4c\u5ea6\u30c7\u30fc\u30bf\uff08\u70b9\uff09\u306e\u6570\u3092\u5e02\u753a\u6751\u3054\u3068\u306b\u51fa\u529b\u3059\u308b\u3082\u306e\u3067\u3059\u3002 \u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u3088\u308aGpuJoin\u304c\u9078\u629e\u3055\u308c\u3001giscity\u30c6\u30fc\u30d6\u30eb\u3068dpoints\u30c6\u30fc\u30d6\u30eb\u306e\u7d50\u5408\u306b\u306fGpuGiSTJoin\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u3059\u3002 IndexFilter:\u306e\u884c\u306b\u306f\u3001GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308b\u7d5e\u308a\u8fbc\u307f\u6761\u4ef6\u304c (g.geom ~ st_makepoint(d.x, d.y)) \u3067\u3042\u308a\u3001\u4f7f\u7528\u3059\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c giscity_geom_idx \u3067\u3042\u308b\u4e8b\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u4f7f\u7528\u306b\u3088\u308a\u3001GPU\u3067\u3042\u3063\u3066\u3082\u6bd4\u8f03\u7684\u300c\u91cd\u3044\u300d\u51e6\u7406\u3067\u3042\u308bPostGIS\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u3001\u660e\u3089\u304b\u306b\u6761\u4ef6\u306b\u30de\u30c3\u30c1\u3057\u306a\u3044\u7d44\u307f\u5408\u308f\u305b\u3092\u6392\u9664\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u305f\u3081\u3001\u5927\u5e45\u306a\u691c\u7d22\u51e6\u7406\u306e\u9ad8\u901f\u5316\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 =# EXPLAIN SELECT pref, city, count(*) FROM giscity g, dpoints d WHERE pref = 'Tokyo' AND st_contains(g.geom,st_makepoint(d.x, d.y)) GROUP BY pref, city; QUERY PLAN ----------------------------------------------------------------------------------------------------------- GroupAggregate (cost=5700646.35..5700759.39 rows=5024 width=29) Group Key: g.n03_001, g.n03_004 -> Sort (cost=5700646.35..5700658.91 rows=5024 width=29) Sort Key: g.n03_004 -> Custom Scan (GpuPreAgg) (cost=5700274.71..5700337.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=638671.58..5668511.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (17 rows)","title":"GPU\u7248PostGIS"},{"location":"postgis/#gpupostgis","text":"\u672c\u7ae0\u3067\u306fGPU\u7248PostGIS\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"GPU\u7248PostGIS"},{"location":"postgis/#_1","text":"PostGIS\u3068\u306f\u3001\u5730\u7406\u7a7a\u9593\u60c5\u5831\u3092\u53d6\u308a\u6271\u3046\u305f\u3081\u306ePostgreSQL\u5411\u3051\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3059\u3002 \u70b9\u3001\u7dda\u5206\u3001\u30dd\u30ea\u30b4\u30f3\u306a\u3069\u5730\u7406\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u6271\u3046\u305f\u3081\u306e\u30c7\u30fc\u30bf\u578b\uff08 Geometry \uff09\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u307b\u304b\u3001\u8ddd\u96e2\u306e\u8a08\u7b97\u3084\u5305\u542b\u3001\u4ea4\u5dee\u95a2\u4fc2\u306e\u5224\u5b9a\u306a\u3069\u3001\u5730\u7406\u30c7\u30fc\u30bf\u8981\u7d20\u3092\u8a55\u4fa1\u3059\u308b\u305f\u3081\u306e\u95a2\u6570\u3084\u6f14\u7b97\u5b50\u3092\u6570\u591a\u304f\u53d6\u308a\u63c3\u3048\u3066\u3044\u307e\u3059\u3002 \u307e\u305f\u3001\u4e00\u90e8\u306e\u6f14\u7b97\u5b50\u306b\u3064\u3044\u3066\u306fPostgreSQL\u306eGiST(Generalized Search Tree)\u306e\u4ed5\u7d44\u307f\u3092\u7528\u3044\u3066R\u6728\u306b\u3088\u308b\u9ad8\u901f\u306a\u691c\u7d22\u3082\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 2001\u5e74\u306b\u6700\u521d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u516c\u958b\u3055\u308c\u3066\u4ee5\u964d\u300120\u5e74\u4ee5\u4e0a\u306b\u308f\u305f\u308a\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306b\u3088\u3063\u3066\u6a5f\u80fd\u5f37\u5316\u3084\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u304c\u884c\u308f\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089PostGIS\u306e\u63d0\u4f9b\u3059\u308b\u95a2\u6570\u3084\u6f14\u7b97\u5b50\u306f\u3001\u7dcf\u6570\u3067500\u3092\u8d85\u3048\u308b\u975e\u5e38\u306b\u5927\u898f\u6a21\u306a\u3082\u306e\u3067\u3059\u3002 \u305d\u306e\u305f\u3081\u3001PG-Strom\u3067\u306f\u6bd4\u8f03\u7684\u5229\u7528\u983b\u5ea6\u306e\u9ad8\u3044\u3044\u304f\u3064\u304b\u306ePostGIS\u95a2\u6570\u3060\u3051\u3092GPU\u7528\u306b\u79fb\u690d\u3057\u3066\u3044\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306aPostGIS\u95a2\u6570\u304c\u305d\u308c\u306b\u8a72\u5f53\u3057\u307e\u3059\u3002 geometry st_point(float8 lon,float8 lat) \u7d4c\u5ea6\u7def\u5ea6\u304b\u3089\u3001\u70b9\uff08Point\uff09\u3067\u3042\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u578b\u3092\u751f\u6210\u3059\u308b\u3002 bool st_contains(geometry a,geometry b) \u30b8\u30aa\u30e1\u30c8\u30eaa\u304c\u30b8\u30aa\u30e1\u30c8\u30eab\u304c\u5305\u542b\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u3002 bool st_crosses(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u304c\u4ea4\u5dee\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u3002 text st_relate(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u306e\u95a2\u4fc2\u3092 DE-9IM(Dimensionally Extended 9-Intersection Model) \u306e\u884c\u5217\u8868\u73fe\u3068\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002 \u307e\u305f\u3001\u30c6\u30fc\u30d6\u30eb\u540c\u58eb\u306e\u7d50\u5408\u6761\u4ef6\u304cGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u306e\u5229\u7528\u306b\u9069\u3059\u308b\u5834\u5408\u3001GpuJoin\u306fGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u3092GPU\u5074\u306b\u30ed\u30fc\u30c9\u3057\u3001\u7d50\u5408\u3059\u3079\u304d\u884c\u306e\u7d5e\u308a\u8fbc\u307f\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u3053\u308c\u306f\u4f8b\u3048\u3070\u3001GPS\u304b\u3089\u53d6\u5f97\u3057\u305f\u30e2\u30d0\u30a4\u30eb\u6a5f\u5668\u306e\u4f4d\u7f6e\uff08\u70b9\uff09\u3068\u30a8\u30ea\u30a2\u5b9a\u7fa9\u30c7\u30fc\u30bf\uff08\u30dd\u30ea\u30b4\u30f3\uff09\u3092\u7a81\u304d\u5408\u308f\u305b\u308b\u3068\u3044\u3063\u305f\u51e6\u7406\u306e\u9ad8\u901f\u5316\u306b\u5bc4\u4e0e\u3057\u307e\u3059\u3002","title":"\u6982\u8981"},{"location":"postgis/#postgis","text":"GPU\u7248PostGIS\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u7279\u5225\u306a\u8a2d\u5b9a\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002 PostGIS\u3092\u30d1\u30c3\u30b1\u30fc\u30b8\u53c8\u306f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001 CREATE EXTENSION \u69cb\u6587\u3092\u7528\u3044\u3066\u30b8\u30aa\u30e1\u30c8\u30ea\u30c7\u30fc\u30bf\u578b\u3084PostGIS\u95a2\u6570\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308c\u3070\u3001PG-Strom\u306f\u30af\u30a8\u30ea\u306b\u51fa\u73fe\u3057\u305fPostGIS\u95a2\u6570\u304cGPU\u3067\u5b9f\u884c\u53ef\u80fd\u304b\u3069\u3046\u304b\u3092\u81ea\u52d5\u7684\u306b\u5224\u5b9a\u3057\u307e\u3059\u3002 PostGIS\u81ea\u4f53\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u306f\u3001 PostGIS\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u306b\u306fGPU\u5b9f\u884c\u53ef\u80fd\u306aPostGIS\u95a2\u6570\u3067\u3042\u308b st_contains() \u3068 st_makepoint() \u3092\u4f7f\u7528\u3057\u3066\u304a\u308a\u3001\u30b8\u30aa\u30e1\u30c8\u30ea\u578b\u306e\u5b9a\u6570 'polygon ((10 10,30 10,30 20,10 20,10 10))' \u306e\u7bc4\u56f2\u5185\u306b\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u4e8c\u6b21\u5143\u306e\u70b9\u304c\u542b\u307e\u308c\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u95a2\u6570\u304c GPU Filter: \u306e\u4e00\u90e8\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u4e8b\u304b\u3089\u3082\u5206\u304b\u308b\u3088\u3046\u306b\u3001PG-Strom\u306f\u5bfe\u5fdc\u6e08\u307f\u306ePostGIS\u95a2\u6570\u3092\u81ea\u52d5\u7684\u306b\u691c\u51fa\u3057\u3001\u53ef\u80fd\u306a\u9650\u308aGPU\u3067\u5b9f\u884c\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002 =# explain select * from dpoints where st_contains('polygon ((10 10,30 10,30 20,10 20,10 10))', st_makepoint(x,y)); QUERY PLAN ------------------------------------------------------------------------------------------ Custom Scan (GpuScan) on dpoints (cost=1397205.10..12627630.76 rows=800 width=28) GPU Filter: st_contains('01030000000100000005000000000000000000244000000000000024400000000000003E4000000000000024400000000000003E4000000000000034400000000000002440000000000000344000000000000024400000000000002440'::geometry, st_makepoint(x, y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) (3 rows)","title":"PostGIS\u306e\u5229\u7528"},{"location":"postgis/#gist","text":"st_contains() \u3084 st_crosses() \u306a\u3069\u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u306e\u95a2\u4fc2\u6027\u3092\u8a55\u4fa1\u3059\u308bPostGIS\u95a2\u6570\u306e\u4e00\u90e8\u306f\u3001GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001CPU\u3060\u3051\u3092\u7528\u3044\u3066\u691c\u7d22\u3092\u884c\u3046\u5834\u5408\u306b\u3082\u9ad8\u901f\u306a\u7d5e\u308a\u8fbc\u307f\u3092\u884c\u3046\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 PG-Strom\u306eGpuJoin\u3067\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u540c\u58eb\u306e\u7d50\u5408\u6761\u4ef6\u304cGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u3067\u9ad8\u901f\u5316\u53ef\u80fd\u306a\u5834\u5408\u3001\u7d50\u5408\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u306e\u4e2d\u8eab\u3060\u3051\u3067\u306a\u304f\u3001GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3082\u540c\u6642\u306bGPU\u5074\u3078\u8ee2\u9001\u3057\u3001\u7d50\u5408\u5bfe\u8c61\u306e\u884c\u3092\u9ad8\u901f\u306b\u7d5e\u308a\u8fbc\u3080\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u306e\u51e6\u7406\u306f\u901a\u5e38\u3001CPU\u3088\u308a\u3082\u9065\u304b\u306b\u9ad8\u3044\u4e26\u5217\u5ea6\u3067\u5b9f\u884c\u3055\u308c\u308b\u305f\u3081\u3001\u304b\u306a\u308a\u306e\u9ad8\u901f\u5316\u3092\u671f\u5f85\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4e00\u65b9\u3001GpuScan\u306f\u30c6\u30fc\u30d6\u30eb\u5358\u4f53\u306e\u30b9\u30ad\u30e3\u30f3\u306bGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001CPU\u306b\u3088\u308bIndexScan\u3067\u306e\u7d5e\u308a\u8fbc\u307f\u306e\u65b9\u304c\u9ad8\u901f\u3067\u3042\u308b\u4e8b\u304c\u591a\u3044\u304b\u3089\u3067\u3059\u3002 \u30b8\u30aa\u30e1\u30c8\u30ea\u30c7\u30fc\u30bf\u306bGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u3001 CREATE INDEX \u69cb\u6587\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u5e02\u753a\u6751\u306e\u5883\u754c\u7dda\u30c7\u30fc\u30bf\uff08giscity\u30c6\u30fc\u30d6\u30eb\u306egeom\u5217\uff09\u306b\u5bfe\u3057\u3066GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u3082\u306e\u3067\u3059\u3002 =# CREATE INDEX on giscity USING gist (geom); CREATE INDEX \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u3001\u5e02\u753a\u6751\u306e\u5883\u754c\u7dda\u30c7\u30fc\u30bf\uff08giscity\u30c6\u30fc\u30d6\u30eb\uff09\u3068\u7def\u5ea6\u7d4c\u5ea6\u30c7\u30fc\u30bf\uff08dpoints\u30c6\u30fc\u30d6\u30eb\uff09\u3092\u7a81\u304d\u5408\u308f\u305b\u3001\u30dd\u30ea\u30b4\u30f3\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u305f\u5e02\u753a\u6751\u306e\u9818\u57df\u5185\u306b\u542b\u307e\u308c\u308b\u7def\u5ea6\u7d4c\u5ea6\u30c7\u30fc\u30bf\uff08\u70b9\uff09\u306e\u6570\u3092\u5e02\u753a\u6751\u3054\u3068\u306b\u51fa\u529b\u3059\u308b\u3082\u306e\u3067\u3059\u3002 \u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u3088\u308aGpuJoin\u304c\u9078\u629e\u3055\u308c\u3001giscity\u30c6\u30fc\u30d6\u30eb\u3068dpoints\u30c6\u30fc\u30d6\u30eb\u306e\u7d50\u5408\u306b\u306fGpuGiSTJoin\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u3059\u3002 IndexFilter:\u306e\u884c\u306b\u306f\u3001GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308b\u7d5e\u308a\u8fbc\u307f\u6761\u4ef6\u304c (g.geom ~ st_makepoint(d.x, d.y)) \u3067\u3042\u308a\u3001\u4f7f\u7528\u3059\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c giscity_geom_idx \u3067\u3042\u308b\u4e8b\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u4f7f\u7528\u306b\u3088\u308a\u3001GPU\u3067\u3042\u3063\u3066\u3082\u6bd4\u8f03\u7684\u300c\u91cd\u3044\u300d\u51e6\u7406\u3067\u3042\u308bPostGIS\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u3001\u660e\u3089\u304b\u306b\u6761\u4ef6\u306b\u30de\u30c3\u30c1\u3057\u306a\u3044\u7d44\u307f\u5408\u308f\u305b\u3092\u6392\u9664\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u305f\u3081\u3001\u5927\u5e45\u306a\u691c\u7d22\u51e6\u7406\u306e\u9ad8\u901f\u5316\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 =# EXPLAIN SELECT pref, city, count(*) FROM giscity g, dpoints d WHERE pref = 'Tokyo' AND st_contains(g.geom,st_makepoint(d.x, d.y)) GROUP BY pref, city; QUERY PLAN ----------------------------------------------------------------------------------------------------------- GroupAggregate (cost=5700646.35..5700759.39 rows=5024 width=29) Group Key: g.n03_001, g.n03_004 -> Sort (cost=5700646.35..5700658.91 rows=5024 width=29) Sort Key: g.n03_004 -> Custom Scan (GpuPreAgg) (cost=5700274.71..5700337.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=638671.58..5668511.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (17 rows)","title":"GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9"},{"location":"ref_devfuncs/","text":"\u95a2\u6570\u3068\u6f14\u7b97\u5b50 \u672c\u7ae0\u3067\u306fGPU\u30c7\u30d0\u30a4\u30b9\u4e0a\u3067\u5b9f\u884c\u53ef\u80fd\u306a\u95a2\u6570\u3068\u6f14\u7b97\u5b50\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u578b\u30ad\u30e3\u30b9\u30c8 bool <-- int4 int1 <-- int2 , int4 , int8 , float2 , float4 , float8 , numeric int2 <-- int1 , int4 , int8 , float2 , float4 , float8 , numeric int4 <-- bool , int1 , int2 , int8 , float2 , float4 , float8 , numeric int8 <-- int1 , int2 , int4 , float2 , float4 , float8 , numeric float2 <-- int1 , int2 , int4 , int8 , float4 , float8 , numeric float4 <-- int1 , int2 , int4 , int8 , float2 , float8 , numeric float8 <-- int1 , int2 , int4 , int8 , float2 , float4 , numeric numeric <-- int1 , int2 , int4 , int8 , float2 , float4 , float8 money <-- int4 , int8 , numeric date <-- timestamp , timestamptz time <-- timetz , timestamp , timestamptz timetz <-- time , timestamptz timestamp <-- date , timestamptz timestamptz <-- date , timestamp \u6570\u5024\u578b\u6f14\u7b97\u5b50 bool COMP bool \u8ad6\u7406\u5024\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT COMP INT \u6574\u6570\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6574\u6570\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} FP COMP FP \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 FP \u306f float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} numeric COMP numeric \u5b9f\u6570\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT OP INT \u6574\u6570\u578b\u306e\u7b97\u8853\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6574\u6570\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 OP \u306f +,-,*,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} FP OP FP \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306e\u7b97\u8853\u6f14\u7b97\u5b50\u3002 FP \u306f float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 COMP \u306f +,-,*,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} numeric OP numeric \u5b9f\u6570\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 OP \u306f +,-,*,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT % INT \u5270\u4f59\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT & INT \u8ad6\u7406\u7a4d\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT | INT \u8ad6\u7406\u548c\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT # INT \u6392\u4ed6\u7684\u8ad6\u7406\u548c\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} ~ INT \u8ad6\u7406\u5426\u5b9a\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT >> int4 \u53f3\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT << int4 \u5de6\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} + TYPE \u5358\u9805\u30d7\u30e9\u30b9\u6f14\u7b97\u5b50\u3002 TYPE \u306f int1,int2,int4,int8,float2,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} - TYPE \u5358\u9805\u30de\u30a4\u30ca\u30b9\u6f14\u7b97\u5b50\u3002 TYPE \u306f int1,int2,int4,int8,float2,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} @ TYPE \u7d76\u5bfe\u5024\u3002 TYPE \u306f int1,int2,int4,int8,float2,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} \u6570\u5b66\u95a2\u6570 float8 cbrt(float8) float8 dcbrt(float8) \u7acb\u65b9\u6839 float8 ceil(float8) float8 ceiling(float8) \u5f15\u6570\u3088\u308a\u5927\u304d\u3044\u304b\u7b49\u3057\u304f\u3001\u5f15\u6570\u306b\u6700\u3082\u8fd1\u3044\u6574\u6570 float8 exp(float8) float8 dexp(float8) \u6307\u6570\uff08e\u3092\u5e95\u3068\u3059\u308b\u6307\u5b9a\u306e\u3079\u304d\u4e57\uff09 float8 floor(float8) \u5f15\u6570\u3088\u308a\u5c0f\u3055\u3044\u304b\u7b49\u3057\u304f\u3001\u5f15\u6570\u306b\u6700\u3082\u8fd1\u3044\u6574\u6570 float8 ln(float8) float8 dlog1(float8) \u81ea\u7136\u5bfe\u6570 float8 log(float8) float8 dlog10(float8) 10\u3092\u5e95\u3068\u3057\u305f\u5bfe\u6570 float8 pi() \u5186\u5468\u7387 float8 power(float8,float8) float8 pow(float8,float8) float8 dpow(float8,float8) \u3079\u304d\u4e57 float8 round(float8) float8 dround(float8) \u6700\u3082\u8fd1\u3044\u6574\u6570\u3078\u306e\u4e38\u3081 float8 sign(float8) \u7b26\u53f7 float8 sqrt(float8) float8 dsqrt(float8) \u5e73\u65b9\u6839 float8 trunc(float8) float8 dtrunc(float8) \u6574\u6570\u3078\u306e\u5207\u6368\u3066 \u4e09\u89d2\u95a2\u6570 float8 degrees(float8) \u30e9\u30b8\u30a2\u30f3\u306b\u5bfe\u5fdc\u3059\u308b\u5ea6} float8 radians(float8) \u5ea6\u306b\u5bfe\u5fdc\u3059\u308b\u30e9\u30b8\u30a2\u30f3} float8 acos(float8) \u9006\u4f59\u5f26\u95a2\u6570} float8 asin(float8) \u9006\u6b63\u5f26\u95a2\u6570} float8 atan(float8) \u9006\u6b63\u63a5\u95a2\u6570} float8 atan2(float8,float8) arg1 / arg2 \u306e\u9006\u6b63\u63a5\u95a2\u6570} float8 cos(float8) \u4f59\u5f26\u95a2\u6570} float8 cot(float8) \u4f59\u63a5\u95a2\u6570} float8 sin(float8) \u6b63\u5f26\u95a2\u6570} float8 tan(float8) \u6b63\u63a5\u95a2\u6570} \u65e5\u4ed8/\u6642\u523b\u578b\u6f14\u7b97\u5b50 date COMP date date \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} date COMP timestamp timestamp COMP date date \u578b\u3068 timestamp \u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} date COMP timestamptz timestamptz COMP date date \u578b\u3068 timestamptz \u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} time COMP time time \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timetz COMP timetz timetz \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timestamp COMP timestamp timestamp \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timestamptz COMP timestamptz timestamptz \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timestamp COMP timestamptz timestamptz COMP timestamp timestamp \u578b\u3068 timestamptz \u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} interval COMP interval interval \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} date + int4 int4 + date date \u578b\u306e\u52a0\u7b97\u6f14\u7b97\u5b50} date - int4 date \u578b\u306e\u6e1b\u7b97\u6f14\u7b97\u5b50} date - date date \u578b\u540c\u58eb\u306e\u5dee\u5206} date + time time + date date \u3068 time \u304b\u3089 timestamp \u3092\u751f\u6210\u3057\u307e\u3059} date + timetz date \u3068 timetz \u304b\u3089 timestamptz \u3092\u751f\u6210\u3057\u307e\u3059} time - time time \u578b\u540c\u58eb\u306e\u5dee\u5206} timestamp - timestamp timestamp \u578b\u540c\u58eb\u306e\u5dee\u5206} timetz + interval timetz - interval timetz \u3068 interval \u3092\u52a0\u7b97\u3001\u307e\u305f\u306f\u6e1b\u7b97\u3057\u307e\u3059\u3002} timestamptz + interval timestamptz - interval timestamptz \u3068 interval \u3092\u52a0\u7b97\u3001\u307e\u305f\u306f\u6e1b\u7b97\u3057\u307e\u3059\u3002} overlaps(TYPE,TYPE,TYPE,TYPE) 2\u3064\u306e\u6642\u9593\u9593\u9694\u304c\u91cd\u306a\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002 TYPE \u306f time,timetz,timestamp,timestamptz \u306e\u3044\u305a\u308c\u304b\u4e00\u3064\u3067\u3059\u3002} extract(text FROM TYPE) day \u3084 hour \u306a\u3069\u65e5\u4ed8\u6642\u523b\u578b\u306e\u90e8\u5206\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u62bd\u51fa\u3002 TYPE \u306f time,timetz,timestamp,timestamptz,interval \u306e\u3044\u305a\u308c\u304b\u4e00\u3064\u3067\u3059\u3002} now() \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u73fe\u5728\u6642\u523b} - interval interval \u578b\u306e\u5358\u9805\u30de\u30a4\u30ca\u30b9\u6f14\u7b97\u5b50} interval + interval interval \u578b\u306e\u52a0\u7b97\u6f14\u7b97\u5b50} interval - interval interval \u578b\u306e\u6e1b\u7b97\u6f14\u7b97\u5b50} \u6587\u5b57\u5217\u95a2\u6570/\u6f14\u7b97\u5b50 {text,bpchar} COMP {text,bpchar} \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002 \u306a\u304a\u3001 <,<=,>=,> \u6f14\u7b97\u5b50\u306f\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u304cUTF-8\u307e\u305f\u306fC(\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u306a\u3057)\u306e\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u3067\u3059\u3002} substring(text,int4) substring(text,int4,int4) substr(text,int4) substr(text,int4,int4) \u90e8\u5206\u6587\u5b57\u5217\u306e\u5207\u308a\u51fa\u3057} length({text,bpchar}) \u6587\u5b57\u5217\u9577} {text,bpchar} [NOT] LIKE text LIKE\u8868\u73fe\u3092\u7528\u3044\u305f\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0} {text,bpchar} [NOT] ILIKE text LIKE\u8868\u73fe\u3092\u7528\u3044\u305f\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3002 \u306a\u304a\u3001 ILIKE \u6f14\u7b97\u5b50\u306f\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u304cUTF-8\u307e\u305f\u306fC(\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u306a\u3057)\u306e\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u3067\u3059\u3002} \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u95a2\u6570/\u6f14\u7b97\u5b50 macaddr COMP macaddr \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} macaddr & macaddr \u30d3\u30c3\u30c8\u7a4d\u6f14\u7b97\u5b50} macaddr | macaddr \u30d3\u30c3\u30c8\u548c\u6f14\u7b97\u5b50} ~ macaddr \u30d3\u30c3\u30c8\u5426\u5b9a\u6f14\u7b97\u5b50} trunc(macaddr) \u672b\u5c3e\u306e3\u30d0\u30a4\u30c8\u3092\u30bc\u30ed\u306b\u8a2d\u5b9a\u3059\u308b} inet COMP inet \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} inet << inet \u5de6\u8fba\u306f\u53f3\u8fba\u306b\u5185\u5305\u3055\u308c\u308b\u3002} inet <<= inet \u5de6\u8fba\u306f\u53f3\u8fba\u306b\u5185\u5305\u3055\u308c\u308b\u304b\u7b49\u3057\u3044\u3002} inet >> inet \u5de6\u8fba\u306f\u53f3\u8fba\u3092\u5185\u5305\u3059\u308b\u3002} inet >>= inet \u5de6\u8fba\u306f\u53f3\u8fba\u3092\u5185\u5305\u3059\u308b\u304b\u7b49\u3057\u3044\u3002} inet && inet \u5de6\u8fba\u306f\u53f3\u8fba\u3092\u5185\u5305\u3059\u308b\u304b\u5185\u5305\u3055\u308c\u308b} ~ inet \u30d3\u30c3\u30c8\u5426\u5b9a\u6f14\u7b97\u5b50} inet & inet \u30d3\u30c3\u30c8\u7a4d\u6f14\u7b97\u5b50} inet | inet \u30d3\u30c3\u30c8\u548c\u6f14\u7b97\u5b50} inet + int8 \u52a0\u7b97\u6f14\u7b97\u5b50} inet - int8 \u6e1b\u7b97\u6f14\u7b97\u5b50} inet - inet \u6e1b\u7b97\u6f14\u7b97\u5b50} broadcast(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8\u30a2\u30c9\u30ec\u30b9\u3092\u8fd4\u3059} family(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30a2\u30c9\u30ec\u30b9\u30d5\u30a1\u30df\u30ea\u3092\u8fd4\u3059\u3002IPv4\u306e\u5834\u5408\u306f 4 \u3001IPv6\u306e\u5834\u5408\u306f 6 } hostmask(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30db\u30b9\u30c8\u30de\u30b9\u30af\u3092\u8fd4\u3059} masklen(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30de\u30b9\u30af\u9577\u3092\u8fd4\u3059} netmask(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30cd\u30c3\u30c8\u30de\u30b9\u30af\u3092\u8fd4\u3059} network(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u90e8\u3092\u8fd4\u3059} set_masklen(NETADDR,int) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30cd\u30c3\u30c8\u30de\u30b9\u30af\u9577\u3092\u8a2d\u5b9a\u3059\u308b\u3002 NETADDR \u306f inet \u304b cidr \u306e\u3069\u3061\u3089\u304b\u3002} inet_merge(inet,inet) \u4e21\u65b9\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u542b\u3080\u6700\u5c0f\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u8fd4\u3059} \u901a\u8ca8\u578b\u6f14\u7b97\u5b50 money COMP money \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money OP money \u7b97\u8853\u6f14\u7b97\u5b50\u3002 OP \u306f +,-,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money * TYPE TYPE * money \u901a\u8ca8\u578b\u3068\u6570\u5024\u578b\u306e\u4e57\u7b97\u3002 TYPE \u306f int1,int2,int4,float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money / TYPE \u901a\u8ca8\u578b\u306e\u6570\u5024\u578b\u306b\u3088\u308b\u9664\u7b97\u3002 TYPE \u306f int1,int2,int4,float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money / money \u901a\u8ca8\u578b\u540c\u58eb\u306e\u9664\u7b97\u3002} uuid\u578b\u6f14\u7b97\u5b50 uuid COMP uuid \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} JSONB\u578b\u6f14\u7b97\u5b50 jsonb -> KEY KEY \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53d6\u5f97\u3059\u308b} jsonb -> NUM \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7 NUM \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53d6\u5f97\u3059\u308b} jsonb ->> KEY KEY \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30c6\u30ad\u30b9\u30c8\u5024\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b} jsonb ->> NUM \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7 NUM \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30c6\u30ad\u30b9\u30c8\u5024\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b} (jsonb ->> KEY)::TYPE TYPE \u304c int2,int4,int8,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3042\u308b\u5834\u5408\u3001 KEY \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6570\u5024\u578b\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b\u3002\u4e0b\u8a18\u306e\u88dc\u8db3\u3082\u53c2\u7167\u3002} (jsonb ->> NUM)::TYPE TYPE \u304c int2,int4,int8,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3042\u308b\u5834\u5408\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7 NUM \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6570\u5024\u578b\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b\u3002\u4e0b\u8a18\u306e\u88dc\u8db3\u3082\u53c2\u7167\u3002} jsonb ? KEY jsonb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u6307\u5b9a\u3055\u308c\u305f KEY \u3092\u542b\u3080\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b} Note jsonb ->> KEY \u6f14\u7b97\u5b50\u306b\u3088\u3063\u3066\u53d6\u308a\u51fa\u3057\u305f\u6570\u5024\u30c7\u30fc\u30bf\u3092 float \u3084 numeric \u306a\u3069\u6570\u5024\u578b\u306b\u5909\u63db\u3059\u308b\u6642\u3001\u901a\u5e38\u3001PostgreSQL\u306fjsonb\u5185\u90e8\u8868\u73fe\u3092\u30c6\u30ad\u30b9\u30c8\u3068\u3057\u3066\u51fa\u529b\u3057\u3001\u305d\u308c\u3092\u6570\u5024\u8868\u73fe\u306b\u5909\u63db\u3059\u308b\u3068\u3044\u30462\u30b9\u30c6\u30c3\u30d7\u306e\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002 PG-Strom\u306f jsonb ->> KEY \u6f14\u7b97\u5b50\u306b\u3088\u308b\u53c2\u7167\u3068\u30c6\u30ad\u30b9\u30c8\u21d2\u6570\u5024\u8868\u73fe\u3078\u306e\u30ad\u30e3\u30b9\u30c8\u304c\u9023\u7d9a\u3057\u3066\u3044\u308b\u6642\u3001jsonb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089\u6570\u5024\u8868\u73fe\u3092\u53d6\u308a\u51fa\u3059\u305f\u3081\u306e\u7279\u5225\u306a\u30c7\u30d0\u30a4\u30b9\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u3067\u6700\u9069\u5316\u3092\u884c\u3044\u307e\u3059\u3002 PostGIS\u95a2\u6570 geometry st_makepoint(float8,float8) geometry st_point(float8,float8) 2\u6b21\u5143\u5ea7\u6a19\u3092\u542b\u3080POINT\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8fd4\u3059 geometry st_makepoint(float8,float8,float8) 3\u6b21\u5143\u5ea7\u6a19\u3092\u542b\u3080POINT\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8fd4\u3059 geometry st_makepoint(float8,float8,float8,float8) ZM\u5ea7\u6a19\u3092\u542b\u3080POINT\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8fd4\u3059 geometry st_setsrid(geometry,int4) \u30b8\u30aa\u30e1\u30c8\u30ea\u306bSRID\u3092\u8a2d\u5b9a\u3059\u308b float8 st_distance(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u8ddd\u96e2\u3092 float8 \u3067\u8fd4\u3059 bool st_dwithin(geometry,geometry,float8) \u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u8ddd\u96e2\u304c\u6307\u5b9a\u5024\u4ee5\u5185\u306a\u3089\u771f\u3092\u8fd4\u3059\u3002 st_distance \u3068\u6bd4\u8f03\u6f14\u7b97\u5b50\u306e\u7d44\u307f\u5408\u308f\u305b\u3088\u308a\u3082\u9ad8\u901f\u306a\u5834\u5408\u304c\u3042\u308b\u3002 text st_relate(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u4ea4\u5dee\u72b6\u614b\u3092\u5224\u5b9a\u3057\u3001DE9-IM(Dimensionally Extended Nine-Intersection Matrix)\u66f8\u5f0f\u3092\u8fd4\u3059\u3002 bool st_contains(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea1\u304c\u30b8\u30aa\u30e1\u30c8\u30ea2\u3092\u5305\u542b\u3059\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 bool st_crosses(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u304c\u7a7a\u9593\u7684\u306b\u4ea4\u5dee\u3059\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 int4 st_linecrossingdirection(geometry,geometry) 2\u3064\u306eLINESTRING\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u304c\u3069\u306e\u3088\u3046\u306b\u4ea4\u5dee\u3059\u308b\u304b\uff08\u3057\u306a\u3044\u304b\uff09\u3092\u8fd4\u3059\u3002 CUBE\u578b\u95a2\u6570 cube COMP cube \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} bool cube_contains(cube, cube) \u7b2c\u4e00\u5f15\u6570\u306e\u7acb\u4f53\u304c\u7b2c\u4e8c\u5f15\u6570\u306e\u7acb\u4f53\u3092\u5305\u542b\u3057\u3066\u3044\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 bool cube_contained(cube, cube) \u7b2c\u4e00\u5f15\u6570\u306e\u7acb\u4f53\u304c\u7b2c\u4e8c\u5f15\u6570\u306e\u7acb\u4f53\u306b\u5305\u542b\u3055\u308c\u3066\u3044\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 float8 cube_ll_coord(cube, int4) \u7acb\u4f53\u306e\u5de6\u4e0b\u9685\u306en\u6b21\u5ea7\u6a19\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002","title":"\u95a2\u6570\u3068\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#_1","text":"\u672c\u7ae0\u3067\u306fGPU\u30c7\u30d0\u30a4\u30b9\u4e0a\u3067\u5b9f\u884c\u53ef\u80fd\u306a\u95a2\u6570\u3068\u6f14\u7b97\u5b50\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"\u95a2\u6570\u3068\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#_2","text":"bool <-- int4 int1 <-- int2 , int4 , int8 , float2 , float4 , float8 , numeric int2 <-- int1 , int4 , int8 , float2 , float4 , float8 , numeric int4 <-- bool , int1 , int2 , int8 , float2 , float4 , float8 , numeric int8 <-- int1 , int2 , int4 , float2 , float4 , float8 , numeric float2 <-- int1 , int2 , int4 , int8 , float4 , float8 , numeric float4 <-- int1 , int2 , int4 , int8 , float2 , float8 , numeric float8 <-- int1 , int2 , int4 , int8 , float2 , float4 , numeric numeric <-- int1 , int2 , int4 , int8 , float2 , float4 , float8 money <-- int4 , int8 , numeric date <-- timestamp , timestamptz time <-- timetz , timestamp , timestamptz timetz <-- time , timestamptz timestamp <-- date , timestamptz timestamptz <-- date , timestamp","title":"\u578b\u30ad\u30e3\u30b9\u30c8"},{"location":"ref_devfuncs/#_3","text":"bool COMP bool \u8ad6\u7406\u5024\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT COMP INT \u6574\u6570\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6574\u6570\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} FP COMP FP \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 FP \u306f float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} numeric COMP numeric \u5b9f\u6570\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT OP INT \u6574\u6570\u578b\u306e\u7b97\u8853\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6574\u6570\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 OP \u306f +,-,*,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} FP OP FP \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306e\u7b97\u8853\u6f14\u7b97\u5b50\u3002 FP \u306f float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 COMP \u306f +,-,*,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} numeric OP numeric \u5b9f\u6570\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 OP \u306f +,-,*,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT % INT \u5270\u4f59\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT & INT \u8ad6\u7406\u7a4d\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT | INT \u8ad6\u7406\u548c\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT # INT \u6392\u4ed6\u7684\u8ad6\u7406\u548c\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} ~ INT \u8ad6\u7406\u5426\u5b9a\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT >> int4 \u53f3\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT << int4 \u5de6\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} + TYPE \u5358\u9805\u30d7\u30e9\u30b9\u6f14\u7b97\u5b50\u3002 TYPE \u306f int1,int2,int4,int8,float2,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} - TYPE \u5358\u9805\u30de\u30a4\u30ca\u30b9\u6f14\u7b97\u5b50\u3002 TYPE \u306f int1,int2,int4,int8,float2,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} @ TYPE \u7d76\u5bfe\u5024\u3002 TYPE \u306f int1,int2,int4,int8,float2,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002}","title":"\u6570\u5024\u578b\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#_4","text":"float8 cbrt(float8) float8 dcbrt(float8) \u7acb\u65b9\u6839 float8 ceil(float8) float8 ceiling(float8) \u5f15\u6570\u3088\u308a\u5927\u304d\u3044\u304b\u7b49\u3057\u304f\u3001\u5f15\u6570\u306b\u6700\u3082\u8fd1\u3044\u6574\u6570 float8 exp(float8) float8 dexp(float8) \u6307\u6570\uff08e\u3092\u5e95\u3068\u3059\u308b\u6307\u5b9a\u306e\u3079\u304d\u4e57\uff09 float8 floor(float8) \u5f15\u6570\u3088\u308a\u5c0f\u3055\u3044\u304b\u7b49\u3057\u304f\u3001\u5f15\u6570\u306b\u6700\u3082\u8fd1\u3044\u6574\u6570 float8 ln(float8) float8 dlog1(float8) \u81ea\u7136\u5bfe\u6570 float8 log(float8) float8 dlog10(float8) 10\u3092\u5e95\u3068\u3057\u305f\u5bfe\u6570 float8 pi() \u5186\u5468\u7387 float8 power(float8,float8) float8 pow(float8,float8) float8 dpow(float8,float8) \u3079\u304d\u4e57 float8 round(float8) float8 dround(float8) \u6700\u3082\u8fd1\u3044\u6574\u6570\u3078\u306e\u4e38\u3081 float8 sign(float8) \u7b26\u53f7 float8 sqrt(float8) float8 dsqrt(float8) \u5e73\u65b9\u6839 float8 trunc(float8) float8 dtrunc(float8) \u6574\u6570\u3078\u306e\u5207\u6368\u3066","title":"\u6570\u5b66\u95a2\u6570"},{"location":"ref_devfuncs/#_5","text":"float8 degrees(float8) \u30e9\u30b8\u30a2\u30f3\u306b\u5bfe\u5fdc\u3059\u308b\u5ea6} float8 radians(float8) \u5ea6\u306b\u5bfe\u5fdc\u3059\u308b\u30e9\u30b8\u30a2\u30f3} float8 acos(float8) \u9006\u4f59\u5f26\u95a2\u6570} float8 asin(float8) \u9006\u6b63\u5f26\u95a2\u6570} float8 atan(float8) \u9006\u6b63\u63a5\u95a2\u6570} float8 atan2(float8,float8) arg1 / arg2 \u306e\u9006\u6b63\u63a5\u95a2\u6570} float8 cos(float8) \u4f59\u5f26\u95a2\u6570} float8 cot(float8) \u4f59\u63a5\u95a2\u6570} float8 sin(float8) \u6b63\u5f26\u95a2\u6570} float8 tan(float8) \u6b63\u63a5\u95a2\u6570}","title":"\u4e09\u89d2\u95a2\u6570"},{"location":"ref_devfuncs/#_6","text":"date COMP date date \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} date COMP timestamp timestamp COMP date date \u578b\u3068 timestamp \u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} date COMP timestamptz timestamptz COMP date date \u578b\u3068 timestamptz \u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} time COMP time time \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timetz COMP timetz timetz \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timestamp COMP timestamp timestamp \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timestamptz COMP timestamptz timestamptz \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timestamp COMP timestamptz timestamptz COMP timestamp timestamp \u578b\u3068 timestamptz \u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} interval COMP interval interval \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} date + int4 int4 + date date \u578b\u306e\u52a0\u7b97\u6f14\u7b97\u5b50} date - int4 date \u578b\u306e\u6e1b\u7b97\u6f14\u7b97\u5b50} date - date date \u578b\u540c\u58eb\u306e\u5dee\u5206} date + time time + date date \u3068 time \u304b\u3089 timestamp \u3092\u751f\u6210\u3057\u307e\u3059} date + timetz date \u3068 timetz \u304b\u3089 timestamptz \u3092\u751f\u6210\u3057\u307e\u3059} time - time time \u578b\u540c\u58eb\u306e\u5dee\u5206} timestamp - timestamp timestamp \u578b\u540c\u58eb\u306e\u5dee\u5206} timetz + interval timetz - interval timetz \u3068 interval \u3092\u52a0\u7b97\u3001\u307e\u305f\u306f\u6e1b\u7b97\u3057\u307e\u3059\u3002} timestamptz + interval timestamptz - interval timestamptz \u3068 interval \u3092\u52a0\u7b97\u3001\u307e\u305f\u306f\u6e1b\u7b97\u3057\u307e\u3059\u3002} overlaps(TYPE,TYPE,TYPE,TYPE) 2\u3064\u306e\u6642\u9593\u9593\u9694\u304c\u91cd\u306a\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002 TYPE \u306f time,timetz,timestamp,timestamptz \u306e\u3044\u305a\u308c\u304b\u4e00\u3064\u3067\u3059\u3002} extract(text FROM TYPE) day \u3084 hour \u306a\u3069\u65e5\u4ed8\u6642\u523b\u578b\u306e\u90e8\u5206\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u62bd\u51fa\u3002 TYPE \u306f time,timetz,timestamp,timestamptz,interval \u306e\u3044\u305a\u308c\u304b\u4e00\u3064\u3067\u3059\u3002} now() \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u73fe\u5728\u6642\u523b} - interval interval \u578b\u306e\u5358\u9805\u30de\u30a4\u30ca\u30b9\u6f14\u7b97\u5b50} interval + interval interval \u578b\u306e\u52a0\u7b97\u6f14\u7b97\u5b50} interval - interval interval \u578b\u306e\u6e1b\u7b97\u6f14\u7b97\u5b50}","title":"\u65e5\u4ed8/\u6642\u523b\u578b\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#_7","text":"{text,bpchar} COMP {text,bpchar} \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002 \u306a\u304a\u3001 <,<=,>=,> \u6f14\u7b97\u5b50\u306f\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u304cUTF-8\u307e\u305f\u306fC(\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u306a\u3057)\u306e\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u3067\u3059\u3002} substring(text,int4) substring(text,int4,int4) substr(text,int4) substr(text,int4,int4) \u90e8\u5206\u6587\u5b57\u5217\u306e\u5207\u308a\u51fa\u3057} length({text,bpchar}) \u6587\u5b57\u5217\u9577} {text,bpchar} [NOT] LIKE text LIKE\u8868\u73fe\u3092\u7528\u3044\u305f\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0} {text,bpchar} [NOT] ILIKE text LIKE\u8868\u73fe\u3092\u7528\u3044\u305f\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3002 \u306a\u304a\u3001 ILIKE \u6f14\u7b97\u5b50\u306f\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u304cUTF-8\u307e\u305f\u306fC(\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u306a\u3057)\u306e\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u3067\u3059\u3002}","title":"\u6587\u5b57\u5217\u95a2\u6570/\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#_8","text":"macaddr COMP macaddr \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} macaddr & macaddr \u30d3\u30c3\u30c8\u7a4d\u6f14\u7b97\u5b50} macaddr | macaddr \u30d3\u30c3\u30c8\u548c\u6f14\u7b97\u5b50} ~ macaddr \u30d3\u30c3\u30c8\u5426\u5b9a\u6f14\u7b97\u5b50} trunc(macaddr) \u672b\u5c3e\u306e3\u30d0\u30a4\u30c8\u3092\u30bc\u30ed\u306b\u8a2d\u5b9a\u3059\u308b} inet COMP inet \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} inet << inet \u5de6\u8fba\u306f\u53f3\u8fba\u306b\u5185\u5305\u3055\u308c\u308b\u3002} inet <<= inet \u5de6\u8fba\u306f\u53f3\u8fba\u306b\u5185\u5305\u3055\u308c\u308b\u304b\u7b49\u3057\u3044\u3002} inet >> inet \u5de6\u8fba\u306f\u53f3\u8fba\u3092\u5185\u5305\u3059\u308b\u3002} inet >>= inet \u5de6\u8fba\u306f\u53f3\u8fba\u3092\u5185\u5305\u3059\u308b\u304b\u7b49\u3057\u3044\u3002} inet && inet \u5de6\u8fba\u306f\u53f3\u8fba\u3092\u5185\u5305\u3059\u308b\u304b\u5185\u5305\u3055\u308c\u308b} ~ inet \u30d3\u30c3\u30c8\u5426\u5b9a\u6f14\u7b97\u5b50} inet & inet \u30d3\u30c3\u30c8\u7a4d\u6f14\u7b97\u5b50} inet | inet \u30d3\u30c3\u30c8\u548c\u6f14\u7b97\u5b50} inet + int8 \u52a0\u7b97\u6f14\u7b97\u5b50} inet - int8 \u6e1b\u7b97\u6f14\u7b97\u5b50} inet - inet \u6e1b\u7b97\u6f14\u7b97\u5b50} broadcast(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8\u30a2\u30c9\u30ec\u30b9\u3092\u8fd4\u3059} family(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30a2\u30c9\u30ec\u30b9\u30d5\u30a1\u30df\u30ea\u3092\u8fd4\u3059\u3002IPv4\u306e\u5834\u5408\u306f 4 \u3001IPv6\u306e\u5834\u5408\u306f 6 } hostmask(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30db\u30b9\u30c8\u30de\u30b9\u30af\u3092\u8fd4\u3059} masklen(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30de\u30b9\u30af\u9577\u3092\u8fd4\u3059} netmask(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30cd\u30c3\u30c8\u30de\u30b9\u30af\u3092\u8fd4\u3059} network(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u90e8\u3092\u8fd4\u3059} set_masklen(NETADDR,int) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30cd\u30c3\u30c8\u30de\u30b9\u30af\u9577\u3092\u8a2d\u5b9a\u3059\u308b\u3002 NETADDR \u306f inet \u304b cidr \u306e\u3069\u3061\u3089\u304b\u3002} inet_merge(inet,inet) \u4e21\u65b9\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u542b\u3080\u6700\u5c0f\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u8fd4\u3059}","title":"\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u95a2\u6570/\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#_9","text":"money COMP money \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money OP money \u7b97\u8853\u6f14\u7b97\u5b50\u3002 OP \u306f +,-,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money * TYPE TYPE * money \u901a\u8ca8\u578b\u3068\u6570\u5024\u578b\u306e\u4e57\u7b97\u3002 TYPE \u306f int1,int2,int4,float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money / TYPE \u901a\u8ca8\u578b\u306e\u6570\u5024\u578b\u306b\u3088\u308b\u9664\u7b97\u3002 TYPE \u306f int1,int2,int4,float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money / money \u901a\u8ca8\u578b\u540c\u58eb\u306e\u9664\u7b97\u3002}","title":"\u901a\u8ca8\u578b\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#uuid","text":"uuid COMP uuid \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002}","title":"uuid\u578b\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#jsonb","text":"jsonb -> KEY KEY \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53d6\u5f97\u3059\u308b} jsonb -> NUM \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7 NUM \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53d6\u5f97\u3059\u308b} jsonb ->> KEY KEY \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30c6\u30ad\u30b9\u30c8\u5024\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b} jsonb ->> NUM \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7 NUM \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30c6\u30ad\u30b9\u30c8\u5024\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b} (jsonb ->> KEY)::TYPE TYPE \u304c int2,int4,int8,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3042\u308b\u5834\u5408\u3001 KEY \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6570\u5024\u578b\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b\u3002\u4e0b\u8a18\u306e\u88dc\u8db3\u3082\u53c2\u7167\u3002} (jsonb ->> NUM)::TYPE TYPE \u304c int2,int4,int8,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3042\u308b\u5834\u5408\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7 NUM \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6570\u5024\u578b\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b\u3002\u4e0b\u8a18\u306e\u88dc\u8db3\u3082\u53c2\u7167\u3002} jsonb ? KEY jsonb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u6307\u5b9a\u3055\u308c\u305f KEY \u3092\u542b\u3080\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b} Note jsonb ->> KEY \u6f14\u7b97\u5b50\u306b\u3088\u3063\u3066\u53d6\u308a\u51fa\u3057\u305f\u6570\u5024\u30c7\u30fc\u30bf\u3092 float \u3084 numeric \u306a\u3069\u6570\u5024\u578b\u306b\u5909\u63db\u3059\u308b\u6642\u3001\u901a\u5e38\u3001PostgreSQL\u306fjsonb\u5185\u90e8\u8868\u73fe\u3092\u30c6\u30ad\u30b9\u30c8\u3068\u3057\u3066\u51fa\u529b\u3057\u3001\u305d\u308c\u3092\u6570\u5024\u8868\u73fe\u306b\u5909\u63db\u3059\u308b\u3068\u3044\u30462\u30b9\u30c6\u30c3\u30d7\u306e\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002 PG-Strom\u306f jsonb ->> KEY \u6f14\u7b97\u5b50\u306b\u3088\u308b\u53c2\u7167\u3068\u30c6\u30ad\u30b9\u30c8\u21d2\u6570\u5024\u8868\u73fe\u3078\u306e\u30ad\u30e3\u30b9\u30c8\u304c\u9023\u7d9a\u3057\u3066\u3044\u308b\u6642\u3001jsonb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089\u6570\u5024\u8868\u73fe\u3092\u53d6\u308a\u51fa\u3059\u305f\u3081\u306e\u7279\u5225\u306a\u30c7\u30d0\u30a4\u30b9\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u3067\u6700\u9069\u5316\u3092\u884c\u3044\u307e\u3059\u3002","title":"JSONB\u578b\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#postgis","text":"geometry st_makepoint(float8,float8) geometry st_point(float8,float8) 2\u6b21\u5143\u5ea7\u6a19\u3092\u542b\u3080POINT\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8fd4\u3059 geometry st_makepoint(float8,float8,float8) 3\u6b21\u5143\u5ea7\u6a19\u3092\u542b\u3080POINT\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8fd4\u3059 geometry st_makepoint(float8,float8,float8,float8) ZM\u5ea7\u6a19\u3092\u542b\u3080POINT\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8fd4\u3059 geometry st_setsrid(geometry,int4) \u30b8\u30aa\u30e1\u30c8\u30ea\u306bSRID\u3092\u8a2d\u5b9a\u3059\u308b float8 st_distance(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u8ddd\u96e2\u3092 float8 \u3067\u8fd4\u3059 bool st_dwithin(geometry,geometry,float8) \u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u8ddd\u96e2\u304c\u6307\u5b9a\u5024\u4ee5\u5185\u306a\u3089\u771f\u3092\u8fd4\u3059\u3002 st_distance \u3068\u6bd4\u8f03\u6f14\u7b97\u5b50\u306e\u7d44\u307f\u5408\u308f\u305b\u3088\u308a\u3082\u9ad8\u901f\u306a\u5834\u5408\u304c\u3042\u308b\u3002 text st_relate(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u4ea4\u5dee\u72b6\u614b\u3092\u5224\u5b9a\u3057\u3001DE9-IM(Dimensionally Extended Nine-Intersection Matrix)\u66f8\u5f0f\u3092\u8fd4\u3059\u3002 bool st_contains(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea1\u304c\u30b8\u30aa\u30e1\u30c8\u30ea2\u3092\u5305\u542b\u3059\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 bool st_crosses(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u304c\u7a7a\u9593\u7684\u306b\u4ea4\u5dee\u3059\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 int4 st_linecrossingdirection(geometry,geometry) 2\u3064\u306eLINESTRING\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u304c\u3069\u306e\u3088\u3046\u306b\u4ea4\u5dee\u3059\u308b\u304b\uff08\u3057\u306a\u3044\u304b\uff09\u3092\u8fd4\u3059\u3002","title":"PostGIS\u95a2\u6570"},{"location":"ref_devfuncs/#cube","text":"cube COMP cube \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} bool cube_contains(cube, cube) \u7b2c\u4e00\u5f15\u6570\u306e\u7acb\u4f53\u304c\u7b2c\u4e8c\u5f15\u6570\u306e\u7acb\u4f53\u3092\u5305\u542b\u3057\u3066\u3044\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 bool cube_contained(cube, cube) \u7b2c\u4e00\u5f15\u6570\u306e\u7acb\u4f53\u304c\u7b2c\u4e8c\u5f15\u6570\u306e\u7acb\u4f53\u306b\u5305\u542b\u3055\u308c\u3066\u3044\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 float8 cube_ll_coord(cube, int4) \u7acb\u4f53\u306e\u5de6\u4e0b\u9685\u306en\u6b21\u5ea7\u6a19\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002","title":"CUBE\u578b\u95a2\u6570"},{"location":"ref_params/","text":"GUC\u30d1\u30e9\u30e1\u30fc\u30bf \u672c\u7bc0\u3067\u306fPG-Strom\u306e\u63d0\u4f9b\u3059\u308b\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u6a5f\u80fd\u5358\u4f4d\u306e\u6709\u52b9\u5316/\u7121\u52b9\u5316 pg_strom.enabled [\u578b: bool / \u521d\u671f\u5024: on] PG-Strom\u6a5f\u80fd\u5168\u4f53\u3092\u4e00\u62ec\u3057\u3066\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpuscan [\u578b: bool / \u521d\u671f\u5024: on] GpuScan\u306b\u3088\u308b\u30b9\u30ad\u30e3\u30f3\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpuhashjoin [\u578b: bool / \u521d\u671f\u5024: on] GpuHashJoin\u306b\u3088\u308bJOIN\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpugistindex [\u578b: bool / \u521d\u671f\u5024: on] GpuGiSTIndex\u306b\u3088\u308bJOIN\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpujoin [\u578b: bool / \u521d\u671f\u5024: on] GpuJoin\u306b\u3088\u308bJOIN\u3092\u4e00\u62ec\u3067\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002\uff08GpuHashJoin\u3068GpuGiSTIndex\u3092\u542b\u3080\uff09 pg_strom.enable_gpupreagg [\u578b: bool / \u521d\u671f\u5024: on] GpuPreAgg\u306b\u3088\u308b\u96c6\u7d04\u51e6\u7406\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_numeric_aggfuncs [\u578b: bool / \u521d\u671f\u5024: on] numeric \u30c7\u30fc\u30bf\u578b\u3092\u5f15\u6570\u306b\u53d6\u308b\u96c6\u7d04\u6f14\u7b97\u3092GPU\u3067\u51e6\u7406\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 GPU\u3067\u306e\u96c6\u7d04\u6f14\u7b97\u306b\u304a\u3044\u3066 numeric \u30c7\u30fc\u30bf\u578b\u306f\u500d\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3055\u308c\u308b\u305f\u3081\u3001\u8a08\u7b97\u8aa4\u5dee\u306b\u30bb\u30f3\u30b7\u30c6\u30a3\u30d6\u306a\u7528\u9014\u306e\u5834\u5408\u306f\u3001\u3053\u306e\u8a2d\u5b9a\u5024\u3092 off \u306b\u3057\u3066CPU\u3067\u96c6\u7d04\u6f14\u7b97\u3092\u5b9f\u884c\u3057\u3001\u8a08\u7b97\u8aa4\u5dee\u306e\u767a\u751f\u3092\u6291\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 pg_strom.enable_brin [\u578b: bool / \u521d\u671f\u5024: on] BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u3063\u305f\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.cpu_fallback [\u578b: enum / \u521d\u671f\u5024: notice ] GPU\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\"CPU\u518d\u5b9f\u884c\"\u30a8\u30e9\u30fc\u3092\u8fd4\u3057\u305f\u3068\u304d\u306b\u3001\u5b9f\u969b\u306bCPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u8a66\u307f\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 notice ... \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3057\u305f\u4e0a\u3067CPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u884c\u3046 on , true ... \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u305b\u305aCPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u884c\u3046 off , false ... \u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305bCPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u884c\u308f\u306a\u3044 pg_strom.regression_test_mode [\u578b: bool / \u521d\u671f\u5024: off] GPU\u30e2\u30c7\u30eb\u540d\u306a\u3069\u3001\u5b9f\u884c\u74b0\u5883\u306b\u4f9d\u5b58\u3057\u3066\u8868\u793a\u304c\u5909\u308f\u308b\u53ef\u80fd\u6027\u306e\u3042\u308b EXPLAIN \u30b3\u30de\u30f3\u30c9\u306e\u51fa\u529b\u3092\u6291\u5236\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u306b\u304a\u3051\u308b\u507d\u967d\u6027\u3092\u9632\u3050\u305f\u3081\u306e\u8a2d\u5b9a\u3067\u3001\u901a\u5e38\u306f\u5229\u7528\u8005\u304c\u64cd\u4f5c\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u95a2\u3059\u308b\u8a2d\u5b9a pg_strom.gpu_setup_cost [\u578b: real / \u521d\u671f\u5024: 100 * DEFAULT_SEQ_PAGE_COST ] GPU\u30c7\u30d0\u30a4\u30b9\u306e\u521d\u671f\u5316\u306b\u8981\u3059\u308b\u30b3\u30b9\u30c8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5024\u3002 pg_strom.gpu_tuple_cost [\u578b: real / \u521d\u671f\u5024: DEFAULT_CPU_TUPLE_COST ] GPU\u3078\u9001\u51fa\u3059\u308b\uff0f\u53d7\u3051\u53d6\u308b\u30bf\u30d7\u30eb\u4e00\u500b\u3042\u305f\u308a\u306e\u30b3\u30b9\u30c8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5024\u3002 pg_strom.gpu_operator_cost [\u578b: real / \u521d\u671f\u5024: DEFAULT_CPU_OPERATOR_COST / 16 ] GPU\u306e\u6f14\u7b97\u5f0f\u3042\u305f\u308a\u306e\u51e6\u7406\u30b3\u30b9\u30c8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5024\u3002 cpu_operator_cost \u3088\u308a\u3082\u5927\u304d\u306a\u5024\u3092\u8a2d\u5b9a\u3057\u3066\u3057\u307e\u3046\u3068\u3001\u3044\u304b\u306a\u308b\u30b5\u30a4\u30ba\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u3082PG-Strom\u304c\u9078\u629e\u3055\u308c\u308b\u3053\u3068\u306f\u306a\u304f\u306a\u308b\u3002 pg_strom.enable_partitionwise_gpujoin [\u578b: bool / \u521d\u671f\u5024: on] GpuJoin\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 pg_strom.enable_partitionwise_gpupreagg [\u578b: bool / \u521d\u671f\u5024: on] GpuPreAgg\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 pg_strom.pinned_inner_buffer_threshold [\u578b: int / \u521d\u671f\u5024: 0 ] GpuJoin\u306eINNER\u8868\u304cGpuScan\u307e\u305f\u306fGpuJoin\u3067\u3042\u308b\u5834\u5408\u3001\u51e6\u7406\u7d50\u679c\u306e\u63a8\u5b9a\u30b5\u30a4\u30ba\u304c\u3053\u306e\u8a2d\u5b9a\u5024\u3088\u308a\u3082\u5927\u304d\u3051\u308c\u3070\u3001\u7d50\u679c\u3092\u3044\u3063\u305f\u3093CPU\u306b\u623b\u3059\u3053\u3068\u306a\u304f\u3001\u305d\u306e\u307e\u307eGPU\u5074\u306b\u4fdd\u6301\u3057\u305f\u4e0a\u3067\u3001\u7d9a\u304fGpuJoin\u306eINNER\u30d0\u30c3\u30d5\u30a1\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u3002 \u8a2d\u5b9a\u5024\u304c 0 \u306e\u5834\u5408\u3001\u672c\u6a5f\u80fd\u306f\u7121\u52b9\u3068\u306a\u308b\u3002 \u30a8\u30b0\u30bc\u30ad\u30e5\u30fc\u30bf\u306b\u95a2\u3059\u308b\u8a2d\u5b9a pg_strom.max_async_tasks [\u578b: int / \u521d\u671f\u5024: 12 ] PG-Strom\u304cGPU\u5b9f\u884c\u30ad\u30e5\u30fc\u306b\u6295\u5165\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u975e\u540c\u671f\u30bf\u30b9\u30af\u306eGPU\u30c7\u30d0\u30a4\u30b9\u6bce\u306e\u6700\u5927\u5024\u3067\u3001GPU Service\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u6570\u3067\u3082\u3042\u308a\u307e\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306e\u8a2d\u5b9a pg_strom.gpudirect_driver [\u578b: text ] GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306e\u30c9\u30e9\u30a4\u30d0\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u540d\u3092\u793a\u3059\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3059\u3002 cufile \u3001 nvme-strom \u3001\u3082\u3057\u304f\u306f vfs \u306e\u3069\u308c\u304b\u3067\u3059\u3002 pg_strom.gpudirect_enabled [\u578b: bool / \u521d\u671f\u5024: on ] GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.gpu_direct_seq_page_cost [\u578b: real / \u521d\u671f\u5024: DEFAULT_SEQ_PAGE_COST / 4 ] \u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u304c\u5b9f\u884c\u30d7\u30e9\u30f3\u306e\u30b3\u30b9\u30c8\u3092\u8a08\u7b97\u3059\u308b\u969b\u306b\u3001GPU-Direct SQL\u3092\u7528\u3044\u3066\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u5834\u5408\u306e\u30b3\u30b9\u30c8\u3068\u3057\u3066 seq_page_cost \u306e\u4ee3\u308f\u308a\u306b\u4f7f\u7528\u3055\u308c\u308b\u5024\u3002 pg_strom.gpudirect_threshold [\u578b: int / \u521d\u671f\u5024: \u81ea\u52d5] GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u3092\u767a\u52d5\u3055\u305b\u308b\u30c6\u30fc\u30d6\u30eb\u30b5\u30a4\u30ba\u306e\u95be\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u3002 \u521d\u671f\u5024\u306f\u81ea\u52d5\u8a2d\u5b9a\u3067\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u7269\u7406\u30e1\u30e2\u30ea\u3068 shared_buffers \u8a2d\u5b9a\u5024\u304b\u3089\u8a08\u7b97\u3057\u305f\u95be\u5024\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 pg_strom.manual_optimal_gpus [\u578b: text / \u521d\u671f\u5024: \u306a\u3057] NVME\u30c7\u30d0\u30a4\u30b9\u3084NFS\u533a\u753b\u306a\u3069\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u533a\u753b\u3054\u3068\u306b\u6700\u3082\u8fd1\u508d\u3068\u5224\u5b9a\u3055\u308c\u308bGPU\u3092\u624b\u52d5\u3067\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u66f8\u5f0f\u306f {|/path/to/tablespace}=gpuX[:gpuX...] \u3067\u3001NVME\u30c7\u30d0\u30a4\u30b9\u307e\u305f\u306f\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306e\u30d1\u30b9\u3068\u3001\u305d\u306e\u8fd1\u508d\u3067\u3042\u308bGPU\uff08\u8907\u6570\u53ef\uff09\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002\u30ab\u30f3\u30de\u3067\u533a\u5207\u3063\u3066\u8907\u6570\u306e\u8a2d\u5b9a\u3092\u8a18\u8ff0\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002 \u4f8b: pg_strom.manual_optimal_gpus = 'nvme1=gpu0,nvme2=gpu1,/mnt/nfsroot=gpu0' \u306f\u30c7\u30d0\u30a4\u30b9\u756a\u53f7X\u3092\u6301\u3064GPU\u3067\u3059\u3002 \u306f\u30ed\u30fc\u30ab\u30eb\u306eNVME-SSD\u307e\u305f\u306f\u30ea\u30e2\u30fc\u30c8\u306eNVME-oF\u30c7\u30d0\u30a4\u30b9\u3092\u610f\u5473\u3057\u307e\u3059\u3002 /path/to/tablespace \u306f\u3001\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306b\u7d10\u3065\u3044\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d5\u30eb\u30d1\u30b9\u3067\u3059\u3002 \u30ed\u30fc\u30ab\u30eb\u306eNVME-SSD\u306b\u5bfe\u3057\u3066\u306f\u591a\u304f\u306e\u5834\u5408\u81ea\u52d5\u8a2d\u5b9a\u3067\u5341\u5206\u3067\u3059\u304c\u3001NVME-oF\u30c7\u30d0\u30a4\u30b9\u3084NFS-over-RDMA\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u6a5f\u68b0\u7684\u306b\u8fd1\u508d\u306eGPU\u3092\u7279\u5b9a\u3059\u308b\u4e8b\u304c\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u624b\u52d5\u3067\u8fd1\u508d\u306eGPU\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 Arrow_Fdw\u95a2\u9023\u306e\u8a2d\u5b9a arrow_fdw.enabled [\u578b: bool / \u521d\u671f\u5024: on ] \u63a8\u5b9a\u30b3\u30b9\u30c8\u5024\u3092\u8abf\u6574\u3057\u3001Arrow_Fdw\u306e\u6709\u52b9/\u7121\u52b9\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002\u305f\u3060\u3057\u3001GpuScan\u304c\u5229\u7528\u3067\u304d\u306a\u3044\u5834\u5408\u306b\u306f\u3001Arrow_Fdw\u306b\u3088\u308bForeign Scan\u3060\u3051\u304cArrow\u30d5\u30a1\u30a4\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3067\u304d\u308b\u3068\u3044\u3046\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 arrow_fdw.stats_hint_enabled [\u578b: bool / \u521d\u671f\u5024: on ] Arrow\u30d5\u30a1\u30a4\u30eb\u304cmin/max\u7d71\u8a08\u60c5\u5831\u3092\u6301\u3063\u3066\u304a\u308a\u3001\u305d\u308c\u3092\u7528\u3044\u3066\u4e0d\u5fc5\u8981\u306arecord-batch\u3092\u8aad\u307f\u98db\u3070\u3059\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 arrow_fdw.metadata_cache_size [\u578b: int / \u521d\u671f\u5024: 512MB ] Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30e1\u30bf\u60c5\u5831\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u5171\u6709\u30e1\u30e2\u30ea\u9818\u57df\u306e\u5927\u304d\u3055\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u5171\u6709\u30e1\u30e2\u30ea\u306e\u6d88\u8cbb\u91cf\u304c\u3053\u306e\u30b5\u30a4\u30ba\u3092\u8d8a\u3048\u308b\u3068\u3001\u53e4\u3044\u30e1\u30bf\u60c5\u5831\u304b\u3089\u9806\u306b\u89e3\u653e\u3055\u308c\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u8a2d\u5b9a pg_strom.enable_gpucache [\u578b: bool / \u521d\u671f\u5024: on ] \u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 \u306a\u304a\u3001\u3053\u306e\u8a2d\u5b9a\u5024\u3092 off \u306b\u3057\u3066\u3082\u30c8\u30ea\u30ac\u95a2\u6570\u306f\u5f15\u304d\u7d9a\u304dREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u66f4\u65b0\u3057\u7d9a\u3051\u307e\u3059\u3002 pg_strom.gpucache_auto_preload [\u578b: text / \u521d\u671f\u5024: null ] PostgreSQL\u306e\u8d77\u52d5\u76f4\u5f8c\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30ed\u30fc\u30c9\u3059\u3079\u304d\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u66f8\u5f0f\u306f DATABASE_NAME.SCHEMA_NAME.TABLE_NAME \u3067\u3001\u8907\u6570\u500b\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3053\u308c\u3092\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u4e26\u3079\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u521d\u56de\u30ed\u30fc\u30c9\u306f\u76f8\u5fdc\u306b\u6642\u9593\u306e\u304b\u304b\u308b\u51e6\u7406\u3067\u3059\u304c\u3001\u4e8b\u524d\u306b\u521d\u56de\u30ed\u30fc\u30c9\u3092\u6e08\u307e\u305b\u3066\u304a\u304f\u4e8b\u3067\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u521d\u56de\u5b9f\u884c\u6642\u306b\u5fdc\u7b54\u901f\u5ea6\u304c\u9045\u5ef6\u3059\u308b\u306e\u3092\u907f\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u306a\u304a\u3001\u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u3092 '*' \u306b\u8a2d\u5b9a\u3059\u308b\u3068\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6301\u3064\u5168\u3066\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092\u9806\u306bGPU\u3078\u30ed\u30fc\u30c9\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u306b\u95a2\u9023\u3059\u308b\u8a2d\u5b9a pg_strom.gpu_mempool_segment_sz [\u578b: int / \u521d\u671f\u5024: 1GB ] GPU Service\u304c\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u7528\u306bGPU\u30e1\u30e2\u30ea\u3092\u78ba\u4fdd\u3059\u308b\u969b\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u30b5\u30a4\u30ba\u3067\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5f53\u3066\u306f\u6bd4\u8f03\u7684\u30d8\u30d3\u30fc\u306a\u51e6\u7406\u3067\u3042\u308b\u305f\u3081\u3001\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30e1\u30e2\u30ea\u3092\u4f7f\u3044\u56de\u3059\u4e8b\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u3002 pg_strom.gpu_mempool_max_ratio [\u578b: real / \u521d\u671f\u5024: 50% ] GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u7528\u306b\u4f7f\u7528\u3059\u308b\u4e8b\u306e\u3067\u304d\u308b\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5408\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u306b\u3088\u308b\u904e\u5270\u306aGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u6d88\u8cbb\u3092\u6291\u5236\u3057\u3001\u30ef\u30fc\u30ad\u30f3\u30b0\u30e1\u30e2\u30ea\u3092\u5341\u5206\u306b\u78ba\u4fdd\u3059\u308b\u4e8b\u304c\u76ee\u7684\u3067\u3059\u3002 pg_strom.gpu_mempool_min_ratio [\u578b: real / \u521d\u671f\u5024: 5% ] \u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u306b\u78ba\u4fdd\u3057\u305fGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u3046\u3061\u3001\u5229\u7528\u7d42\u4e86\u5f8c\u3082\u89e3\u653e\u305b\u305a\u306b\u78ba\u4fdd\u3057\u305f\u307e\u307e\u306b\u3057\u3066\u304a\u304f\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5408\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u6700\u5c0f\u9650\u5ea6\u306e\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u3092\u4fdd\u6301\u3057\u3066\u304a\u304f\u3053\u3068\u306b\u3088\u308a\u3001\u6b21\u306e\u30af\u30a8\u30ea\u3092\u901f\u3084\u304b\u306b\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 pg_strom.gpu_mempool_release_delay [\u578b: int / \u521d\u671f\u5024: 5000 ] GPU Service\u306f\u3001\u3042\u308b\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u4e0a\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u304c\u7a7a\u306b\u306a\u3063\u3066\u3082\u3001\u3053\u308c\u3092\u76f4\u3061\u306b\u958b\u653e\u3057\u307e\u305b\u3093\u3002\u305d\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u304c\u6700\u5f8c\u306b\u5229\u7528\u3055\u308c\u3066\u304b\u3089\u3001\u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u6307\u5b9a\u3055\u308c\u305f\u6642\u9593\uff08\u30df\u30ea\u79d2\u5358\u4f4d\uff09\u3092\u7d4c\u904e\u3059\u308b\u3068\u3001\u3053\u308c\u3092\u958b\u653e\u3057\u3066\u30b7\u30b9\u30c6\u30e0\u306b\u8fd4\u5374\u3057\u307e\u3059\u3002 \u4e00\u5b9a\u306e\u9045\u5ef6\u3092\u631f\u3080\u4e8b\u3067\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5f53/\u89e3\u653e\u306e\u983b\u5ea6\u3092\u6e1b\u3089\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 pg_strom.gpuserv_debug_output [\u578b: bool / \u521d\u671f\u5024: false ] GPU Service\u306e\u30c7\u30d0\u30c3\u30b0\u30e1\u30c3\u30bb\u30fc\u30b8\u51fa\u529b\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3057\u307e\u3059\u3002\u3053\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u30c7\u30d0\u30c3\u30b0\u306b\u304a\u3044\u3066\u6709\u52b9\u3067\u3042\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u901a\u5e38\u306f\u521d\u671f\u5024\u306e\u307e\u307e\u5909\u66f4\u3057\u306a\u3044\u3067\u4e0b\u3055\u3044\u3002 pg_strom.cuda_visible_devices [\u578b: text / \u521d\u671f\u5024: null ] PostgreSQL\u306e\u8d77\u52d5\u6642\u306b\u7279\u5b9a\u306eGPU\u30c7\u30d0\u30a4\u30b9\u3060\u3051\u3092\u8a8d\u8b58\u3055\u305b\u3066\u3044\u5834\u5408\u306f\u3001\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067GPU\u30c7\u30d0\u30a4\u30b9\u756a\u53f7\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u74b0\u5883\u5909\u6570 CUDA_VISIBLE_DEVICES \u3092\u8a2d\u5b9a\u3059\u308b\u306e\u3068\u540c\u7b49\u3067\u3059\u3002","title":"GUC\u30d1\u30e9\u30e1\u30fc\u30bf"},{"location":"ref_params/#guc","text":"\u672c\u7bc0\u3067\u306fPG-Strom\u306e\u63d0\u4f9b\u3059\u308b\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"GUC\u30d1\u30e9\u30e1\u30fc\u30bf"},{"location":"ref_params/#_1","text":"pg_strom.enabled [\u578b: bool / \u521d\u671f\u5024: on] PG-Strom\u6a5f\u80fd\u5168\u4f53\u3092\u4e00\u62ec\u3057\u3066\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpuscan [\u578b: bool / \u521d\u671f\u5024: on] GpuScan\u306b\u3088\u308b\u30b9\u30ad\u30e3\u30f3\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpuhashjoin [\u578b: bool / \u521d\u671f\u5024: on] GpuHashJoin\u306b\u3088\u308bJOIN\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpugistindex [\u578b: bool / \u521d\u671f\u5024: on] GpuGiSTIndex\u306b\u3088\u308bJOIN\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpujoin [\u578b: bool / \u521d\u671f\u5024: on] GpuJoin\u306b\u3088\u308bJOIN\u3092\u4e00\u62ec\u3067\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002\uff08GpuHashJoin\u3068GpuGiSTIndex\u3092\u542b\u3080\uff09 pg_strom.enable_gpupreagg [\u578b: bool / \u521d\u671f\u5024: on] GpuPreAgg\u306b\u3088\u308b\u96c6\u7d04\u51e6\u7406\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_numeric_aggfuncs [\u578b: bool / \u521d\u671f\u5024: on] numeric \u30c7\u30fc\u30bf\u578b\u3092\u5f15\u6570\u306b\u53d6\u308b\u96c6\u7d04\u6f14\u7b97\u3092GPU\u3067\u51e6\u7406\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 GPU\u3067\u306e\u96c6\u7d04\u6f14\u7b97\u306b\u304a\u3044\u3066 numeric \u30c7\u30fc\u30bf\u578b\u306f\u500d\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3055\u308c\u308b\u305f\u3081\u3001\u8a08\u7b97\u8aa4\u5dee\u306b\u30bb\u30f3\u30b7\u30c6\u30a3\u30d6\u306a\u7528\u9014\u306e\u5834\u5408\u306f\u3001\u3053\u306e\u8a2d\u5b9a\u5024\u3092 off \u306b\u3057\u3066CPU\u3067\u96c6\u7d04\u6f14\u7b97\u3092\u5b9f\u884c\u3057\u3001\u8a08\u7b97\u8aa4\u5dee\u306e\u767a\u751f\u3092\u6291\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 pg_strom.enable_brin [\u578b: bool / \u521d\u671f\u5024: on] BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u3063\u305f\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.cpu_fallback [\u578b: enum / \u521d\u671f\u5024: notice ] GPU\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\"CPU\u518d\u5b9f\u884c\"\u30a8\u30e9\u30fc\u3092\u8fd4\u3057\u305f\u3068\u304d\u306b\u3001\u5b9f\u969b\u306bCPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u8a66\u307f\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 notice ... \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3057\u305f\u4e0a\u3067CPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u884c\u3046 on , true ... \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u305b\u305aCPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u884c\u3046 off , false ... \u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305bCPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u884c\u308f\u306a\u3044 pg_strom.regression_test_mode [\u578b: bool / \u521d\u671f\u5024: off] GPU\u30e2\u30c7\u30eb\u540d\u306a\u3069\u3001\u5b9f\u884c\u74b0\u5883\u306b\u4f9d\u5b58\u3057\u3066\u8868\u793a\u304c\u5909\u308f\u308b\u53ef\u80fd\u6027\u306e\u3042\u308b EXPLAIN \u30b3\u30de\u30f3\u30c9\u306e\u51fa\u529b\u3092\u6291\u5236\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u306b\u304a\u3051\u308b\u507d\u967d\u6027\u3092\u9632\u3050\u305f\u3081\u306e\u8a2d\u5b9a\u3067\u3001\u901a\u5e38\u306f\u5229\u7528\u8005\u304c\u64cd\u4f5c\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002","title":"\u6a5f\u80fd\u5358\u4f4d\u306e\u6709\u52b9\u5316/\u7121\u52b9\u5316"},{"location":"ref_params/#_2","text":"pg_strom.gpu_setup_cost [\u578b: real / \u521d\u671f\u5024: 100 * DEFAULT_SEQ_PAGE_COST ] GPU\u30c7\u30d0\u30a4\u30b9\u306e\u521d\u671f\u5316\u306b\u8981\u3059\u308b\u30b3\u30b9\u30c8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5024\u3002 pg_strom.gpu_tuple_cost [\u578b: real / \u521d\u671f\u5024: DEFAULT_CPU_TUPLE_COST ] GPU\u3078\u9001\u51fa\u3059\u308b\uff0f\u53d7\u3051\u53d6\u308b\u30bf\u30d7\u30eb\u4e00\u500b\u3042\u305f\u308a\u306e\u30b3\u30b9\u30c8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5024\u3002 pg_strom.gpu_operator_cost [\u578b: real / \u521d\u671f\u5024: DEFAULT_CPU_OPERATOR_COST / 16 ] GPU\u306e\u6f14\u7b97\u5f0f\u3042\u305f\u308a\u306e\u51e6\u7406\u30b3\u30b9\u30c8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5024\u3002 cpu_operator_cost \u3088\u308a\u3082\u5927\u304d\u306a\u5024\u3092\u8a2d\u5b9a\u3057\u3066\u3057\u307e\u3046\u3068\u3001\u3044\u304b\u306a\u308b\u30b5\u30a4\u30ba\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u3082PG-Strom\u304c\u9078\u629e\u3055\u308c\u308b\u3053\u3068\u306f\u306a\u304f\u306a\u308b\u3002 pg_strom.enable_partitionwise_gpujoin [\u578b: bool / \u521d\u671f\u5024: on] GpuJoin\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 pg_strom.enable_partitionwise_gpupreagg [\u578b: bool / \u521d\u671f\u5024: on] GpuPreAgg\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 pg_strom.pinned_inner_buffer_threshold [\u578b: int / \u521d\u671f\u5024: 0 ] GpuJoin\u306eINNER\u8868\u304cGpuScan\u307e\u305f\u306fGpuJoin\u3067\u3042\u308b\u5834\u5408\u3001\u51e6\u7406\u7d50\u679c\u306e\u63a8\u5b9a\u30b5\u30a4\u30ba\u304c\u3053\u306e\u8a2d\u5b9a\u5024\u3088\u308a\u3082\u5927\u304d\u3051\u308c\u3070\u3001\u7d50\u679c\u3092\u3044\u3063\u305f\u3093CPU\u306b\u623b\u3059\u3053\u3068\u306a\u304f\u3001\u305d\u306e\u307e\u307eGPU\u5074\u306b\u4fdd\u6301\u3057\u305f\u4e0a\u3067\u3001\u7d9a\u304fGpuJoin\u306eINNER\u30d0\u30c3\u30d5\u30a1\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u3002 \u8a2d\u5b9a\u5024\u304c 0 \u306e\u5834\u5408\u3001\u672c\u6a5f\u80fd\u306f\u7121\u52b9\u3068\u306a\u308b\u3002","title":"\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u95a2\u3059\u308b\u8a2d\u5b9a"},{"location":"ref_params/#_3","text":"pg_strom.max_async_tasks [\u578b: int / \u521d\u671f\u5024: 12 ] PG-Strom\u304cGPU\u5b9f\u884c\u30ad\u30e5\u30fc\u306b\u6295\u5165\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u975e\u540c\u671f\u30bf\u30b9\u30af\u306eGPU\u30c7\u30d0\u30a4\u30b9\u6bce\u306e\u6700\u5927\u5024\u3067\u3001GPU Service\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u6570\u3067\u3082\u3042\u308a\u307e\u3059\u3002","title":"\u30a8\u30b0\u30bc\u30ad\u30e5\u30fc\u30bf\u306b\u95a2\u3059\u308b\u8a2d\u5b9a"},{"location":"ref_params/#gpusql","text":"pg_strom.gpudirect_driver [\u578b: text ] GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306e\u30c9\u30e9\u30a4\u30d0\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u540d\u3092\u793a\u3059\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3059\u3002 cufile \u3001 nvme-strom \u3001\u3082\u3057\u304f\u306f vfs \u306e\u3069\u308c\u304b\u3067\u3059\u3002 pg_strom.gpudirect_enabled [\u578b: bool / \u521d\u671f\u5024: on ] GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.gpu_direct_seq_page_cost [\u578b: real / \u521d\u671f\u5024: DEFAULT_SEQ_PAGE_COST / 4 ] \u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u304c\u5b9f\u884c\u30d7\u30e9\u30f3\u306e\u30b3\u30b9\u30c8\u3092\u8a08\u7b97\u3059\u308b\u969b\u306b\u3001GPU-Direct SQL\u3092\u7528\u3044\u3066\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u5834\u5408\u306e\u30b3\u30b9\u30c8\u3068\u3057\u3066 seq_page_cost \u306e\u4ee3\u308f\u308a\u306b\u4f7f\u7528\u3055\u308c\u308b\u5024\u3002 pg_strom.gpudirect_threshold [\u578b: int / \u521d\u671f\u5024: \u81ea\u52d5] GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u3092\u767a\u52d5\u3055\u305b\u308b\u30c6\u30fc\u30d6\u30eb\u30b5\u30a4\u30ba\u306e\u95be\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u3002 \u521d\u671f\u5024\u306f\u81ea\u52d5\u8a2d\u5b9a\u3067\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u7269\u7406\u30e1\u30e2\u30ea\u3068 shared_buffers \u8a2d\u5b9a\u5024\u304b\u3089\u8a08\u7b97\u3057\u305f\u95be\u5024\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 pg_strom.manual_optimal_gpus [\u578b: text / \u521d\u671f\u5024: \u306a\u3057] NVME\u30c7\u30d0\u30a4\u30b9\u3084NFS\u533a\u753b\u306a\u3069\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u533a\u753b\u3054\u3068\u306b\u6700\u3082\u8fd1\u508d\u3068\u5224\u5b9a\u3055\u308c\u308bGPU\u3092\u624b\u52d5\u3067\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u66f8\u5f0f\u306f {|/path/to/tablespace}=gpuX[:gpuX...] \u3067\u3001NVME\u30c7\u30d0\u30a4\u30b9\u307e\u305f\u306f\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306e\u30d1\u30b9\u3068\u3001\u305d\u306e\u8fd1\u508d\u3067\u3042\u308bGPU\uff08\u8907\u6570\u53ef\uff09\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002\u30ab\u30f3\u30de\u3067\u533a\u5207\u3063\u3066\u8907\u6570\u306e\u8a2d\u5b9a\u3092\u8a18\u8ff0\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002 \u4f8b: pg_strom.manual_optimal_gpus = 'nvme1=gpu0,nvme2=gpu1,/mnt/nfsroot=gpu0' \u306f\u30c7\u30d0\u30a4\u30b9\u756a\u53f7X\u3092\u6301\u3064GPU\u3067\u3059\u3002 \u306f\u30ed\u30fc\u30ab\u30eb\u306eNVME-SSD\u307e\u305f\u306f\u30ea\u30e2\u30fc\u30c8\u306eNVME-oF\u30c7\u30d0\u30a4\u30b9\u3092\u610f\u5473\u3057\u307e\u3059\u3002 /path/to/tablespace \u306f\u3001\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306b\u7d10\u3065\u3044\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d5\u30eb\u30d1\u30b9\u3067\u3059\u3002 \u30ed\u30fc\u30ab\u30eb\u306eNVME-SSD\u306b\u5bfe\u3057\u3066\u306f\u591a\u304f\u306e\u5834\u5408\u81ea\u52d5\u8a2d\u5b9a\u3067\u5341\u5206\u3067\u3059\u304c\u3001NVME-oF\u30c7\u30d0\u30a4\u30b9\u3084NFS-over-RDMA\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u6a5f\u68b0\u7684\u306b\u8fd1\u508d\u306eGPU\u3092\u7279\u5b9a\u3059\u308b\u4e8b\u304c\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u624b\u52d5\u3067\u8fd1\u508d\u306eGPU\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002","title":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306e\u8a2d\u5b9a"},{"location":"ref_params/#arrow_fdw","text":"arrow_fdw.enabled [\u578b: bool / \u521d\u671f\u5024: on ] \u63a8\u5b9a\u30b3\u30b9\u30c8\u5024\u3092\u8abf\u6574\u3057\u3001Arrow_Fdw\u306e\u6709\u52b9/\u7121\u52b9\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002\u305f\u3060\u3057\u3001GpuScan\u304c\u5229\u7528\u3067\u304d\u306a\u3044\u5834\u5408\u306b\u306f\u3001Arrow_Fdw\u306b\u3088\u308bForeign Scan\u3060\u3051\u304cArrow\u30d5\u30a1\u30a4\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3067\u304d\u308b\u3068\u3044\u3046\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 arrow_fdw.stats_hint_enabled [\u578b: bool / \u521d\u671f\u5024: on ] Arrow\u30d5\u30a1\u30a4\u30eb\u304cmin/max\u7d71\u8a08\u60c5\u5831\u3092\u6301\u3063\u3066\u304a\u308a\u3001\u305d\u308c\u3092\u7528\u3044\u3066\u4e0d\u5fc5\u8981\u306arecord-batch\u3092\u8aad\u307f\u98db\u3070\u3059\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 arrow_fdw.metadata_cache_size [\u578b: int / \u521d\u671f\u5024: 512MB ] Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30e1\u30bf\u60c5\u5831\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u5171\u6709\u30e1\u30e2\u30ea\u9818\u57df\u306e\u5927\u304d\u3055\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u5171\u6709\u30e1\u30e2\u30ea\u306e\u6d88\u8cbb\u91cf\u304c\u3053\u306e\u30b5\u30a4\u30ba\u3092\u8d8a\u3048\u308b\u3068\u3001\u53e4\u3044\u30e1\u30bf\u60c5\u5831\u304b\u3089\u9806\u306b\u89e3\u653e\u3055\u308c\u307e\u3059\u3002","title":"Arrow_Fdw\u95a2\u9023\u306e\u8a2d\u5b9a"},{"location":"ref_params/#gpu","text":"pg_strom.enable_gpucache [\u578b: bool / \u521d\u671f\u5024: on ] \u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 \u306a\u304a\u3001\u3053\u306e\u8a2d\u5b9a\u5024\u3092 off \u306b\u3057\u3066\u3082\u30c8\u30ea\u30ac\u95a2\u6570\u306f\u5f15\u304d\u7d9a\u304dREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u66f4\u65b0\u3057\u7d9a\u3051\u307e\u3059\u3002 pg_strom.gpucache_auto_preload [\u578b: text / \u521d\u671f\u5024: null ] PostgreSQL\u306e\u8d77\u52d5\u76f4\u5f8c\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30ed\u30fc\u30c9\u3059\u3079\u304d\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u66f8\u5f0f\u306f DATABASE_NAME.SCHEMA_NAME.TABLE_NAME \u3067\u3001\u8907\u6570\u500b\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3053\u308c\u3092\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u4e26\u3079\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u521d\u56de\u30ed\u30fc\u30c9\u306f\u76f8\u5fdc\u306b\u6642\u9593\u306e\u304b\u304b\u308b\u51e6\u7406\u3067\u3059\u304c\u3001\u4e8b\u524d\u306b\u521d\u56de\u30ed\u30fc\u30c9\u3092\u6e08\u307e\u305b\u3066\u304a\u304f\u4e8b\u3067\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u521d\u56de\u5b9f\u884c\u6642\u306b\u5fdc\u7b54\u901f\u5ea6\u304c\u9045\u5ef6\u3059\u308b\u306e\u3092\u907f\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u306a\u304a\u3001\u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u3092 '*' \u306b\u8a2d\u5b9a\u3059\u308b\u3068\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6301\u3064\u5168\u3066\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092\u9806\u306bGPU\u3078\u30ed\u30fc\u30c9\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u8a2d\u5b9a"},{"location":"ref_params/#gpu_1","text":"pg_strom.gpu_mempool_segment_sz [\u578b: int / \u521d\u671f\u5024: 1GB ] GPU Service\u304c\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u7528\u306bGPU\u30e1\u30e2\u30ea\u3092\u78ba\u4fdd\u3059\u308b\u969b\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u30b5\u30a4\u30ba\u3067\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5f53\u3066\u306f\u6bd4\u8f03\u7684\u30d8\u30d3\u30fc\u306a\u51e6\u7406\u3067\u3042\u308b\u305f\u3081\u3001\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30e1\u30e2\u30ea\u3092\u4f7f\u3044\u56de\u3059\u4e8b\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u3002 pg_strom.gpu_mempool_max_ratio [\u578b: real / \u521d\u671f\u5024: 50% ] GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u7528\u306b\u4f7f\u7528\u3059\u308b\u4e8b\u306e\u3067\u304d\u308b\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5408\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u306b\u3088\u308b\u904e\u5270\u306aGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u6d88\u8cbb\u3092\u6291\u5236\u3057\u3001\u30ef\u30fc\u30ad\u30f3\u30b0\u30e1\u30e2\u30ea\u3092\u5341\u5206\u306b\u78ba\u4fdd\u3059\u308b\u4e8b\u304c\u76ee\u7684\u3067\u3059\u3002 pg_strom.gpu_mempool_min_ratio [\u578b: real / \u521d\u671f\u5024: 5% ] \u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u306b\u78ba\u4fdd\u3057\u305fGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u3046\u3061\u3001\u5229\u7528\u7d42\u4e86\u5f8c\u3082\u89e3\u653e\u305b\u305a\u306b\u78ba\u4fdd\u3057\u305f\u307e\u307e\u306b\u3057\u3066\u304a\u304f\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5408\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u6700\u5c0f\u9650\u5ea6\u306e\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u3092\u4fdd\u6301\u3057\u3066\u304a\u304f\u3053\u3068\u306b\u3088\u308a\u3001\u6b21\u306e\u30af\u30a8\u30ea\u3092\u901f\u3084\u304b\u306b\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 pg_strom.gpu_mempool_release_delay [\u578b: int / \u521d\u671f\u5024: 5000 ] GPU Service\u306f\u3001\u3042\u308b\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u4e0a\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u304c\u7a7a\u306b\u306a\u3063\u3066\u3082\u3001\u3053\u308c\u3092\u76f4\u3061\u306b\u958b\u653e\u3057\u307e\u305b\u3093\u3002\u305d\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u304c\u6700\u5f8c\u306b\u5229\u7528\u3055\u308c\u3066\u304b\u3089\u3001\u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u6307\u5b9a\u3055\u308c\u305f\u6642\u9593\uff08\u30df\u30ea\u79d2\u5358\u4f4d\uff09\u3092\u7d4c\u904e\u3059\u308b\u3068\u3001\u3053\u308c\u3092\u958b\u653e\u3057\u3066\u30b7\u30b9\u30c6\u30e0\u306b\u8fd4\u5374\u3057\u307e\u3059\u3002 \u4e00\u5b9a\u306e\u9045\u5ef6\u3092\u631f\u3080\u4e8b\u3067\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5f53/\u89e3\u653e\u306e\u983b\u5ea6\u3092\u6e1b\u3089\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 pg_strom.gpuserv_debug_output [\u578b: bool / \u521d\u671f\u5024: false ] GPU Service\u306e\u30c7\u30d0\u30c3\u30b0\u30e1\u30c3\u30bb\u30fc\u30b8\u51fa\u529b\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3057\u307e\u3059\u3002\u3053\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u30c7\u30d0\u30c3\u30b0\u306b\u304a\u3044\u3066\u6709\u52b9\u3067\u3042\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u901a\u5e38\u306f\u521d\u671f\u5024\u306e\u307e\u307e\u5909\u66f4\u3057\u306a\u3044\u3067\u4e0b\u3055\u3044\u3002 pg_strom.cuda_visible_devices [\u578b: text / \u521d\u671f\u5024: null ] PostgreSQL\u306e\u8d77\u52d5\u6642\u306b\u7279\u5b9a\u306eGPU\u30c7\u30d0\u30a4\u30b9\u3060\u3051\u3092\u8a8d\u8b58\u3055\u305b\u3066\u3044\u5834\u5408\u306f\u3001\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067GPU\u30c7\u30d0\u30a4\u30b9\u756a\u53f7\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u74b0\u5883\u5909\u6570 CUDA_VISIBLE_DEVICES \u3092\u8a2d\u5b9a\u3059\u308b\u306e\u3068\u540c\u7b49\u3067\u3059\u3002","title":"GPU\u30c7\u30d0\u30a4\u30b9\u306b\u95a2\u9023\u3059\u308b\u8a2d\u5b9a"},{"location":"ref_sqlfuncs/","text":"SQL\u30aa\u30d6\u30b8\u30a7\u30af\u30c8 \u672c\u7ae0\u3067\u306fPG-Strom\u304c\u72ec\u81ea\u306b\u63d0\u4f9b\u3059\u308bSQL\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u30b7\u30b9\u30c6\u30e0\u60c5\u5831 pgstrom.device_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc PG-Strom\u7528\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305fGPU\u30c7\u30d0\u30a4\u30b9\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8868\u793a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d3\u30e5\u30fc\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 name type description gpu_id int GPU\u30c7\u30d0\u30a4\u30b9\u756a\u53f7 att_name text \u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u540d att_value text \u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u5024 att_desc text \u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u306e\u8aac\u660e GPU\u30c7\u30d0\u30a4\u30b9\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u975e\u5e38\u306b\u6570\u304c\u591a\u304f\u3001\u307e\u305fCUDA\u30c9\u30e9\u30a4\u30d0\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u6570\u306f\u307e\u3061\u307e\u3061\u3067\u3059\u3002 \u305d\u306e\u305f\u3081\u3001 pgstrom.device_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc\u3067\u306f\u3001GPU\u30c7\u30d0\u30a4\u30b9\u756a\u53f7( gpu_id )\u3068\u3001\u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u540d( att_name )\u306b\u3088\u3063\u3066\u5bfe\u8c61\u3068\u306a\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u7279\u5b9a\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306f pgstrom.device_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc\u306e\u51fa\u529b\u4f8b\u3067\u3059\u3002 postgres=# select * from pgstrom.gpu_device_info limit 10; gpu_id | att_name | att_value | att_desc --------+-----------------------+------------------------------------------+------------------------------------- 0 | DEV_NAME | NVIDIA A100-PCIE-40GB | GPU Device Name 0 | DEV_ID | 0 | GPU Device ID 0 | DEV_UUID | GPU-13943bfd-5b30-38f5-0473-78979c134606 | GPU Device UUID 0 | DEV_TOTAL_MEMSZ | 39.39GB | GPU Total RAM Size 0 | DEV_BAR1_MEMSZ | 64.00GB | GPU PCI Bar1 Size 0 | NUMA_NODE_ID | -1 | GPU NUMA Node Id 0 | MAX_THREADS_PER_BLOCK | 1024 | Maximum number of threads per block 0 | MAX_BLOCK_DIM_X | 1024 | Maximum block dimension X 0 | MAX_BLOCK_DIM_Y | 1024 | Maximum block dimension Y 0 | MAX_BLOCK_DIM_Z | 64 | Maximum block dimension Z (10 rows) Arrow_Fdw fdw_handler pgstrom.arrow_fdw_handler() Arrow_Fdw\u306eFDW\u30cf\u30f3\u30c9\u30e9\u95a2\u6570\u3067\u3059\u3002\u901a\u5e38\u3001\u30e6\u30fc\u30b6\u304c\u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 void pgstrom.arrow_fdw_validator(text[], oid) Arrow_Fdw\u306eFDW\u30aa\u30d7\u30b7\u30e7\u30f3\u691c\u8a3c\u7528\u95a2\u6570\u3067\u3059\u3002\u901a\u5e38\u3001\u30e6\u30fc\u30b6\u304c\u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 event_trigger pgstrom.arrow_fdw_precheck_schema() Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u305f\u3081\u306e\u30a4\u30d9\u30f3\u30c8\u30c8\u30ea\u30ac\u95a2\u6570\u3067\u3059\u3002\u901a\u5e38\u3001\u30e6\u30fc\u30b6\u304c\u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 void pgstrom.arrow_fdw_import_file(text, text, text = null) Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3001\u65b0\u305f\u306b\u5916\u90e8\u30c6\u30fc\u30d6\u30eb(foreign table)\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u7b2c\u4e00\u5f15\u6570\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u540d\u524d\u3001\u7b2c\u4e8c\u5f15\u6570\u306fApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3001\u7701\u7565\u53ef\u80fd\u306a\u7b2c\u4e09\u5f15\u6570\u306f\u30b9\u30ad\u30fc\u30de\u540d\u3067\u3059\u3002 \u3053\u306e\u95a2\u6570\u306f IMPORT FOREIGN SCHEMA \u69cb\u6587\u306b\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001PostgreSQL\u306b\u304a\u3051\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u5217\u6570\u5236\u9650\uff08 MaxTupleAttributeNumber = 1664\uff09\u3092\u8d8a\u3048\u308b\u5217\u304c\u5b9a\u7fa9\u3055\u308c\u305fApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3067\u304d\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u3053\u308c\u306b\u8a72\u5f53\u3057\u306a\u3044\u5927\u534a\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3067\u306f IMPORT FOREIGN SCHEMA \u69cb\u6587\u3092\u5229\u7528\u3059\u3079\u304d\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001 pgstrom.arrow_fdw_import_file \u3092\u7528\u3044\u30662000\u500b\u306eInt16\u5217\u3092\u6301\u3064Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u305f\u3082\u306e\u3067\u3059\u3002 \\d mytest \u306e\u5b9f\u884c\u7d50\u679c\u3088\u308a\u3001\u65b0\u305f\u306b\u4f5c\u6210\u3055\u308c\u305f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb mytest \u304c2000\u500b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6301\u3063\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 PostgreSQL\u5185\u90e8\u8868\u73fe\u306e\u90fd\u5408\u4e0a\u3001\u5168\u3066\u306e\u5217\u3092\u4e00\u5ea6\u306b\u8aad\u307f\u51fa\u3059\u4e8b\u306f\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u6700\u5f8c\u306e\u4f8b\u306e\u3088\u3046\u306b\u4e00\u90e8\u306e\u5217\u3060\u3051\u3092\u53c2\u7167\u3059\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3042\u308c\u3070\u5b9f\u884c\u53ef\u80fd\u3067\u3059\u3002 =# select pgstrom.arrow_fdw_import_file('mytest', '/tmp/wide2000.arrow'); arrow_fdw_import_file ----------------------- (1 row) =# \\d List of relations Schema | Name | Type | Owner --------+--------+---------------+-------- public | mytest | foreign table | kaigai (1 row) =# \\d mytest Foreign table \"public.mytest\" Column | Type | Collation | Nullable | Default | FDW options -----------+----------+-----------+----------+---------+------------- object_id | integer | | | | c000 | smallint | | | | c001 | smallint | | | | c002 | smallint | | | | c003 | smallint | | | | : : : : : : c1997 | smallint | | | | c1998 | smallint | | | | c1999 | smallint | | | | Server: arrow_fdw FDW options: (file '/tmp/wide2000.arrow') =# select * from mytest ; ERROR: target lists can have at most 1664 entries =# select c0010,c1234,c1999 from mytest limit 3; c0010 | c1234 | c1999 -------+-------+------- 232 | 232 | 232 537 | 537 | 537 219 | 219 | 219 (3 rows) GPU\u30ad\u30e3\u30c3\u30b7\u30e5 pgstrom.gpucache_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u73fe\u5728\u306e\u72b6\u614b\u3092\u8868\u793a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d3\u30e5\u30fc\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 name type description database_oid oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eOID\u3067\u3059 database_name text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u540d\u524d\u3067\u3059 table_oid oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306eOID\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 table_name text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u540d\u524d\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 signature int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4e00\u610f\u6027\u3092\u793a\u3059\u30cf\u30c3\u30b7\u30e5\u5024\u3067\u3059\u3002\u4f8b\u3048\u3070 ALTER TABLE \u306e\u524d\u5f8c\u306a\u3069\u3067\u3053\u306e\u5024\u304c\u5909\u308f\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 phase text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u69cb\u7bc9\u306e\u6bb5\u968e\u3092\u793a\u3057\u307e\u3059\u3002 not_built , is_empty , is_loading , is_ready , corrupted \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002 rowid_num_used int8 \u5272\u5f53\u3066\u6e08\u307f\u306e\u884cID\u306e\u6570\u3067\u3059\u3002 rowid_num_free int8 \u672a\u5272\u5f53\u306e\u884cID\u306e\u6570\u3067\u3059\u3002 gpu_main_sz int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u56fa\u5b9a\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_main_nitems int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u30bf\u30d7\u30eb\u6570\u3067\u3059\u3002 gpu_extra_sz int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_extra_usage int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u9818\u57df\u306e\u4f7f\u7528\u6e08\u307f\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_extra_dead int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u9818\u57df\u306e\u672a\u4f7f\u7528\u30b5\u30a4\u30ba\u3067\u3059\u3002 redo_write_ts timestamptz REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u6700\u5f8c\u306b\u66f4\u65b0\u3057\u305f\u6642\u523b\u3067\u3059\u3002 redo_write_nitems int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_write_pos int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_read_nitems int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_read_pos int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_sync_pos int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u3046\u3061\u3001\u65e2\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3078\u306e\u9069\u7528\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u305f\u4f4d\u7f6e\u3067\u3059\u3002REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u6b8b\u308a\u5bb9\u91cf\u304c\u903c\u8feb\u3057\u3066\u304d\u305f\u969b\u306b\u3001\u591a\u6570\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u540c\u6642\u306b\u975e\u540c\u671f\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u767a\u751f\u3055\u305b\u308b\u4e8b\u3092\u907f\u3051\u308b\u305f\u3081\u3001\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002 config_options text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3067\u3059\u3002 \u4ee5\u4e0b\u306f pgstrom.gpucache_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc\u306e\u51fa\u529b\u4f8b\u3067\u3059\u3002 =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | phase | rowid_num_used | rowid_num_free | gpu_main_sz | gpu_main_nitems | gpu_extra_sz | gpu_extra_usage | gpu_extra_dead | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------------+------------+----------+----------------+----------------+-------------+-----------------+--------------+-----------------+----------------+-------------------------------+-------------------+----------------+------------------+---------------+---------------+--------------------------------------------------------------------------------------------------------------------- 193450 | hoge | 603029 | cache_test_table | 4529357070 | is_ready | 4000 | 6000 | 439904 | 4000 | 3200024 | 473848 | 0 | 2023-12-18 01:25:42.850193+09 | 4000 | 603368 | 4000 | 603368 | 603368 | gpu_device_id=0,max_num_rows=10000,redo_buffer_size=157286400,gpu_sync_interval=4000000,gpu_sync_threshold=10485760 (1 row) trigger pgstrom.gpucache_sync_trigger() \u30c6\u30fc\u30d6\u30eb\u66f4\u65b0\u306e\u969b\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u540c\u671f\u3059\u308b\u305f\u3081\u306e\u30c8\u30ea\u30ac\u95a2\u6570\u3067\u3059\u3002\u8a73\u3057\u304f\u306f GPU\u30ad\u30e3\u30c3\u30b7\u30e5 \u306e\u7ae0\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 bigint pgstrom.gpucache_apply_redo(regclass) \u5f15\u6570\u3067\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u3092\u5f37\u5236\u7684\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u9069\u7528\u3057\u307e\u3059\u3002 bigint pgstrom.gpucache_compaction(regclass) \u5f15\u6570\u3067\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u30d0\u30c3\u30d5\u30a1\u3092\u5f37\u5236\u7684\u306b\u30b3\u30f3\u30d1\u30af\u30c8\u5316\u3057\u307e\u3059\u3002 bigint pgstrom.gpucache_recovery(regclass) \u7834\u640d\uff08corrupted\uff09\u72b6\u614b\u3068\u306a\u3063\u305fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5fa9\u5143\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002 \u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u751f\u6210 void pgstrom.random_setseed(int) \u4e71\u6570\u306e\u7cfb\u5217\u3092\u521d\u671f\u5316\u3057\u307e\u3059\u3002 bigint pgstrom.random_int(float=0.0, bigint=0, bigint=INT_MAX) bigint \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 float pgstrom.random_float(float=0.0, float=0.0, float=1.0) float \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 date pgstrom.random_date(float=0.0, date='2015-01-01', date='2025-12-31') date \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 time pgstrom.random_time(float=0.0, time='00:00:00', time='23:59:59') time \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 timetz pgstrom.random_timetz(float=0.0, time='00:00:00', time='23:59:59') timetz \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 timestamp pgstrom.random_timestamp(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') timestamp \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 macaddr pgstrom.random_macaddr(float=0.0, macaddr='ab:cd:00:00:00', macaddr='ab:cd:ff:ff:ff:ff') macaddr \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 inet pgstrom.random_inet(float=0.0, inet='192.168.0.1/16') inet \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 text pgstrom.random_text(float=0.0, text='test_**') text \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u751f\u6210\u3057\u307e\u3059\u3002\u7b2c\u4e8c\u5f15\u6570\u306e'*'\u6587\u5b57\u3092\u30e9\u30f3\u30c0\u30e0\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 text pgstrom.random_text_len(float=0.0, int=10) text \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u6587\u5b57\u5217\u9577\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 int4range pgstrom.random_int4range(float=0.0, bigint=0, bigint=INT_MAX) int4range \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002} int8range pgstrom.random_int8range(float=0.0, bigint=0, bigint=LONG_MAX) int8range \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 tsrange pgstrom.random_tsrange(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') tsrange \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 tstzrange pgstrom.random_tstzrange(float=0.0, timestamptz='2015-01-01', timestamptz='2025-01-01') tstzrange \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 daterange pgstrom.random_daterange(float=0.0, date='2015-01-01', date='2025-12-31') daterange \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 \u305d\u306e\u4ed6\u306e\u95a2\u6570 text pgstrom.githash() \u73fe\u5728\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308bPG-Strom\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5143\u3068\u306a\u3063\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u30ea\u30d3\u30b8\u30e7\u30f3\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u8868\u793a\u3057\u307e\u3059\u3002\u3053\u306e\u5024\u306f\u3001\u969c\u5bb3\u6642\u306b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u30ea\u30d3\u30b8\u30e7\u30f3\u3092\u7279\u5b9a\u3059\u308b\u306e\u306b\u6709\u7528\u3067\u3059\u3002 postgres=# select pgstrom.githash(); githash ------------------------------------------ 103984be24cafd1e7ce6330a050960d97675c196 text pgstrom.license_query() \u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308c\u3070\u3001\u73fe\u5728\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u5546\u7528\u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3\u3092\u8868\u793a\u3057\u307e\u3059\u3002 =# select pgstrom.license_query(); license_query ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2020-11-24\", \"expired_at\" : \"2025-12-31\", \"gpus\" : [ { \"uuid\" : \"GPU-8ba149db-53d8-c5f3-0f55-97ce8cfadb28\" } ]} (1 row)","title":"SQL\u30aa\u30d6\u30b8\u30a7\u30af\u30c8"},{"location":"ref_sqlfuncs/#sql","text":"\u672c\u7ae0\u3067\u306fPG-Strom\u304c\u72ec\u81ea\u306b\u63d0\u4f9b\u3059\u308bSQL\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"SQL\u30aa\u30d6\u30b8\u30a7\u30af\u30c8"},{"location":"ref_sqlfuncs/#_1","text":"pgstrom.device_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc PG-Strom\u7528\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305fGPU\u30c7\u30d0\u30a4\u30b9\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8868\u793a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d3\u30e5\u30fc\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 name type description gpu_id int GPU\u30c7\u30d0\u30a4\u30b9\u756a\u53f7 att_name text \u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u540d att_value text \u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u5024 att_desc text \u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u306e\u8aac\u660e GPU\u30c7\u30d0\u30a4\u30b9\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u975e\u5e38\u306b\u6570\u304c\u591a\u304f\u3001\u307e\u305fCUDA\u30c9\u30e9\u30a4\u30d0\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u6570\u306f\u307e\u3061\u307e\u3061\u3067\u3059\u3002 \u305d\u306e\u305f\u3081\u3001 pgstrom.device_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc\u3067\u306f\u3001GPU\u30c7\u30d0\u30a4\u30b9\u756a\u53f7( gpu_id )\u3068\u3001\u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u540d( att_name )\u306b\u3088\u3063\u3066\u5bfe\u8c61\u3068\u306a\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u7279\u5b9a\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306f pgstrom.device_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc\u306e\u51fa\u529b\u4f8b\u3067\u3059\u3002 postgres=# select * from pgstrom.gpu_device_info limit 10; gpu_id | att_name | att_value | att_desc --------+-----------------------+------------------------------------------+------------------------------------- 0 | DEV_NAME | NVIDIA A100-PCIE-40GB | GPU Device Name 0 | DEV_ID | 0 | GPU Device ID 0 | DEV_UUID | GPU-13943bfd-5b30-38f5-0473-78979c134606 | GPU Device UUID 0 | DEV_TOTAL_MEMSZ | 39.39GB | GPU Total RAM Size 0 | DEV_BAR1_MEMSZ | 64.00GB | GPU PCI Bar1 Size 0 | NUMA_NODE_ID | -1 | GPU NUMA Node Id 0 | MAX_THREADS_PER_BLOCK | 1024 | Maximum number of threads per block 0 | MAX_BLOCK_DIM_X | 1024 | Maximum block dimension X 0 | MAX_BLOCK_DIM_Y | 1024 | Maximum block dimension Y 0 | MAX_BLOCK_DIM_Z | 64 | Maximum block dimension Z (10 rows)","title":"\u30b7\u30b9\u30c6\u30e0\u60c5\u5831"},{"location":"ref_sqlfuncs/#arrow_fdw","text":"fdw_handler pgstrom.arrow_fdw_handler() Arrow_Fdw\u306eFDW\u30cf\u30f3\u30c9\u30e9\u95a2\u6570\u3067\u3059\u3002\u901a\u5e38\u3001\u30e6\u30fc\u30b6\u304c\u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 void pgstrom.arrow_fdw_validator(text[], oid) Arrow_Fdw\u306eFDW\u30aa\u30d7\u30b7\u30e7\u30f3\u691c\u8a3c\u7528\u95a2\u6570\u3067\u3059\u3002\u901a\u5e38\u3001\u30e6\u30fc\u30b6\u304c\u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 event_trigger pgstrom.arrow_fdw_precheck_schema() Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u305f\u3081\u306e\u30a4\u30d9\u30f3\u30c8\u30c8\u30ea\u30ac\u95a2\u6570\u3067\u3059\u3002\u901a\u5e38\u3001\u30e6\u30fc\u30b6\u304c\u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 void pgstrom.arrow_fdw_import_file(text, text, text = null) Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3001\u65b0\u305f\u306b\u5916\u90e8\u30c6\u30fc\u30d6\u30eb(foreign table)\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u7b2c\u4e00\u5f15\u6570\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u540d\u524d\u3001\u7b2c\u4e8c\u5f15\u6570\u306fApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3001\u7701\u7565\u53ef\u80fd\u306a\u7b2c\u4e09\u5f15\u6570\u306f\u30b9\u30ad\u30fc\u30de\u540d\u3067\u3059\u3002 \u3053\u306e\u95a2\u6570\u306f IMPORT FOREIGN SCHEMA \u69cb\u6587\u306b\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001PostgreSQL\u306b\u304a\u3051\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u5217\u6570\u5236\u9650\uff08 MaxTupleAttributeNumber = 1664\uff09\u3092\u8d8a\u3048\u308b\u5217\u304c\u5b9a\u7fa9\u3055\u308c\u305fApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3067\u304d\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u3053\u308c\u306b\u8a72\u5f53\u3057\u306a\u3044\u5927\u534a\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3067\u306f IMPORT FOREIGN SCHEMA \u69cb\u6587\u3092\u5229\u7528\u3059\u3079\u304d\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001 pgstrom.arrow_fdw_import_file \u3092\u7528\u3044\u30662000\u500b\u306eInt16\u5217\u3092\u6301\u3064Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u305f\u3082\u306e\u3067\u3059\u3002 \\d mytest \u306e\u5b9f\u884c\u7d50\u679c\u3088\u308a\u3001\u65b0\u305f\u306b\u4f5c\u6210\u3055\u308c\u305f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb mytest \u304c2000\u500b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6301\u3063\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 PostgreSQL\u5185\u90e8\u8868\u73fe\u306e\u90fd\u5408\u4e0a\u3001\u5168\u3066\u306e\u5217\u3092\u4e00\u5ea6\u306b\u8aad\u307f\u51fa\u3059\u4e8b\u306f\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u6700\u5f8c\u306e\u4f8b\u306e\u3088\u3046\u306b\u4e00\u90e8\u306e\u5217\u3060\u3051\u3092\u53c2\u7167\u3059\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3042\u308c\u3070\u5b9f\u884c\u53ef\u80fd\u3067\u3059\u3002 =# select pgstrom.arrow_fdw_import_file('mytest', '/tmp/wide2000.arrow'); arrow_fdw_import_file ----------------------- (1 row) =# \\d List of relations Schema | Name | Type | Owner --------+--------+---------------+-------- public | mytest | foreign table | kaigai (1 row) =# \\d mytest Foreign table \"public.mytest\" Column | Type | Collation | Nullable | Default | FDW options -----------+----------+-----------+----------+---------+------------- object_id | integer | | | | c000 | smallint | | | | c001 | smallint | | | | c002 | smallint | | | | c003 | smallint | | | | : : : : : : c1997 | smallint | | | | c1998 | smallint | | | | c1999 | smallint | | | | Server: arrow_fdw FDW options: (file '/tmp/wide2000.arrow') =# select * from mytest ; ERROR: target lists can have at most 1664 entries =# select c0010,c1234,c1999 from mytest limit 3; c0010 | c1234 | c1999 -------+-------+------- 232 | 232 | 232 537 | 537 | 537 219 | 219 | 219 (3 rows)","title":"Arrow_Fdw"},{"location":"ref_sqlfuncs/#gpu","text":"pgstrom.gpucache_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u73fe\u5728\u306e\u72b6\u614b\u3092\u8868\u793a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d3\u30e5\u30fc\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 name type description database_oid oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eOID\u3067\u3059 database_name text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u540d\u524d\u3067\u3059 table_oid oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306eOID\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 table_name text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u540d\u524d\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 signature int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4e00\u610f\u6027\u3092\u793a\u3059\u30cf\u30c3\u30b7\u30e5\u5024\u3067\u3059\u3002\u4f8b\u3048\u3070 ALTER TABLE \u306e\u524d\u5f8c\u306a\u3069\u3067\u3053\u306e\u5024\u304c\u5909\u308f\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 phase text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u69cb\u7bc9\u306e\u6bb5\u968e\u3092\u793a\u3057\u307e\u3059\u3002 not_built , is_empty , is_loading , is_ready , corrupted \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002 rowid_num_used int8 \u5272\u5f53\u3066\u6e08\u307f\u306e\u884cID\u306e\u6570\u3067\u3059\u3002 rowid_num_free int8 \u672a\u5272\u5f53\u306e\u884cID\u306e\u6570\u3067\u3059\u3002 gpu_main_sz int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u56fa\u5b9a\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_main_nitems int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u30bf\u30d7\u30eb\u6570\u3067\u3059\u3002 gpu_extra_sz int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_extra_usage int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u9818\u57df\u306e\u4f7f\u7528\u6e08\u307f\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_extra_dead int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u9818\u57df\u306e\u672a\u4f7f\u7528\u30b5\u30a4\u30ba\u3067\u3059\u3002 redo_write_ts timestamptz REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u6700\u5f8c\u306b\u66f4\u65b0\u3057\u305f\u6642\u523b\u3067\u3059\u3002 redo_write_nitems int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_write_pos int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_read_nitems int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_read_pos int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_sync_pos int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u3046\u3061\u3001\u65e2\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3078\u306e\u9069\u7528\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u305f\u4f4d\u7f6e\u3067\u3059\u3002REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u6b8b\u308a\u5bb9\u91cf\u304c\u903c\u8feb\u3057\u3066\u304d\u305f\u969b\u306b\u3001\u591a\u6570\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u540c\u6642\u306b\u975e\u540c\u671f\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u767a\u751f\u3055\u305b\u308b\u4e8b\u3092\u907f\u3051\u308b\u305f\u3081\u3001\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002 config_options text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3067\u3059\u3002 \u4ee5\u4e0b\u306f pgstrom.gpucache_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc\u306e\u51fa\u529b\u4f8b\u3067\u3059\u3002 =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | phase | rowid_num_used | rowid_num_free | gpu_main_sz | gpu_main_nitems | gpu_extra_sz | gpu_extra_usage | gpu_extra_dead | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------------+------------+----------+----------------+----------------+-------------+-----------------+--------------+-----------------+----------------+-------------------------------+-------------------+----------------+------------------+---------------+---------------+--------------------------------------------------------------------------------------------------------------------- 193450 | hoge | 603029 | cache_test_table | 4529357070 | is_ready | 4000 | 6000 | 439904 | 4000 | 3200024 | 473848 | 0 | 2023-12-18 01:25:42.850193+09 | 4000 | 603368 | 4000 | 603368 | 603368 | gpu_device_id=0,max_num_rows=10000,redo_buffer_size=157286400,gpu_sync_interval=4000000,gpu_sync_threshold=10485760 (1 row) trigger pgstrom.gpucache_sync_trigger() \u30c6\u30fc\u30d6\u30eb\u66f4\u65b0\u306e\u969b\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u540c\u671f\u3059\u308b\u305f\u3081\u306e\u30c8\u30ea\u30ac\u95a2\u6570\u3067\u3059\u3002\u8a73\u3057\u304f\u306f GPU\u30ad\u30e3\u30c3\u30b7\u30e5 \u306e\u7ae0\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 bigint pgstrom.gpucache_apply_redo(regclass) \u5f15\u6570\u3067\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u3092\u5f37\u5236\u7684\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u9069\u7528\u3057\u307e\u3059\u3002 bigint pgstrom.gpucache_compaction(regclass) \u5f15\u6570\u3067\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u30d0\u30c3\u30d5\u30a1\u3092\u5f37\u5236\u7684\u306b\u30b3\u30f3\u30d1\u30af\u30c8\u5316\u3057\u307e\u3059\u3002 bigint pgstrom.gpucache_recovery(regclass) \u7834\u640d\uff08corrupted\uff09\u72b6\u614b\u3068\u306a\u3063\u305fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5fa9\u5143\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5"},{"location":"ref_sqlfuncs/#_2","text":"void pgstrom.random_setseed(int) \u4e71\u6570\u306e\u7cfb\u5217\u3092\u521d\u671f\u5316\u3057\u307e\u3059\u3002 bigint pgstrom.random_int(float=0.0, bigint=0, bigint=INT_MAX) bigint \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 float pgstrom.random_float(float=0.0, float=0.0, float=1.0) float \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 date pgstrom.random_date(float=0.0, date='2015-01-01', date='2025-12-31') date \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 time pgstrom.random_time(float=0.0, time='00:00:00', time='23:59:59') time \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 timetz pgstrom.random_timetz(float=0.0, time='00:00:00', time='23:59:59') timetz \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 timestamp pgstrom.random_timestamp(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') timestamp \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 macaddr pgstrom.random_macaddr(float=0.0, macaddr='ab:cd:00:00:00', macaddr='ab:cd:ff:ff:ff:ff') macaddr \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 inet pgstrom.random_inet(float=0.0, inet='192.168.0.1/16') inet \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 text pgstrom.random_text(float=0.0, text='test_**') text \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u751f\u6210\u3057\u307e\u3059\u3002\u7b2c\u4e8c\u5f15\u6570\u306e'*'\u6587\u5b57\u3092\u30e9\u30f3\u30c0\u30e0\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 text pgstrom.random_text_len(float=0.0, int=10) text \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u6587\u5b57\u5217\u9577\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 int4range pgstrom.random_int4range(float=0.0, bigint=0, bigint=INT_MAX) int4range \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002} int8range pgstrom.random_int8range(float=0.0, bigint=0, bigint=LONG_MAX) int8range \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 tsrange pgstrom.random_tsrange(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') tsrange \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 tstzrange pgstrom.random_tstzrange(float=0.0, timestamptz='2015-01-01', timestamptz='2025-01-01') tstzrange \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 daterange pgstrom.random_daterange(float=0.0, date='2015-01-01', date='2025-12-31') daterange \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002","title":"\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u751f\u6210"},{"location":"ref_sqlfuncs/#_3","text":"text pgstrom.githash() \u73fe\u5728\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308bPG-Strom\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5143\u3068\u306a\u3063\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u30ea\u30d3\u30b8\u30e7\u30f3\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u8868\u793a\u3057\u307e\u3059\u3002\u3053\u306e\u5024\u306f\u3001\u969c\u5bb3\u6642\u306b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u30ea\u30d3\u30b8\u30e7\u30f3\u3092\u7279\u5b9a\u3059\u308b\u306e\u306b\u6709\u7528\u3067\u3059\u3002 postgres=# select pgstrom.githash(); githash ------------------------------------------ 103984be24cafd1e7ce6330a050960d97675c196 text pgstrom.license_query() \u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308c\u3070\u3001\u73fe\u5728\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u5546\u7528\u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3\u3092\u8868\u793a\u3057\u307e\u3059\u3002 =# select pgstrom.license_query(); license_query ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2020-11-24\", \"expired_at\" : \"2025-12-31\", \"gpus\" : [ { \"uuid\" : \"GPU-8ba149db-53d8-c5f3-0f55-97ce8cfadb28\" } ]} (1 row)","title":"\u305d\u306e\u4ed6\u306e\u95a2\u6570"},{"location":"ref_types/","text":"\u30c7\u30fc\u30bf\u578b PG-Strom\u306f\u4ee5\u4e0b\u306e\u30c7\u30fc\u30bf\u578b\u3092GPU\u3067\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u6570\u5024\u30c7\u30fc\u30bf\u578b int1 [\u30c7\u30fc\u30bf\u9577: 1byte] 8bit\u6574\u6570\u578b\u3002PG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 int2 (\u5225\u540d smallint ) [\u30c7\u30fc\u30bf\u9577: 2bytes] 16bit\u6574\u6570\u578b int4 (\u5225\u540d int ) [\u30c7\u30fc\u30bf\u9577: 4bytes] 32bit\u6574\u6570\u578b int8 (\u5225\u540d bigint ) [\u30c7\u30fc\u30bf\u9577: 8bytes] 64bit\u6574\u6570\u578b float2 [\u30c7\u30fc\u30bf\u9577: 2bytes] \u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3002PG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 Note GPU\u3067\u306f\u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u304c\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001CPU(x86_64\u30d7\u30ed\u30bb\u30c3\u30b5)\u3067\u306f\u672a\u5bfe\u5fdc\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001 float2 \u30c7\u30fc\u30bf\u578b\u3092CPU\u3067\u51e6\u7406\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u3053\u308c\u3092\u4e00\u5ea6 float \u3084 double \u578b\u306b\u5909\u63db\u3057\u305f\u4e0a\u3067\u6f14\u7b97\u3092\u884c\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001GPU\u306e\u3088\u3046\u306b float2 \u306e\u65b9\u304c\u6f14\u7b97\u901f\u5ea6\u3067\u6709\u5229\u3068\u3044\u3046\u4e8b\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u6a5f\u68b0\u5b66\u7fd2\u3084\u7d71\u8a08\u89e3\u6790\u7528\u9014\u306b\u30c7\u30fc\u30bf\u91cf\u3092\u6291\u5236\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002 float4 (\u5225\u540d real ) [\u30c7\u30fc\u30bf\u9577: 4bytes] \u5358\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b float8 (\u5225\u540d double precision ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u500d\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b numeric [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909] \u5b9f\u6570\u578b\u3002GPU\u5074\u3067\u306f128bit\u56fa\u5b9a\u5c0f\u6570\u70b9\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u3002 Note GPU\u304c numeric \u578b\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u969b\u3001\u5b9f\u88c5\u4e0a\u306e\u7406\u7531\u304b\u3089\u3053\u308c\u3092128bit\u56fa\u5b9a\u5c11\u6570\u70b9\u306e\u5185\u90e8\u8868\u73fe\u306b\u5909\u63db\u3057\u3066\u51e6\u7406\u3057\u307e\u3059\u3002\uff08\u3053\u308c\u306f Apache Arrow \u306e Decimal \u578b\u3068\u540c\u4e00\u306e\u5f62\u5f0f\u3067\u3059\uff09 \u3053\u308c\u3089\u5185\u90e8\u8868\u73fe\u3078\u306e/\u304b\u3089\u306e\u5909\u63db\u306f\u900f\u904e\u7684\u306b\u884c\u308f\u308c\u307e\u3059\u304c\u3001\u4f8b\u3048\u3070\u3001\u6841\u6570\u306e\u5927\u304d\u306a numeric \u578b\u306e\u30c7\u30fc\u30bf\u306f\u8868\u73fe\u3059\u308b\u4e8b\u304c\u3067\u304d\u306a\u3044\u305f\u3081\u3001PG-Strom\u306fCPU\u5074\u3067\u306e\u30d5\u30a9\u30fc\u30eb\u30d0\u30c3\u30af\u51e6\u7406\u3092\u8a66\u307f\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u6841\u6570\u306e\u5927\u304d\u306a numeric \u578b\u306e\u30c7\u30fc\u30bf\u3092GPU\u306b\u4e0e\u3048\u308b\u3068\u5374\u3063\u3066\u5b9f\u884c\u901f\u5ea6\u304c\u4f4e\u4e0b\u3057\u3066\u3057\u307e\u3046\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u3053\u308c\u3092\u907f\u3051\u308b\u306b\u306f\u3001GUC\u30d1\u30e9\u30e1\u30fc\u30bf pg_strom.enable_numeric_type \u3092\u4f7f\u7528\u3057\u3066 numeric \u30c7\u30fc\u30bf\u578b\u3092\u542b\u3080\u6f14\u7b97\u5f0f\u3092GPU\u3067\u5b9f\u884c\u3057\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u65e5\u4ed8\u6642\u523b\u578b date [\u30c7\u30fc\u30bf\u9577: 4bytes] \u65e5\u4ed8\u30c7\u30fc\u30bf\u578b time (\u5225\u540d time without time zone ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u6642\u523b\u30c7\u30fc\u30bf\u578b timetz (\u5225\u540d time with time zone ) [\u30c7\u30fc\u30bf\u9577: 12bytes] \u6642\u523b\u30c7\u30fc\u30bf\u578b\uff08\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u4ed8\u304d\uff09 timestamp (\u5225\u540d timestamp without time zone ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b timestamptz (\u5225\u540d timestamp with time zone ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b\uff08\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u4ed8\u304d\uff09 interval [\u30c7\u30fc\u30bf\u9577: 16bytes] \u6642\u9593\u9593\u9694\u578b \u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b bpchar [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30c6\u30ad\u30b9\u30c8\u578b\uff08\u7a7a\u767d\u30d1\u30c7\u30a3\u30f3\u30b0\u3042\u308a\uff09 varchar [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30c6\u30ad\u30b9\u30c8\u578b text [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30c6\u30ad\u30b9\u30c8\u578b bytea [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30d0\u30a4\u30ca\u30ea\u578b \u975e\u69cb\u9020\u30c7\u30fc\u30bf\u578b jsonb [length: \u53ef\u5909\u9577] \u30d0\u30a4\u30ca\u30ea\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5185\u5305\u3059\u308bJSON\u30c7\u30fc\u30bf\u578b Note jsonb \u30c7\u30fc\u30bf\u578b\u3092GPU\u3067\u51e6\u7406\u3055\u305b\u308b\u5834\u5408\u306b\u306f\u3001\u6b21\u306e2\u3064\u306e\u70b9\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u5b9f\u969b\u306b\u53c2\u7167\u3055\u308c\u306a\u3044\u5c5e\u6027\u3082\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u8ee2\u9001\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001I/O\u30d0\u30b9\u306e\u5229\u7528\u52b9\u7387\u306f\u5fc5\u305a\u3057\u3082\u826f\u304f\u306a\u3044\u30c7\u30fc\u30bf\u578b\u3067\u3042\u308b\u4e8b\u3002\u30c7\u30fc\u30bf\u9577\u304c TOAST\u5316 \u306e\u95be\u5024\uff08\u901a\u5e38\u306f2kB\u5f31\uff09\u3092\u8d8a\u3048\u3066\u3057\u307e\u3063\u305f\u5834\u5408\u3001 jsonb \u30c7\u30fc\u30bf\u5168\u4f53\u304cTOAST\u30c6\u30fc\u30d6\u30eb\u3078\u66f8\u304d\u51fa\u3055\u308c\u308b\u305f\u3081\u3001GPU\u5074\u3067\u306f\u51e6\u7406\u3067\u304d\u305a\u975e\u52b9\u7387\u306aCPU-fallback\u51e6\u7406\u3092\u547c\u3073\u51fa\u3057\u3066\u3057\u307e\u3046\u4e8b\u3002 \u5f8c\u8005\u306e\u554f\u984c\u306b\u5bfe\u3057\u3066\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u30aa\u30d7\u30b7\u30e7\u30f3 toast_tuple_target \u3092\u62e1\u5927\u3057\u3001TOAST\u5316\u306e\u95be\u5024\u3092\u5f15\u304d\u4e0a\u3052\u308b\u4e8b\u3067\u3042\u308b\u7a0b\u5ea6\u306f\u56de\u907f\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002 \u96d1\u591a\u306a\u30c7\u30fc\u30bf\u578b boolean [\u30c7\u30fc\u30bf\u9577: 1byte] \u8ad6\u7406\u5024\u30c7\u30fc\u30bf\u578b money [\u30c7\u30fc\u30bf\u9577: 8bytes] \u901a\u8ca8\u30c7\u30fc\u30bf\u578b uuid [\u30c7\u30fc\u30bf\u9577: 16bytes] UUID\u30c7\u30fc\u30bf\u578b macaddr [\u30c7\u30fc\u30bf\u9577: 6bytes] \u30cd\u30c3\u30c8\u30ef\u30fc\u30afMAC\u30a2\u30c9\u30ec\u30b9\u578b inet [\u30c7\u30fc\u30bf\u9577: 7 or 19bytes] \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u578b cidr [\u30c7\u30fc\u30bf\u9577: 7 or 19butes] \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u578b cube [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] contrib/cube \u306b\u3088\u3063\u3066\u63d0\u4f9b\u3055\u308c\u308b\u62e1\u5f35\u30c7\u30fc\u30bf\u578b \u30b8\u30aa\u30e1\u30c8\u30ea\u578b geometry [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909] PostGIS\u30b8\u30aa\u30e1\u30c8\u30ea\u30aa\u30d6\u30b8\u30a7\u30af\u30c8 box2df [\u30c7\u30fc\u30bf\u9577: 16bytes] 2\u6b21\u5143\u30d0\u30a6\u30f3\u30c7\u30a3\u30f3\u30b0\u30dc\u30c3\u30af\u30b9\uff08GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u7528\uff09","title":"\u30c7\u30fc\u30bf\u578b"},{"location":"ref_types/#_1","text":"PG-Strom\u306f\u4ee5\u4e0b\u306e\u30c7\u30fc\u30bf\u578b\u3092GPU\u3067\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002","title":"\u30c7\u30fc\u30bf\u578b"},{"location":"ref_types/#_2","text":"int1 [\u30c7\u30fc\u30bf\u9577: 1byte] 8bit\u6574\u6570\u578b\u3002PG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 int2 (\u5225\u540d smallint ) [\u30c7\u30fc\u30bf\u9577: 2bytes] 16bit\u6574\u6570\u578b int4 (\u5225\u540d int ) [\u30c7\u30fc\u30bf\u9577: 4bytes] 32bit\u6574\u6570\u578b int8 (\u5225\u540d bigint ) [\u30c7\u30fc\u30bf\u9577: 8bytes] 64bit\u6574\u6570\u578b float2 [\u30c7\u30fc\u30bf\u9577: 2bytes] \u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3002PG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 Note GPU\u3067\u306f\u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u304c\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001CPU(x86_64\u30d7\u30ed\u30bb\u30c3\u30b5)\u3067\u306f\u672a\u5bfe\u5fdc\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001 float2 \u30c7\u30fc\u30bf\u578b\u3092CPU\u3067\u51e6\u7406\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u3053\u308c\u3092\u4e00\u5ea6 float \u3084 double \u578b\u306b\u5909\u63db\u3057\u305f\u4e0a\u3067\u6f14\u7b97\u3092\u884c\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001GPU\u306e\u3088\u3046\u306b float2 \u306e\u65b9\u304c\u6f14\u7b97\u901f\u5ea6\u3067\u6709\u5229\u3068\u3044\u3046\u4e8b\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u6a5f\u68b0\u5b66\u7fd2\u3084\u7d71\u8a08\u89e3\u6790\u7528\u9014\u306b\u30c7\u30fc\u30bf\u91cf\u3092\u6291\u5236\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002 float4 (\u5225\u540d real ) [\u30c7\u30fc\u30bf\u9577: 4bytes] \u5358\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b float8 (\u5225\u540d double precision ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u500d\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b numeric [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909] \u5b9f\u6570\u578b\u3002GPU\u5074\u3067\u306f128bit\u56fa\u5b9a\u5c0f\u6570\u70b9\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u3002 Note GPU\u304c numeric \u578b\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u969b\u3001\u5b9f\u88c5\u4e0a\u306e\u7406\u7531\u304b\u3089\u3053\u308c\u3092128bit\u56fa\u5b9a\u5c11\u6570\u70b9\u306e\u5185\u90e8\u8868\u73fe\u306b\u5909\u63db\u3057\u3066\u51e6\u7406\u3057\u307e\u3059\u3002\uff08\u3053\u308c\u306f Apache Arrow \u306e Decimal \u578b\u3068\u540c\u4e00\u306e\u5f62\u5f0f\u3067\u3059\uff09 \u3053\u308c\u3089\u5185\u90e8\u8868\u73fe\u3078\u306e/\u304b\u3089\u306e\u5909\u63db\u306f\u900f\u904e\u7684\u306b\u884c\u308f\u308c\u307e\u3059\u304c\u3001\u4f8b\u3048\u3070\u3001\u6841\u6570\u306e\u5927\u304d\u306a numeric \u578b\u306e\u30c7\u30fc\u30bf\u306f\u8868\u73fe\u3059\u308b\u4e8b\u304c\u3067\u304d\u306a\u3044\u305f\u3081\u3001PG-Strom\u306fCPU\u5074\u3067\u306e\u30d5\u30a9\u30fc\u30eb\u30d0\u30c3\u30af\u51e6\u7406\u3092\u8a66\u307f\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u6841\u6570\u306e\u5927\u304d\u306a numeric \u578b\u306e\u30c7\u30fc\u30bf\u3092GPU\u306b\u4e0e\u3048\u308b\u3068\u5374\u3063\u3066\u5b9f\u884c\u901f\u5ea6\u304c\u4f4e\u4e0b\u3057\u3066\u3057\u307e\u3046\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u3053\u308c\u3092\u907f\u3051\u308b\u306b\u306f\u3001GUC\u30d1\u30e9\u30e1\u30fc\u30bf pg_strom.enable_numeric_type \u3092\u4f7f\u7528\u3057\u3066 numeric \u30c7\u30fc\u30bf\u578b\u3092\u542b\u3080\u6f14\u7b97\u5f0f\u3092GPU\u3067\u5b9f\u884c\u3057\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002","title":"\u6570\u5024\u30c7\u30fc\u30bf\u578b"},{"location":"ref_types/#_3","text":"date [\u30c7\u30fc\u30bf\u9577: 4bytes] \u65e5\u4ed8\u30c7\u30fc\u30bf\u578b time (\u5225\u540d time without time zone ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u6642\u523b\u30c7\u30fc\u30bf\u578b timetz (\u5225\u540d time with time zone ) [\u30c7\u30fc\u30bf\u9577: 12bytes] \u6642\u523b\u30c7\u30fc\u30bf\u578b\uff08\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u4ed8\u304d\uff09 timestamp (\u5225\u540d timestamp without time zone ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b timestamptz (\u5225\u540d timestamp with time zone ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b\uff08\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u4ed8\u304d\uff09 interval [\u30c7\u30fc\u30bf\u9577: 16bytes] \u6642\u9593\u9593\u9694\u578b","title":"\u65e5\u4ed8\u6642\u523b\u578b"},{"location":"ref_types/#_4","text":"bpchar [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30c6\u30ad\u30b9\u30c8\u578b\uff08\u7a7a\u767d\u30d1\u30c7\u30a3\u30f3\u30b0\u3042\u308a\uff09 varchar [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30c6\u30ad\u30b9\u30c8\u578b text [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30c6\u30ad\u30b9\u30c8\u578b bytea [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30d0\u30a4\u30ca\u30ea\u578b","title":"\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b"},{"location":"ref_types/#_5","text":"jsonb [length: \u53ef\u5909\u9577] \u30d0\u30a4\u30ca\u30ea\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5185\u5305\u3059\u308bJSON\u30c7\u30fc\u30bf\u578b Note jsonb \u30c7\u30fc\u30bf\u578b\u3092GPU\u3067\u51e6\u7406\u3055\u305b\u308b\u5834\u5408\u306b\u306f\u3001\u6b21\u306e2\u3064\u306e\u70b9\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u5b9f\u969b\u306b\u53c2\u7167\u3055\u308c\u306a\u3044\u5c5e\u6027\u3082\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u8ee2\u9001\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001I/O\u30d0\u30b9\u306e\u5229\u7528\u52b9\u7387\u306f\u5fc5\u305a\u3057\u3082\u826f\u304f\u306a\u3044\u30c7\u30fc\u30bf\u578b\u3067\u3042\u308b\u4e8b\u3002\u30c7\u30fc\u30bf\u9577\u304c TOAST\u5316 \u306e\u95be\u5024\uff08\u901a\u5e38\u306f2kB\u5f31\uff09\u3092\u8d8a\u3048\u3066\u3057\u307e\u3063\u305f\u5834\u5408\u3001 jsonb \u30c7\u30fc\u30bf\u5168\u4f53\u304cTOAST\u30c6\u30fc\u30d6\u30eb\u3078\u66f8\u304d\u51fa\u3055\u308c\u308b\u305f\u3081\u3001GPU\u5074\u3067\u306f\u51e6\u7406\u3067\u304d\u305a\u975e\u52b9\u7387\u306aCPU-fallback\u51e6\u7406\u3092\u547c\u3073\u51fa\u3057\u3066\u3057\u307e\u3046\u4e8b\u3002 \u5f8c\u8005\u306e\u554f\u984c\u306b\u5bfe\u3057\u3066\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u30aa\u30d7\u30b7\u30e7\u30f3 toast_tuple_target \u3092\u62e1\u5927\u3057\u3001TOAST\u5316\u306e\u95be\u5024\u3092\u5f15\u304d\u4e0a\u3052\u308b\u4e8b\u3067\u3042\u308b\u7a0b\u5ea6\u306f\u56de\u907f\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002","title":"\u975e\u69cb\u9020\u30c7\u30fc\u30bf\u578b"},{"location":"ref_types/#_6","text":"boolean [\u30c7\u30fc\u30bf\u9577: 1byte] \u8ad6\u7406\u5024\u30c7\u30fc\u30bf\u578b money [\u30c7\u30fc\u30bf\u9577: 8bytes] \u901a\u8ca8\u30c7\u30fc\u30bf\u578b uuid [\u30c7\u30fc\u30bf\u9577: 16bytes] UUID\u30c7\u30fc\u30bf\u578b macaddr [\u30c7\u30fc\u30bf\u9577: 6bytes] \u30cd\u30c3\u30c8\u30ef\u30fc\u30afMAC\u30a2\u30c9\u30ec\u30b9\u578b inet [\u30c7\u30fc\u30bf\u9577: 7 or 19bytes] \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u578b cidr [\u30c7\u30fc\u30bf\u9577: 7 or 19butes] \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u578b cube [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] contrib/cube \u306b\u3088\u3063\u3066\u63d0\u4f9b\u3055\u308c\u308b\u62e1\u5f35\u30c7\u30fc\u30bf\u578b","title":"\u96d1\u591a\u306a\u30c7\u30fc\u30bf\u578b"},{"location":"ref_types/#_7","text":"geometry [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909] PostGIS\u30b8\u30aa\u30e1\u30c8\u30ea\u30aa\u30d6\u30b8\u30a7\u30af\u30c8 box2df [\u30c7\u30fc\u30bf\u9577: 16bytes] 2\u6b21\u5143\u30d0\u30a6\u30f3\u30c7\u30a3\u30f3\u30b0\u30dc\u30c3\u30af\u30b9\uff08GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u7528\uff09","title":"\u30b8\u30aa\u30e1\u30c8\u30ea\u578b"},{"location":"release_v2.0/","text":"PG-Strom v2.0\u30ea\u30ea\u30fc\u30b9 PG-Strom Development Team (17-Apr-2018) \u6982\u8981 PG-Strom v2.0\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u6a5f\u80fd\u5f37\u5316\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 GPU\u3092\u7ba1\u7406\u3059\u308b\u5185\u90e8\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u306e\u5168\u4f53\u7684\u306a\u518d\u8a2d\u8a08\u3068\u5b89\u5b9a\u5316 CPU+GPU\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u4e26\u5217\u5b9f\u884c SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2(store_fdw) GpuJoin\u3068GpuPreAgg\u306e\u518d\u8a2d\u8a08\u306b\u4f34\u3046\u9ad8\u901f\u5316 GpuPreAgg+GpuJoin+GpuScan \u5bc6\u7d50\u5408GPU\u30ab\u30fc\u30cd\u30eb \u65b0\u6a5f\u80fd\u306e\u30b5\u30de\u30ea\u306f\u3053\u3061\u3089\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\uff1a PG-Strom v2.0 Technical Brief . \u52d5\u4f5c\u74b0\u5883 PostgreSQL v9.6, v10 CUDA Toolkit 9.1 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d) \u65b0\u6a5f\u80fd GPU\u3092\u7ba1\u7406\u3059\u308b\u5185\u90e8\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u306e\u5168\u4f53\u7684\u306a\u518d\u8a2d\u8a08\u3068\u5b89\u5b9a\u5316 PostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306f\u540c\u6642\u306b\uff11\u500b\u306eGPU\u3060\u3051\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u30de\u30eb\u30c1GPU\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u306fPostgreSQL\u306eCPU\u4e26\u5217\u3068\u306e\u4f75\u7528\u304c\u524d\u63d0\u306b\u306a\u308a\u307e\u3059\u304c\u3001CPU\u30b9\u30ec\u30c3\u30c9\u304cGPU\u3078\u30c7\u30fc\u30bf\u3092\u4f9b\u7d66\u3059\u308b\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u306fGPU\u306e\u51e6\u7406\u80fd\u529b\u3088\u308a\u3082\u305a\u3063\u3068\u4f4e\u3044\u305f\u3081\u3001\u901a\u5e38\u3001\u3053\u308c\u306f\u554f\u984c\u3068\u306f\u306a\u308a\u307e\u305b\u3093\u3002\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u8a2d\u8a08\u306e\u30b7\u30f3\u30d7\u30eb\u5316\u3092\u512a\u5148\u3057\u307e\u3057\u305f\u3002 Pascal\u4e16\u4ee3\u4ee5\u964d\u306eGPU\u3067\u63a1\u7528\u3055\u308c\u305fGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30c7\u30de\u30f3\u30c9\u30da\u30fc\u30b8\u30f3\u30b0\u3092\u307b\u307c\u5168\u9762\u7684\u306b\u63a1\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u591a\u304f\u306f\u5b9f\u969b\u306b\u5b9f\u884c\u3057\u3066\u307f\u308b\u307e\u3067\u5fc5\u8981\u306a\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u306e\u5927\u304d\u3055\u304c\u5206\u304b\u3089\u306a\u3044\u305f\u3081\u3001\u3053\u308c\u307e\u3067\u306f\u5fc5\u8981\u4ee5\u4e0a\u306b\u30d0\u30c3\u30d5\u30a1\u3092\u7372\u5f97\u3057\u3001\u307e\u305f\u30e1\u30e2\u30ea\u4e0d\u8db3\u6642\u306b\u306f\u518d\u5b9f\u884c\u3092\u884c\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u3089\u306f\u540c\u6642\u5b9f\u884c\u30d7\u30ed\u30bb\u30b9\u306e\u5229\u7528\u53ef\u80fd\u306a\u30ea\u30bd\u30fc\u30b9\u3092\u5236\u9650\u3057\u3001\u307e\u305f\u8907\u96d1\u306a\u4f8b\u5916\u30ed\u30b8\u30c3\u30af\u306f\u30d0\u30b0\u306e\u6e29\u5e8a\u3067\u3057\u305f\u3002GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30c7\u30de\u30f3\u30c9\u30da\u30fc\u30b8\u30f3\u30b0\u3092\u5229\u7528\u3059\u308b\u4e8b\u3067\u3001\u8a2d\u8a08\u306e\u30b7\u30f3\u30d7\u30eb\u5316\u3092\u884c\u3044\u307e\u3057\u305f\u3002 CUDA\u306e\u975e\u540c\u671f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5229\u7528\u3092\u6b62\u3081\u307e\u3057\u305f\u3002GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30c7\u30de\u30f3\u30c9\u30da\u30fc\u30b8\u30f3\u30b0\u3092\u5229\u7528\u3059\u308b\u3068\u3001DMA\u8ee2\u9001\u306e\u305f\u3081\u306e\u975e\u540c\u671fAPI\uff08 cuMemCpyHtoD \u306a\u3069\uff09\u306f\u540c\u671f\u7684\u306b\u632f\u821e\u3046\u3088\u3046\u306b\u306a\u308b\u305f\u3081\u3001GPU\u30ab\u30fc\u30cd\u30eb\u306e\u591a\u91cd\u5ea6\u304c\u4f4e\u4e0b\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u4ee3\u308f\u308a\u306bPG-Strom\u81ea\u8eab\u304c\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u3092\u7ba1\u7406\u3057\u3001\u3053\u308c\u3089\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u305d\u308c\u305e\u308c\u540c\u671fAPI\u3092\u547c\u3073\u51fa\u3059\u3088\u3046\u8a2d\u8a08\u5909\u66f4\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u526f\u7523\u7269\u3068\u3057\u3066\u3001\u975e\u540c\u671f\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\uff08 cuStreamAddCallback \uff09\u3092\u5229\u7528\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u3063\u305f\u306e\u3067\u3001MPS\u3092\u5229\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 CPU+GPU\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u4e26\u5217\u5b9f\u884c PostgreSQL v9.6\u3067\u65b0\u305f\u306b\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u305fCPU\u4e26\u5217\u5b9f\u884c\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 PG-Strom\u306e\u63d0\u4f9b\u3059\u308bGpuScan\u3001GpuJoin\u304a\u3088\u3073GpuPreAgg\u306e\u5404\u30ed\u30b8\u30c3\u30af\u306f\u8907\u6570\u306ePostgreSQL\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306b\u3088\u308a\u4e26\u5217\u306b\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 PostgreSQL v9.6\u3067\u306fCPU\u4e26\u5217\u5b9f\u884c\u306e\u969b\u306b EXPLAIN ANALYZE \u3067\u53d6\u5f97\u3059\u308bPG-Strom\u72ec\u81ea\u306e\u7d71\u8a08\u60c5\u5831\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001CustomScan\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9API\u3067 ShutdownCustomScan \u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u305f\u3081\u3001DSM\uff08\u52d5\u7684\u5171\u6709\u30e1\u30e2\u30ea\uff09\u306e\u89e3\u653e\u524d\u306b\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u30d7\u30ed\u30bb\u30b9\u304c\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306e\u60c5\u5831\u3092\u56de\u53ce\u3059\u308b\u624b\u6bb5\u304c\u7121\u304b\u3063\u305f\u305f\u3081\u3067\u3059\u3002 SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c Linux\u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb nvme_strom \u3092\u7528\u3044\u308b\u4e8b\u3067\u3001NVMe\u898f\u683c\u306b\u5bfe\u5fdc\u3057\u305fSSD\u4e0a\u306ePostgreSQL\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092\u3001CPU/RAM\u3092\u4ecb\u3055\u305a\u30c0\u30a4\u30ec\u30af\u30c8\u306bGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u3078\u8ee2\u9001\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002\u30b7\u30b9\u30c6\u30e0RAM\u306b\u8f09\u308a\u5207\u3089\u306a\u3044\u5927\u304d\u3055\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u3067\u3042\u3063\u3066\u3082\u3001\u672c\u6a5f\u80fd\u306b\u3088\u308aPG-Strom\u306e\u9069\u7528\u304c\u73fe\u5b9f\u7684\u306a\u9078\u629e\u80a2\u3068\u306a\u308b\u4e8b\u3067\u3057\u3087\u3046\u3002 \u30d6\u30ed\u30c3\u30af\u30c7\u30d0\u30a4\u30b9\u5c64\u3084\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u7d4c\u7531\u3057\u306a\u3044\u305f\u3081\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9650\u754c\u306b\u8fd1\u3044\u9ad8\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u3092\u5f15\u304d\u51fa\u3059\u4e8b\u304c\u53ef\u80fd\u3067\u3001\u304b\u3064\u3001GPU\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u51e6\u7406\u3059\u308b\u305f\u3081CPU\u306e\u51e6\u7406\u3059\u3079\u304d\u30c7\u30fc\u30bf\u91cf\u3092\u6e1b\u3089\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u7279\u6027\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u3088\u308a\u3001\u4e00\u822c\u7684\u306b\u306f\u8a08\u7b97\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u30a2\u30af\u30bb\u30e9\u30ec\u30fc\u30bf\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u3066\u3044\u308bGPU\u3092\u3001I/O\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u9ad8\u901f\u5316\u306b\u9069\u7528\u3059\u308b\u4e8b\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002 \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5 RAM\u30b5\u30a4\u30ba\u306b\u8f09\u308b\u7a0b\u5ea6\u306e\u5927\u304d\u3055\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u306f\u3001\u3088\u308aGPU\u3067\u306e\u51e6\u7406\u306b\u9069\u3057\u305f\u5217\u30c7\u30fc\u30bf\u5f62\u5f0f\u306b\u5909\u5f62\u3057\u3066\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u969b\u3057\u3066\u3001\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306b\u306fPostgreSQL\u306e\u5171\u6709\u30d0\u30c3\u30d5\u30a1\u3088\u308a\u3082\u3053\u3061\u3089\u3092\u512a\u5148\u3057\u3066\u53c2\u7167\u3057\u307e\u3059\u3002 \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u540c\u671f\u7684\u3001\u307e\u305f\u306f\u975e\u540c\u671f\u7684\u306b\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u521d\u671f\u306ePG-Strom\u3067\u4f3c\u305f\u3088\u3046\u306a\u6a5f\u80fd\u304c\u5b58\u5728\u3057\u3066\u3044\u305f\u4e8b\u3092\u899a\u3048\u3066\u304a\u3089\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002v2.0\u3067\u65b0\u305f\u306b\u5b9f\u88c5\u3055\u308c\u305f\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u3055\u308c\u305f\u884c\u304c\u66f4\u65b0\u3055\u308c\u308b\u3068\u3001\u5f53\u8a72\u884c\u3092\u542b\u3080\u30ad\u30e3\u30c3\u30b7\u30e5\u30d6\u30ed\u30c3\u30af\u3092\u6d88\u53bb\uff08invalidation\uff09\u3057\u307e\u3059\u3002\u884c\u30b9\u30c8\u30a2\u306e\u66f4\u65b0\u306b\u5408\u308f\u305b\u3066\u5217\u30ad\u30e3\u30c3\u30b7\u30e5\u5074\u306e\u66f4\u65b0\u3092\u884c\u3046\u3068\u3044\u3046\u4e8b\u306f\u884c\u308f\u306a\u3044\u305f\u3081\u3001\u66f4\u65b0\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u3059\u308b\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u4f4e\u4e0b\u306f\u9650\u5b9a\u7684\u3067\u3059\u3002 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2(gstore_fdw) GPU\u4e0a\u306b\u78ba\u4fdd\u3057\u305f\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u9818\u57df\u306b\u5bfe\u3057\u3066\u3001\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\uff08Foreign Table\uff09\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5229\u7528\u3057\u3066SQL\u306eSELECT/INSERT/UPDATE/DELETE\u306b\u3088\u308a\u8aad\u307f\u66f8\u304d\u3092\u884c\u3046\u6a5f\u80fd\u3067\u3059\u3002 \u5185\u90e8\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f pgstrom \u578b\u306e\u307f\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001PG-Strom\u306e\u30d0\u30c3\u30d5\u30a1\u5f62\u5f0f KDS_FORMAT_COLUMN \u30bf\u30a4\u30d7\u3068\u540c\u4e00\u306e\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3059\u308b\u3082\u306e\u3067\u3059\u3002\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b\u5834\u5408\u3001LZ\u65b9\u5f0f\u306b\u3088\u308b\u30c7\u30fc\u30bf\u5727\u7e2e\u3092\u884c\u3046\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002 v2.0\u306e\u6642\u70b9\u3067\u306f\u3001GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u306fPL/CUDA\u95a2\u6570\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u3060\u3051\u5229\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 GpuJoin\u3068GpuPreAgg\u306e\u518d\u8a2d\u8a08\u306b\u4f34\u3046\u9ad8\u901f\u5316 \u5f93\u6765\u3001GpuJoin\u3068GpuPreAgg\u3067\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3057\u3066\u3044\u305fDynamic Parallelism\u306e\u5229\u7528\u3092\u3084\u3081\u3001\u51e6\u7406\u30ed\u30b8\u30c3\u30af\u5168\u4f53\u306e\u898b\u76f4\u3057\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u3053\u308c\u306f\u3001GPU\u30b5\u30d6\u30ab\u30fc\u30cd\u30eb\u306e\u8d77\u52d5\u5f8c\u3001\u305d\u306e\u5b8c\u4e86\u3092\u5358\u306b\u5f85\u3063\u3066\u3044\u308b\u3060\u3051\u306eGPU\u30ab\u30fc\u30cd\u30eb\u304c\u5b9f\u884c\u30b9\u30ed\u30c3\u30c8\u3092\u5360\u6709\u3057\u3001GPU\u306e\u4f7f\u7528\u7387\u304c\u4e0a\u304c\u3089\u306a\u3044\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u3063\u305f\u305f\u3081\u3067\u3059\u3002 \u3053\u306e\u518d\u8a2d\u8a08\u306b\u4f34\u3046\u526f\u7523\u7269\u3068\u3057\u3066\u3001GpuJoin\u306e\u30b5\u30b9\u30da\u30f3\u30c9/\u30ec\u30b8\u30e5\u30fc\u30e0\u6a5f\u80fd\u304c\u5b9f\u88c5\u3055\u308c\u307e\u3057\u305f\u3002\u539f\u7406\u4e0a\u3001SQL\u306eJOIN\u51e6\u7406\u306f\u5165\u529b\u3057\u305f\u884c\u6570\u3088\u308a\u3082\u51fa\u529b\u3059\u308b\u884c\u6570\u306e\u65b9\u304c\u5897\u3048\u3066\u3057\u307e\u3046\u4e8b\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u51e6\u7406\u7d50\u679c\u3092\u66f8\u304d\u8fbc\u3080\u30d0\u30c3\u30d5\u30a1\u306e\u6b8b\u308a\u30b5\u30a4\u30ba\u304c\u4e0d\u8db3\u3057\u305f\u6642\u70b9\u3067GpuJoin\u3092\u30b5\u30b9\u30da\u30f3\u30c9\u3057\u3001\u65b0\u3057\u3044\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u3092\u5272\u308a\u5f53\u3066\u3066\u30ec\u30b8\u30e5\u30fc\u30e0\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u306e\u30b5\u30a4\u30ba\u63a8\u5b9a\u304c\u7c21\u7565\u5316\u3055\u308c\u305f\u307b\u304b\u3001\u5b9f\u884c\u6642\u306e\u30d0\u30c3\u30d5\u30a1\u4e0d\u8db3\u306b\u3088\u308b\u518d\u5b9f\u884c\u306e\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002 GpuPreAgg+GpuJoin+GpuScan \u5bc6\u7d50\u5408GPU\u30ab\u30fc\u30cd\u30eb GPU\u3067\u5b9f\u884c\u53ef\u80fd\u306aSCAN\u3001JOIN\u3001GROUP BY\u304c\u9023\u7d9a\u3057\u3066\u3044\u308b\u3068\u304d\u3001\u5bfe\u5fdc\u3059\u308bGpuScan\u3001GpuJoin\u3001GpuPreAgg\u306b\u76f8\u5f53\u3059\u308b\u51e6\u7406\u3092\u4e00\u56de\u306eGPU\u30ab\u30fc\u30cd\u30eb\u547c\u3073\u51fa\u3057\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306f\u3001GpuJoin\u306e\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u3092\u305d\u306e\u307e\u307eGpuPreAgg\u306e\u5165\u529b\u30d0\u30c3\u30d5\u30a1\u3068\u3057\u3066\u6271\u3046\u306a\u3069\u3001CPU\u3068GPU\u306e\u9593\u306e\u30c7\u30fc\u30bf\u4ea4\u63db\u3092\u6700\u5c0f\u9650\u306b\u6291\u3048\u308b\u305f\u3081\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u3059\u3002 \u3053\u306e\u6a5f\u80fd\u306f\u7279\u306b\u3001SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3059\u308b\u3068\u52b9\u679c\u7684\u3067\u3059\u3002 \u65b0\u3057\u3044\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc uuid \u578b\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u578b\uff08 inet \u3001 cidr \u3001\u304a\u3088\u3073 macaddr \uff09\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u7bc4\u56f2\u578b\uff08 int4range \u3001 int8range \u3001 tsrange \u3001 tstzrange \u3001 daterange \uff09\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\uff08 float2 \uff09\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306b\u95a2\u9023\u3059\u308bCPU\u5074\u306e\u5b9f\u88c5\u306fPG-Strom\u306e\u72ec\u81ea\u5b9f\u88c5\u306b\u3088\u308b\u3082\u306e\u3067\u3059\u3002 \u65b0\u3057\u3044\u6f14\u7b97\u5b50/\u95a2\u6570\u306e\u5bfe\u5fdc \u65e5\u4ed8\u6642\u523b\u578b\u306b\u5bfe\u3059\u308b EXTRACT(field FROM timestamp) \u6f14\u7b97\u5b50\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 New data type support uuid type Network address types ( inet , cidr and macaddr ) Range data types ( int4range , int8range , tsrange , tstzrange , daterange ) Half-precision floating point type ( float2 ). Its CPU side are also implemented by PG-Strom itself, not PostgreSQL's built-in feature. New operators / functions EXTRACT(field FROM timestamp) operator on the date and time types PL/CUDA\u95a2\u9023\u306e\u5f37\u5316 #plcuda_include \u306e\u62e1\u5f35\u306b\u3088\u308a\u3001 text \u578b\u3092\u8fd4\u3059SQL\u95a2\u6570\u3092\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u5f15\u6570\u306e\u5024\u306b\u3088\u3063\u3066\u633f\u5165\u3059\u308b\u30b3\u30fc\u30c9\u3092\u5909\u3048\u308b\u4e8b\u304c\u3067\u304d\u308b\u305f\u3081\u3001\u5358\u306b\u5916\u90e8\u5b9a\u7fa9\u95a2\u6570\u3092\u8aad\u307f\u8fbc\u3080\u3060\u3051\u3067\u306a\u304f\u3001\u52d5\u7684\u306b\u3044\u304f\u3064\u3082\u306eGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308a\u51fa\u3059\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002 PL/CUDA\u95a2\u6570\u306e\u5f15\u6570\u306b reggstore \u578b\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001GPU\u30ab\u30fc\u30cd\u30eb\u95a2\u6570\u3078\u306f\u5bfe\u5fdc\u3059\u308bGPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u306e\u30dd\u30a4\u30f3\u30bf\u304c\u6e21\u3055\u308c\u307e\u3059\u3002OID\u5024\u304c\u6e21\u3055\u308c\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u305d\u306e\u4ed6\u306e\u6a5f\u80fd\u5f37\u5316 lo_import_gpu \u304a\u3088\u3073 lo_export_gpu \u95a2\u6570\u306b\u3088\u308a\u3001\u5916\u90e8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u78ba\u4fdd\u3057\u305fGPU\u30e1\u30e2\u30ea\u306e\u5185\u5bb9\u3092\u76f4\u63a5PostgreSQL\u306e\u30e9\u30fc\u30b8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u8a18\u9332\u3057\u305f\u308a\u3001\u9006\u306b\u30e9\u30fc\u30b8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5185\u5bb9\u3092GPU\u30e1\u30e2\u30ea\u306b\u66f8\u304d\u51fa\u3059\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u30d1\u30c3\u30b1\u30fc\u30b8\u30f3\u30b0 PostgreSQL Global Development Group\u306e\u914d\u5e03\u3059\u308bPostgreSQL\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u9069\u5408\u3059\u308b\u3088\u3046\u3001RPM\u30d1\u30c3\u30b1\u30fc\u30b8\u5316\u3092\u884c\u3044\u307e\u3057\u305f\u3002 \u5168\u3066\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u7269\u4ef6\u306fHeteroDB SWDC(Software Distribution Center)\u3088\u308a\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u53ef\u80fd\u3067\u3059\u3002 \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 PG-Strom\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092markdown\u3068mkdocs\u3092\u7528\u3044\u3066\u5168\u9762\u7684\u306b\u66f8\u304d\u76f4\u3057\u307e\u3057\u305f\u3002\u5f93\u6765\u306eHTML\u3092\u7528\u3044\u305f\u30a2\u30d7\u30ed\u30fc\u30c1\u306b\u6bd4\u3079\u3001\u3088\u308a\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u304c\u5bb9\u6613\u3067\u65b0\u6a5f\u80fd\u306e\u958b\u767a\u306b\u5408\u308f\u305b\u305f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u62e1\u5145\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002 \u30c6\u30b9\u30c8 PostgreSQL\u306e\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u7528\u3057\u3066\u3001PG-Strom\u306e\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002 \u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd PostgreSQL v9.5\u30b5\u30dd\u30fc\u30c8 PostgreSQL v9.6\u3067\u306fCPU\u4e26\u5217\u30af\u30a8\u30ea\u306e\u63d0\u4f9b\u306b\u4f34\u3044\u3001\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6/\u30a8\u30b0\u30bc\u30ad\u30e5\u30fc\u30bf\u5171\u306b\u5927\u304d\u306a\u4fee\u6b63\u304c\u52a0\u3048\u3089\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u3068\u5bc6\u63a5\u306b\u9023\u643a\u3059\u308b\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u3068\u3063\u3066\u6700\u3082\u30a4\u30f3\u30d1\u30af\u30c8\u306e\u5927\u304d\u306a\u5909\u66f4\u306f\u300eupper planner path-ification\u300f\u3068\u547c\u3070\u308c\u308b\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5f37\u5316\u3067\u3001\u96c6\u7d04\u6f14\u7b97\u3084\u30bd\u30fc\u30c8\u306a\u3069\u306e\u5b9f\u884c\u8a08\u753b\u3082\u30b3\u30b9\u30c8\u30d9\u30fc\u30b9\u3067\u8907\u6570\u306e\u7570\u306a\u308b\u65b9\u6cd5\u3092\u6bd4\u8f03\u3057\u3066\u6700\u9069\u306a\u3082\u306e\u3092\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u3053\u308c\u306fGpuPreAgg\u3092\u5b9f\u88c5\u3059\u308b\u305f\u3081\u306b\u30d5\u30c3\u30af\u3092\u5229\u7528\u3057\u3066\u5b9f\u884c\u8a08\u753b\u3092\u66f8\u304d\u63db\u3048\u3066\u3044\u305f\u5f93\u6765\u306e\u65b9\u6cd5\u3068\u306f\u6839\u672c\u7684\u306b\u7570\u306a\u308a\u3001\u3088\u308a\u5408\u7406\u7684\u304b\u3064\u4fe1\u983c\u3067\u304d\u308b\u65b9\u6cd5\u3067GPU\u3092\u7528\u3044\u305f\u96c6\u7d04\u6f14\u7b97\u3092\u633f\u5165\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u3001\u30d0\u30b0\u306e\u6e29\u5e8a\u3067\u3042\u3063\u305f\u5b9f\u884c\u8a08\u753b\u306e\u66f8\u304d\u63db\u3048\u30ed\u30b8\u30c3\u30af\u3092\u6368\u3066\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u540c\u6642\u306b\u3001CustomScan\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u3082CPU\u4e26\u5217\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u306eAPI\u304c\u62e1\u5f35\u3055\u308c\u3001\u3053\u308c\u3089\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u306bPostgreSQL v9.5\u30b5\u30dd\u30fc\u30c8\u306f\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002 GpuSort\u6a5f\u80fd GpuSort\u6a5f\u80fd\u306f\u6027\u80fd\u4e0a\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u5f97\u3089\u308c\u306a\u3044\u305f\u3081\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002 \u30bd\u30fc\u30c8\u306fGPU\u306e\u5f97\u610f\u3068\u3059\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u4e00\u3064\u3067\u3059\u3002\u3057\u304b\u3057\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5927\u304d\u3055\u3092\u8d8a\u3048\u308b\u30b5\u30a4\u30ba\u306e\u30c7\u30fc\u30bf\u3092\u30bd\u30fc\u30c8\u3059\u308b\u5834\u5408\u3001\u8907\u6570\u306e\u30c1\u30e3\u30f3\u30af\u306b\u5206\u5272\u3057\u3066\u90e8\u5206\u30bd\u30fc\u30c8\u3092\u884c\u3044\u3001\u5f8c\u3067CPU\u5074\u3067\u3053\u308c\u3092\u7d50\u5408\u3057\u3066\u6700\u7d42\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u7d50\u5408\u30d5\u30a7\u30fc\u30ba\u306e\u51e6\u7406\u3092\u8efd\u304f\u3059\u308b\u306b\u306f\u3001GPU\u3067\u30bd\u30fc\u30c8\u3059\u3079\u304d\u30c1\u30e3\u30f3\u30af\u306e\u30b5\u30a4\u30ba\u3092\u5927\u304d\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u4e00\u65b9\u3067\u30c1\u30e3\u30f3\u30af\u30b5\u30a4\u30ba\u304c\u5927\u304d\u304f\u306a\u308b\u3068\u30bd\u30fc\u30c8\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\u305f\u3081\u306e\u30ea\u30fc\u30c9\u30bf\u30a4\u30e0\u304c\u9577\u304f\u306a\u308a\u3001PG-Strom\u306e\u7279\u9577\u306e\u4e00\u3064\u3067\u3042\u308b\u975e\u540c\u671f\u51e6\u7406\u306b\u3088\u308b\u30c7\u30fc\u30bf\u8ee2\u9001\u30ec\u30a4\u30c6\u30f3\u30b7\u306e\u96a0\u307a\u3044\u304c\u52b9\u304b\u306a\u304f\u306a\u308b\u3068\u3044\u3046\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u554f\u984c\u306b\u5bfe\u51e6\u3059\u308b\u306e\u306f\u56f0\u96e3\u3001\u5c11\u306a\u304f\u3068\u3082\u6642\u671f\u5c1a\u65e9\u3067\u3042\u308b\u3068\u5224\u65ad\u3057\u3001GpuSort\u6a5f\u80fd\u306f\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002","title":"PG-Strom v2.0"},{"location":"release_v2.0/#pg-strom-v20","text":"PG-Strom Development Team (17-Apr-2018)","title":"PG-Strom v2.0\u30ea\u30ea\u30fc\u30b9"},{"location":"release_v2.0/#_1","text":"PG-Strom v2.0\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u6a5f\u80fd\u5f37\u5316\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 GPU\u3092\u7ba1\u7406\u3059\u308b\u5185\u90e8\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u306e\u5168\u4f53\u7684\u306a\u518d\u8a2d\u8a08\u3068\u5b89\u5b9a\u5316 CPU+GPU\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u4e26\u5217\u5b9f\u884c SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2(store_fdw) GpuJoin\u3068GpuPreAgg\u306e\u518d\u8a2d\u8a08\u306b\u4f34\u3046\u9ad8\u901f\u5316 GpuPreAgg+GpuJoin+GpuScan \u5bc6\u7d50\u5408GPU\u30ab\u30fc\u30cd\u30eb \u65b0\u6a5f\u80fd\u306e\u30b5\u30de\u30ea\u306f\u3053\u3061\u3089\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\uff1a PG-Strom v2.0 Technical Brief .","title":"\u6982\u8981"},{"location":"release_v2.0/#_2","text":"PostgreSQL v9.6, v10 CUDA Toolkit 9.1 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d)","title":"\u52d5\u4f5c\u74b0\u5883"},{"location":"release_v2.0/#_3","text":"GPU\u3092\u7ba1\u7406\u3059\u308b\u5185\u90e8\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u306e\u5168\u4f53\u7684\u306a\u518d\u8a2d\u8a08\u3068\u5b89\u5b9a\u5316 PostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306f\u540c\u6642\u306b\uff11\u500b\u306eGPU\u3060\u3051\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u30de\u30eb\u30c1GPU\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u306fPostgreSQL\u306eCPU\u4e26\u5217\u3068\u306e\u4f75\u7528\u304c\u524d\u63d0\u306b\u306a\u308a\u307e\u3059\u304c\u3001CPU\u30b9\u30ec\u30c3\u30c9\u304cGPU\u3078\u30c7\u30fc\u30bf\u3092\u4f9b\u7d66\u3059\u308b\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u306fGPU\u306e\u51e6\u7406\u80fd\u529b\u3088\u308a\u3082\u305a\u3063\u3068\u4f4e\u3044\u305f\u3081\u3001\u901a\u5e38\u3001\u3053\u308c\u306f\u554f\u984c\u3068\u306f\u306a\u308a\u307e\u305b\u3093\u3002\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u8a2d\u8a08\u306e\u30b7\u30f3\u30d7\u30eb\u5316\u3092\u512a\u5148\u3057\u307e\u3057\u305f\u3002 Pascal\u4e16\u4ee3\u4ee5\u964d\u306eGPU\u3067\u63a1\u7528\u3055\u308c\u305fGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30c7\u30de\u30f3\u30c9\u30da\u30fc\u30b8\u30f3\u30b0\u3092\u307b\u307c\u5168\u9762\u7684\u306b\u63a1\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u591a\u304f\u306f\u5b9f\u969b\u306b\u5b9f\u884c\u3057\u3066\u307f\u308b\u307e\u3067\u5fc5\u8981\u306a\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u306e\u5927\u304d\u3055\u304c\u5206\u304b\u3089\u306a\u3044\u305f\u3081\u3001\u3053\u308c\u307e\u3067\u306f\u5fc5\u8981\u4ee5\u4e0a\u306b\u30d0\u30c3\u30d5\u30a1\u3092\u7372\u5f97\u3057\u3001\u307e\u305f\u30e1\u30e2\u30ea\u4e0d\u8db3\u6642\u306b\u306f\u518d\u5b9f\u884c\u3092\u884c\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u3089\u306f\u540c\u6642\u5b9f\u884c\u30d7\u30ed\u30bb\u30b9\u306e\u5229\u7528\u53ef\u80fd\u306a\u30ea\u30bd\u30fc\u30b9\u3092\u5236\u9650\u3057\u3001\u307e\u305f\u8907\u96d1\u306a\u4f8b\u5916\u30ed\u30b8\u30c3\u30af\u306f\u30d0\u30b0\u306e\u6e29\u5e8a\u3067\u3057\u305f\u3002GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30c7\u30de\u30f3\u30c9\u30da\u30fc\u30b8\u30f3\u30b0\u3092\u5229\u7528\u3059\u308b\u4e8b\u3067\u3001\u8a2d\u8a08\u306e\u30b7\u30f3\u30d7\u30eb\u5316\u3092\u884c\u3044\u307e\u3057\u305f\u3002 CUDA\u306e\u975e\u540c\u671f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5229\u7528\u3092\u6b62\u3081\u307e\u3057\u305f\u3002GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30c7\u30de\u30f3\u30c9\u30da\u30fc\u30b8\u30f3\u30b0\u3092\u5229\u7528\u3059\u308b\u3068\u3001DMA\u8ee2\u9001\u306e\u305f\u3081\u306e\u975e\u540c\u671fAPI\uff08 cuMemCpyHtoD \u306a\u3069\uff09\u306f\u540c\u671f\u7684\u306b\u632f\u821e\u3046\u3088\u3046\u306b\u306a\u308b\u305f\u3081\u3001GPU\u30ab\u30fc\u30cd\u30eb\u306e\u591a\u91cd\u5ea6\u304c\u4f4e\u4e0b\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u4ee3\u308f\u308a\u306bPG-Strom\u81ea\u8eab\u304c\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u3092\u7ba1\u7406\u3057\u3001\u3053\u308c\u3089\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u305d\u308c\u305e\u308c\u540c\u671fAPI\u3092\u547c\u3073\u51fa\u3059\u3088\u3046\u8a2d\u8a08\u5909\u66f4\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u526f\u7523\u7269\u3068\u3057\u3066\u3001\u975e\u540c\u671f\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\uff08 cuStreamAddCallback \uff09\u3092\u5229\u7528\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u3063\u305f\u306e\u3067\u3001MPS\u3092\u5229\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 CPU+GPU\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u4e26\u5217\u5b9f\u884c PostgreSQL v9.6\u3067\u65b0\u305f\u306b\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u305fCPU\u4e26\u5217\u5b9f\u884c\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 PG-Strom\u306e\u63d0\u4f9b\u3059\u308bGpuScan\u3001GpuJoin\u304a\u3088\u3073GpuPreAgg\u306e\u5404\u30ed\u30b8\u30c3\u30af\u306f\u8907\u6570\u306ePostgreSQL\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306b\u3088\u308a\u4e26\u5217\u306b\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 PostgreSQL v9.6\u3067\u306fCPU\u4e26\u5217\u5b9f\u884c\u306e\u969b\u306b EXPLAIN ANALYZE \u3067\u53d6\u5f97\u3059\u308bPG-Strom\u72ec\u81ea\u306e\u7d71\u8a08\u60c5\u5831\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001CustomScan\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9API\u3067 ShutdownCustomScan \u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u305f\u3081\u3001DSM\uff08\u52d5\u7684\u5171\u6709\u30e1\u30e2\u30ea\uff09\u306e\u89e3\u653e\u524d\u306b\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u30d7\u30ed\u30bb\u30b9\u304c\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306e\u60c5\u5831\u3092\u56de\u53ce\u3059\u308b\u624b\u6bb5\u304c\u7121\u304b\u3063\u305f\u305f\u3081\u3067\u3059\u3002 SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c Linux\u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb nvme_strom \u3092\u7528\u3044\u308b\u4e8b\u3067\u3001NVMe\u898f\u683c\u306b\u5bfe\u5fdc\u3057\u305fSSD\u4e0a\u306ePostgreSQL\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092\u3001CPU/RAM\u3092\u4ecb\u3055\u305a\u30c0\u30a4\u30ec\u30af\u30c8\u306bGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u3078\u8ee2\u9001\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002\u30b7\u30b9\u30c6\u30e0RAM\u306b\u8f09\u308a\u5207\u3089\u306a\u3044\u5927\u304d\u3055\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u3067\u3042\u3063\u3066\u3082\u3001\u672c\u6a5f\u80fd\u306b\u3088\u308aPG-Strom\u306e\u9069\u7528\u304c\u73fe\u5b9f\u7684\u306a\u9078\u629e\u80a2\u3068\u306a\u308b\u4e8b\u3067\u3057\u3087\u3046\u3002 \u30d6\u30ed\u30c3\u30af\u30c7\u30d0\u30a4\u30b9\u5c64\u3084\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u7d4c\u7531\u3057\u306a\u3044\u305f\u3081\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9650\u754c\u306b\u8fd1\u3044\u9ad8\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u3092\u5f15\u304d\u51fa\u3059\u4e8b\u304c\u53ef\u80fd\u3067\u3001\u304b\u3064\u3001GPU\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u51e6\u7406\u3059\u308b\u305f\u3081CPU\u306e\u51e6\u7406\u3059\u3079\u304d\u30c7\u30fc\u30bf\u91cf\u3092\u6e1b\u3089\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u7279\u6027\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u3088\u308a\u3001\u4e00\u822c\u7684\u306b\u306f\u8a08\u7b97\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u30a2\u30af\u30bb\u30e9\u30ec\u30fc\u30bf\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u3066\u3044\u308bGPU\u3092\u3001I/O\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u9ad8\u901f\u5316\u306b\u9069\u7528\u3059\u308b\u4e8b\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002 \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5 RAM\u30b5\u30a4\u30ba\u306b\u8f09\u308b\u7a0b\u5ea6\u306e\u5927\u304d\u3055\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u306f\u3001\u3088\u308aGPU\u3067\u306e\u51e6\u7406\u306b\u9069\u3057\u305f\u5217\u30c7\u30fc\u30bf\u5f62\u5f0f\u306b\u5909\u5f62\u3057\u3066\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u969b\u3057\u3066\u3001\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306b\u306fPostgreSQL\u306e\u5171\u6709\u30d0\u30c3\u30d5\u30a1\u3088\u308a\u3082\u3053\u3061\u3089\u3092\u512a\u5148\u3057\u3066\u53c2\u7167\u3057\u307e\u3059\u3002 \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u540c\u671f\u7684\u3001\u307e\u305f\u306f\u975e\u540c\u671f\u7684\u306b\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u521d\u671f\u306ePG-Strom\u3067\u4f3c\u305f\u3088\u3046\u306a\u6a5f\u80fd\u304c\u5b58\u5728\u3057\u3066\u3044\u305f\u4e8b\u3092\u899a\u3048\u3066\u304a\u3089\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002v2.0\u3067\u65b0\u305f\u306b\u5b9f\u88c5\u3055\u308c\u305f\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u3055\u308c\u305f\u884c\u304c\u66f4\u65b0\u3055\u308c\u308b\u3068\u3001\u5f53\u8a72\u884c\u3092\u542b\u3080\u30ad\u30e3\u30c3\u30b7\u30e5\u30d6\u30ed\u30c3\u30af\u3092\u6d88\u53bb\uff08invalidation\uff09\u3057\u307e\u3059\u3002\u884c\u30b9\u30c8\u30a2\u306e\u66f4\u65b0\u306b\u5408\u308f\u305b\u3066\u5217\u30ad\u30e3\u30c3\u30b7\u30e5\u5074\u306e\u66f4\u65b0\u3092\u884c\u3046\u3068\u3044\u3046\u4e8b\u306f\u884c\u308f\u306a\u3044\u305f\u3081\u3001\u66f4\u65b0\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u3059\u308b\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u4f4e\u4e0b\u306f\u9650\u5b9a\u7684\u3067\u3059\u3002 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2(gstore_fdw) GPU\u4e0a\u306b\u78ba\u4fdd\u3057\u305f\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u9818\u57df\u306b\u5bfe\u3057\u3066\u3001\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\uff08Foreign Table\uff09\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5229\u7528\u3057\u3066SQL\u306eSELECT/INSERT/UPDATE/DELETE\u306b\u3088\u308a\u8aad\u307f\u66f8\u304d\u3092\u884c\u3046\u6a5f\u80fd\u3067\u3059\u3002 \u5185\u90e8\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f pgstrom \u578b\u306e\u307f\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001PG-Strom\u306e\u30d0\u30c3\u30d5\u30a1\u5f62\u5f0f KDS_FORMAT_COLUMN \u30bf\u30a4\u30d7\u3068\u540c\u4e00\u306e\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3059\u308b\u3082\u306e\u3067\u3059\u3002\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b\u5834\u5408\u3001LZ\u65b9\u5f0f\u306b\u3088\u308b\u30c7\u30fc\u30bf\u5727\u7e2e\u3092\u884c\u3046\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002 v2.0\u306e\u6642\u70b9\u3067\u306f\u3001GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u306fPL/CUDA\u95a2\u6570\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u3060\u3051\u5229\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 GpuJoin\u3068GpuPreAgg\u306e\u518d\u8a2d\u8a08\u306b\u4f34\u3046\u9ad8\u901f\u5316 \u5f93\u6765\u3001GpuJoin\u3068GpuPreAgg\u3067\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3057\u3066\u3044\u305fDynamic Parallelism\u306e\u5229\u7528\u3092\u3084\u3081\u3001\u51e6\u7406\u30ed\u30b8\u30c3\u30af\u5168\u4f53\u306e\u898b\u76f4\u3057\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u3053\u308c\u306f\u3001GPU\u30b5\u30d6\u30ab\u30fc\u30cd\u30eb\u306e\u8d77\u52d5\u5f8c\u3001\u305d\u306e\u5b8c\u4e86\u3092\u5358\u306b\u5f85\u3063\u3066\u3044\u308b\u3060\u3051\u306eGPU\u30ab\u30fc\u30cd\u30eb\u304c\u5b9f\u884c\u30b9\u30ed\u30c3\u30c8\u3092\u5360\u6709\u3057\u3001GPU\u306e\u4f7f\u7528\u7387\u304c\u4e0a\u304c\u3089\u306a\u3044\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u3063\u305f\u305f\u3081\u3067\u3059\u3002 \u3053\u306e\u518d\u8a2d\u8a08\u306b\u4f34\u3046\u526f\u7523\u7269\u3068\u3057\u3066\u3001GpuJoin\u306e\u30b5\u30b9\u30da\u30f3\u30c9/\u30ec\u30b8\u30e5\u30fc\u30e0\u6a5f\u80fd\u304c\u5b9f\u88c5\u3055\u308c\u307e\u3057\u305f\u3002\u539f\u7406\u4e0a\u3001SQL\u306eJOIN\u51e6\u7406\u306f\u5165\u529b\u3057\u305f\u884c\u6570\u3088\u308a\u3082\u51fa\u529b\u3059\u308b\u884c\u6570\u306e\u65b9\u304c\u5897\u3048\u3066\u3057\u307e\u3046\u4e8b\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u51e6\u7406\u7d50\u679c\u3092\u66f8\u304d\u8fbc\u3080\u30d0\u30c3\u30d5\u30a1\u306e\u6b8b\u308a\u30b5\u30a4\u30ba\u304c\u4e0d\u8db3\u3057\u305f\u6642\u70b9\u3067GpuJoin\u3092\u30b5\u30b9\u30da\u30f3\u30c9\u3057\u3001\u65b0\u3057\u3044\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u3092\u5272\u308a\u5f53\u3066\u3066\u30ec\u30b8\u30e5\u30fc\u30e0\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u306e\u30b5\u30a4\u30ba\u63a8\u5b9a\u304c\u7c21\u7565\u5316\u3055\u308c\u305f\u307b\u304b\u3001\u5b9f\u884c\u6642\u306e\u30d0\u30c3\u30d5\u30a1\u4e0d\u8db3\u306b\u3088\u308b\u518d\u5b9f\u884c\u306e\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002 GpuPreAgg+GpuJoin+GpuScan \u5bc6\u7d50\u5408GPU\u30ab\u30fc\u30cd\u30eb GPU\u3067\u5b9f\u884c\u53ef\u80fd\u306aSCAN\u3001JOIN\u3001GROUP BY\u304c\u9023\u7d9a\u3057\u3066\u3044\u308b\u3068\u304d\u3001\u5bfe\u5fdc\u3059\u308bGpuScan\u3001GpuJoin\u3001GpuPreAgg\u306b\u76f8\u5f53\u3059\u308b\u51e6\u7406\u3092\u4e00\u56de\u306eGPU\u30ab\u30fc\u30cd\u30eb\u547c\u3073\u51fa\u3057\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306f\u3001GpuJoin\u306e\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u3092\u305d\u306e\u307e\u307eGpuPreAgg\u306e\u5165\u529b\u30d0\u30c3\u30d5\u30a1\u3068\u3057\u3066\u6271\u3046\u306a\u3069\u3001CPU\u3068GPU\u306e\u9593\u306e\u30c7\u30fc\u30bf\u4ea4\u63db\u3092\u6700\u5c0f\u9650\u306b\u6291\u3048\u308b\u305f\u3081\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u3059\u3002 \u3053\u306e\u6a5f\u80fd\u306f\u7279\u306b\u3001SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3059\u308b\u3068\u52b9\u679c\u7684\u3067\u3059\u3002 \u65b0\u3057\u3044\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc uuid \u578b\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u578b\uff08 inet \u3001 cidr \u3001\u304a\u3088\u3073 macaddr \uff09\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u7bc4\u56f2\u578b\uff08 int4range \u3001 int8range \u3001 tsrange \u3001 tstzrange \u3001 daterange \uff09\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\uff08 float2 \uff09\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306b\u95a2\u9023\u3059\u308bCPU\u5074\u306e\u5b9f\u88c5\u306fPG-Strom\u306e\u72ec\u81ea\u5b9f\u88c5\u306b\u3088\u308b\u3082\u306e\u3067\u3059\u3002 \u65b0\u3057\u3044\u6f14\u7b97\u5b50/\u95a2\u6570\u306e\u5bfe\u5fdc \u65e5\u4ed8\u6642\u523b\u578b\u306b\u5bfe\u3059\u308b EXTRACT(field FROM timestamp) \u6f14\u7b97\u5b50\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 New data type support uuid type Network address types ( inet , cidr and macaddr ) Range data types ( int4range , int8range , tsrange , tstzrange , daterange ) Half-precision floating point type ( float2 ). Its CPU side are also implemented by PG-Strom itself, not PostgreSQL's built-in feature. New operators / functions EXTRACT(field FROM timestamp) operator on the date and time types PL/CUDA\u95a2\u9023\u306e\u5f37\u5316 #plcuda_include \u306e\u62e1\u5f35\u306b\u3088\u308a\u3001 text \u578b\u3092\u8fd4\u3059SQL\u95a2\u6570\u3092\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u5f15\u6570\u306e\u5024\u306b\u3088\u3063\u3066\u633f\u5165\u3059\u308b\u30b3\u30fc\u30c9\u3092\u5909\u3048\u308b\u4e8b\u304c\u3067\u304d\u308b\u305f\u3081\u3001\u5358\u306b\u5916\u90e8\u5b9a\u7fa9\u95a2\u6570\u3092\u8aad\u307f\u8fbc\u3080\u3060\u3051\u3067\u306a\u304f\u3001\u52d5\u7684\u306b\u3044\u304f\u3064\u3082\u306eGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308a\u51fa\u3059\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002 PL/CUDA\u95a2\u6570\u306e\u5f15\u6570\u306b reggstore \u578b\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001GPU\u30ab\u30fc\u30cd\u30eb\u95a2\u6570\u3078\u306f\u5bfe\u5fdc\u3059\u308bGPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u306e\u30dd\u30a4\u30f3\u30bf\u304c\u6e21\u3055\u308c\u307e\u3059\u3002OID\u5024\u304c\u6e21\u3055\u308c\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u305d\u306e\u4ed6\u306e\u6a5f\u80fd\u5f37\u5316 lo_import_gpu \u304a\u3088\u3073 lo_export_gpu \u95a2\u6570\u306b\u3088\u308a\u3001\u5916\u90e8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u78ba\u4fdd\u3057\u305fGPU\u30e1\u30e2\u30ea\u306e\u5185\u5bb9\u3092\u76f4\u63a5PostgreSQL\u306e\u30e9\u30fc\u30b8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u8a18\u9332\u3057\u305f\u308a\u3001\u9006\u306b\u30e9\u30fc\u30b8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5185\u5bb9\u3092GPU\u30e1\u30e2\u30ea\u306b\u66f8\u304d\u51fa\u3059\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u30d1\u30c3\u30b1\u30fc\u30b8\u30f3\u30b0 PostgreSQL Global Development Group\u306e\u914d\u5e03\u3059\u308bPostgreSQL\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u9069\u5408\u3059\u308b\u3088\u3046\u3001RPM\u30d1\u30c3\u30b1\u30fc\u30b8\u5316\u3092\u884c\u3044\u307e\u3057\u305f\u3002 \u5168\u3066\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u7269\u4ef6\u306fHeteroDB SWDC(Software Distribution Center)\u3088\u308a\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u53ef\u80fd\u3067\u3059\u3002 \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 PG-Strom\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092markdown\u3068mkdocs\u3092\u7528\u3044\u3066\u5168\u9762\u7684\u306b\u66f8\u304d\u76f4\u3057\u307e\u3057\u305f\u3002\u5f93\u6765\u306eHTML\u3092\u7528\u3044\u305f\u30a2\u30d7\u30ed\u30fc\u30c1\u306b\u6bd4\u3079\u3001\u3088\u308a\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u304c\u5bb9\u6613\u3067\u65b0\u6a5f\u80fd\u306e\u958b\u767a\u306b\u5408\u308f\u305b\u305f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u62e1\u5145\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002 \u30c6\u30b9\u30c8 PostgreSQL\u306e\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u7528\u3057\u3066\u3001PG-Strom\u306e\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002","title":"\u65b0\u6a5f\u80fd"},{"location":"release_v2.0/#_4","text":"PostgreSQL v9.5\u30b5\u30dd\u30fc\u30c8 PostgreSQL v9.6\u3067\u306fCPU\u4e26\u5217\u30af\u30a8\u30ea\u306e\u63d0\u4f9b\u306b\u4f34\u3044\u3001\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6/\u30a8\u30b0\u30bc\u30ad\u30e5\u30fc\u30bf\u5171\u306b\u5927\u304d\u306a\u4fee\u6b63\u304c\u52a0\u3048\u3089\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u3068\u5bc6\u63a5\u306b\u9023\u643a\u3059\u308b\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u3068\u3063\u3066\u6700\u3082\u30a4\u30f3\u30d1\u30af\u30c8\u306e\u5927\u304d\u306a\u5909\u66f4\u306f\u300eupper planner path-ification\u300f\u3068\u547c\u3070\u308c\u308b\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5f37\u5316\u3067\u3001\u96c6\u7d04\u6f14\u7b97\u3084\u30bd\u30fc\u30c8\u306a\u3069\u306e\u5b9f\u884c\u8a08\u753b\u3082\u30b3\u30b9\u30c8\u30d9\u30fc\u30b9\u3067\u8907\u6570\u306e\u7570\u306a\u308b\u65b9\u6cd5\u3092\u6bd4\u8f03\u3057\u3066\u6700\u9069\u306a\u3082\u306e\u3092\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u3053\u308c\u306fGpuPreAgg\u3092\u5b9f\u88c5\u3059\u308b\u305f\u3081\u306b\u30d5\u30c3\u30af\u3092\u5229\u7528\u3057\u3066\u5b9f\u884c\u8a08\u753b\u3092\u66f8\u304d\u63db\u3048\u3066\u3044\u305f\u5f93\u6765\u306e\u65b9\u6cd5\u3068\u306f\u6839\u672c\u7684\u306b\u7570\u306a\u308a\u3001\u3088\u308a\u5408\u7406\u7684\u304b\u3064\u4fe1\u983c\u3067\u304d\u308b\u65b9\u6cd5\u3067GPU\u3092\u7528\u3044\u305f\u96c6\u7d04\u6f14\u7b97\u3092\u633f\u5165\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u3001\u30d0\u30b0\u306e\u6e29\u5e8a\u3067\u3042\u3063\u305f\u5b9f\u884c\u8a08\u753b\u306e\u66f8\u304d\u63db\u3048\u30ed\u30b8\u30c3\u30af\u3092\u6368\u3066\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u540c\u6642\u306b\u3001CustomScan\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u3082CPU\u4e26\u5217\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u306eAPI\u304c\u62e1\u5f35\u3055\u308c\u3001\u3053\u308c\u3089\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u306bPostgreSQL v9.5\u30b5\u30dd\u30fc\u30c8\u306f\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002 GpuSort\u6a5f\u80fd GpuSort\u6a5f\u80fd\u306f\u6027\u80fd\u4e0a\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u5f97\u3089\u308c\u306a\u3044\u305f\u3081\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002 \u30bd\u30fc\u30c8\u306fGPU\u306e\u5f97\u610f\u3068\u3059\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u4e00\u3064\u3067\u3059\u3002\u3057\u304b\u3057\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5927\u304d\u3055\u3092\u8d8a\u3048\u308b\u30b5\u30a4\u30ba\u306e\u30c7\u30fc\u30bf\u3092\u30bd\u30fc\u30c8\u3059\u308b\u5834\u5408\u3001\u8907\u6570\u306e\u30c1\u30e3\u30f3\u30af\u306b\u5206\u5272\u3057\u3066\u90e8\u5206\u30bd\u30fc\u30c8\u3092\u884c\u3044\u3001\u5f8c\u3067CPU\u5074\u3067\u3053\u308c\u3092\u7d50\u5408\u3057\u3066\u6700\u7d42\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u7d50\u5408\u30d5\u30a7\u30fc\u30ba\u306e\u51e6\u7406\u3092\u8efd\u304f\u3059\u308b\u306b\u306f\u3001GPU\u3067\u30bd\u30fc\u30c8\u3059\u3079\u304d\u30c1\u30e3\u30f3\u30af\u306e\u30b5\u30a4\u30ba\u3092\u5927\u304d\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u4e00\u65b9\u3067\u30c1\u30e3\u30f3\u30af\u30b5\u30a4\u30ba\u304c\u5927\u304d\u304f\u306a\u308b\u3068\u30bd\u30fc\u30c8\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\u305f\u3081\u306e\u30ea\u30fc\u30c9\u30bf\u30a4\u30e0\u304c\u9577\u304f\u306a\u308a\u3001PG-Strom\u306e\u7279\u9577\u306e\u4e00\u3064\u3067\u3042\u308b\u975e\u540c\u671f\u51e6\u7406\u306b\u3088\u308b\u30c7\u30fc\u30bf\u8ee2\u9001\u30ec\u30a4\u30c6\u30f3\u30b7\u306e\u96a0\u307a\u3044\u304c\u52b9\u304b\u306a\u304f\u306a\u308b\u3068\u3044\u3046\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u554f\u984c\u306b\u5bfe\u51e6\u3059\u308b\u306e\u306f\u56f0\u96e3\u3001\u5c11\u306a\u304f\u3068\u3082\u6642\u671f\u5c1a\u65e9\u3067\u3042\u308b\u3068\u5224\u65ad\u3057\u3001GpuSort\u6a5f\u80fd\u306f\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002","title":"\u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd"},{"location":"release_v2.2/","text":"PG-Strom v2.2\u30ea\u30ea\u30fc\u30b9 PG-Strom Development Team (1-May-2019) \u6982\u8981 PG-Strom v2.2\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u6a5f\u80fd\u5f37\u5316\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3078\u306e\u5bfe\u5fdc Arrow_Fdw\u306b\u3088\u308b\u5217\u6307\u5411\u30b9\u30c8\u30a2\u306e\u30b5\u30dd\u30fc\u30c8 \u30d3\u30eb\u30c9\u6e08\u307fGPU\u30d0\u30a4\u30ca\u30ea\u3078\u306e\u5bfe\u5fdc Jsonb\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc \u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b\u3092\u8fd4\u3059GPU\u95a2\u6570\u306e\u5bfe\u5fdc GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\uff08Gstore_Fdw\uff09\u306e\u30bd\u30fc\u30c8\u5bfe\u5fdc NVMEoF\u3078\u306e\u5bfe\u5fdc\uff08\u5b9f\u9a13\u7684\u6a5f\u80fd\uff09 \u52d5\u4f5c\u74b0\u5883 PostgreSQL v9.6, v10, v11 CUDA Toolkit 10.1 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d) \u65b0\u6a5f\u80fd \u30c6\u30fc\u30d6\u30eb\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3078\u306e\u5bfe\u5fdc \u30de\u30eb\u30c1GPU\u69cb\u6210\u306e\u5834\u5408\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3092\u69cb\u6210\u3059\u308b\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u7269\u7406\u7684\u306aGPU\u3068\u306e\u8ddd\u96e2\u306b\u5fdc\u3058\u3066\u6700\u9069\u306aGPU\u3092\u9078\u629e\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002NVME-oF\u74b0\u5883\u306a\u3069PCIe\u30d0\u30b9\u306e\u69cb\u6210\u3060\u3051\u3067\u306f\u6700\u9069\u8ddd\u96e2\u3092\u5224\u65ad\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u3001DB\u7ba1\u7406\u8005\u306f pg_strom.nvme_distance_map \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u7528\u3044\u3066\u5bfe\u5fdc\u95a2\u4fc2\u3092\u8a2d\u5b9a\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3068\u306eJOIN\u6642\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3068\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3068\u306eJOIN\u3092\u884c\u3063\u305f\u5f8c\u3001\u5404\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u51e6\u7406\u7d50\u679c\u3092\u7d50\u5408\u3059\u308b\u3088\u3046\u306a\u5b9f\u884c\u8a08\u753b\u3092\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u672c\u6a5f\u80fd\u306f Asymmetric Partition-wise JOIN \u3068\u3044\u3046\u540d\u79f0\u3067PostgreSQL v13\u306e\u672c\u4f53\u6a5f\u80fd\u3078\u3068\u63d0\u6848\u3055\u308c\u3066\u3044\u307e\u3059\u3002 Arrow_Fdw\u306b\u3088\u308b\u5217\u6307\u5411\u30b9\u30c8\u30a2\u306e\u30b5\u30dd\u30fc\u30c8 \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u7d4c\u7531\u3067Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u51fa\u3057\u306b\u5bfe\u5fdc\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 SSD-to-GPU Direct SQL\u3092\u7528\u3044\u305fApache Arrow\u306e\u8aad\u307f\u51fa\u3057\u3068SQL\u5b9f\u884c\u306b\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 \u30d3\u30eb\u30c9\u6e08\u307fGPU\u30d0\u30a4\u30ca\u30ea\u3078\u306e\u5bfe\u5fdc SQL\u304b\u3089GPU\u30d0\u30a4\u30ca\u30ea\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b\u969b\u3001\u5f93\u6765\u306f\u52d5\u7684\u306b\u5909\u66f4\u3059\u308b\u8981\u7d20\u306e\u306a\u3044\u95a2\u6570\u7fa4\uff08\u30e9\u30a4\u30d6\u30e9\u30ea\u95a2\u6570\u306b\u9177\u4f3c\uff09\u3082\u542b\u3081\u3066CUDA C\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3057\u3001\u305d\u308c\u3092NVRTC(NVIDIA Run-Time Compiler)\u3092\u7528\u3044\u3066\u30d3\u30eb\u30c9\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u4e00\u90e8\u306e\u8907\u96d1\u306a\u95a2\u6570\u306e\u5f71\u97ff\u3067\u30d3\u30eb\u30c9\u6642\u9593\u304c\u6975\u7aef\u306b\u9577\u304f\u306a\u308b\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002 v2.2\u306b\u304a\u3044\u3066\u3001\u9759\u7684\u306a\u95a2\u6570\u7fa4\u306f\u4e8b\u524d\u306b\u30d3\u30eb\u30c9\u3055\u308c\u3001SQL\u304b\u3089\u52d5\u7684\u306b\u751f\u6210\u3059\u308b\u90e8\u5206\u306e\u307f\u3092\u5b9f\u884c\u6642\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001GPU\u30d0\u30a4\u30ca\u30ea\u306e\u751f\u6210\u6642\u9593\u304c\u5927\u5e45\u306b\u6e1b\u5c11\u3059\u308b\u4e8b\u3068\u306a\u308a\u307e\u3057\u305f\u3002 JSONB\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc GPU\u5074\u3067JSONB\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5b50\u8981\u7d20\u3092\u53c2\u7167\u3057\u3001 numeric \u3084 text \u5024\u3068\u3057\u3066\u6761\u4ef6\u53e5\u306a\u3069\u3067\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002 \u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b\u3092\u8fd4\u3059GPU\u95a2\u6570\u306e\u5bfe\u5fdc textcat \u306a\u3069\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b\u3092\u8fd4\u3059SQL\u95a2\u6570\u3092GPU\u5074\u3067\u5b9f\u88c5\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\uff08Gstore_Fdw\uff09\u306e\u30bd\u30fc\u30c8\u5bfe\u5fdc PL/CUDA\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u4ee5\u5916\u306b\u3001GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3057\u3066\u5b9f\u884c\u3059\u308bSQL\u3092GPU\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u5bfe\u5fdc\u3057\u3066\u3044\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306fGpuScan\u304a\u3088\u3073GpuSort\u306e\uff12\u7a2e\u985e\u3067\u3001JOIN\u304a\u3088\u3073GROUP BY\u306b\u306f\u307e\u3060\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002 \u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u306e\u8ffd\u52a0 \u7c21\u6613\u306a\u30c6\u30b9\u30c8\u306e\u305f\u3081\u3001\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 NVME-oF\u3078\u306e\u5bfe\u5fdc\uff08\u5b9f\u9a13\u7684\u6a5f\u80fd\uff09 NVME-over-Fabric\u3092\u7528\u3044\u3066\u30de\u30a6\u30f3\u30c8\u3055\u308c\u305f\u30ea\u30e2\u30fc\u30c8\u306eNVME\u30c7\u30a3\u30b9\u30af\u304b\u3089\u306eSSD-to-GPU Direct SQL\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u305f\u3060\u3057\u3001Red Hat Enterprise Linux 7.x / CentOS 7.x\u3067\u306f nvme_rdma \u30c9\u30e9\u30a4\u30d0\u306e\u5165\u308c\u66ff\u3048\u304c\u5fc5\u8981\u3068\u306a\u308a\u3001\u73fe\u5728\u306e\u3068\u3053\u308d\u5b9f\u9a13\u7684\u6a5f\u80fd\u3068\u3044\u3046\u5f62\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 \u5c06\u6765\u5ec3\u6b62\u4e88\u5b9a\u306e\u6a5f\u80fd PostgreSQL v9.6\u30b5\u30dd\u30fc\u30c8 PostgreSQL v9.6\u306eCustomScan API\u306b\u306f\u3001\u52d5\u7684\u5171\u6709\u30e1\u30e2\u30ea(DSM)\u306e\u6b63\u3057\u3044\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306b\u5fc5\u8981\u306a\u5e7e\u3064\u304b\u306eAPI\u304c\u6b20\u3051\u3066\u304a\u308a\u3001\u5b9f\u884c\u6642\u7d71\u8a08\u60c5\u5831\u306e\u63a1\u53d6\u306a\u3069\u304c\u4e0d\u53ef\u80fd\u3067\u3057\u305f\u3002 \u307e\u305f\u3001\u5185\u90e8\u7684\u306b\u5f0f\u8868\u73fe(Expression)\u3092\u4fdd\u6301\u3059\u308b\u305f\u3081\u306e\u65b9\u6cd5\u306b\u3082\u5909\u66f4\u304c\u52a0\u3048\u3089\u308c\u3066\u3044\u308b\u4e8b\u304b\u3089\u3001\u5c11\u306a\u304f\u306a\u3044\u7b87\u6240\u3067 #if ... #endif \u30d6\u30ed\u30c3\u30af\u304c\u5fc5\u8981\u3068\u306a\u308a\u3001\u30b3\u30fc\u30c9\u306e\u4fdd\u5b88\u6027\u3092\u640d\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002 \u3053\u308c\u3089\u306e\u554f\u984c\u306b\u3088\u308a\u3001PostgreSQL v9.6\u30b5\u30dd\u30fc\u30c8\u306f\u672c\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u6700\u5f8c\u3068\u306a\u308a\u307e\u3059\u3002PG-Strom\u3092PostgreSQL v9.6\u3067\u304a\u4f7f\u3044\u306e\u5834\u5408\u306f\u3001\u65e9\u671f\u306bPostgreSQL v11\u3078\u3068\u79fb\u884c\u3055\u308c\u308b\u4e8b\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002 Gstore_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306epgstrom\u30d5\u30a9\u30fc\u30de\u30c3\u30c8 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u4e0a\u306e\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f\u3001\u5143\u3005PL/CUDA\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u305f\u72ec\u81ea\u306e\u5217\u5f62\u5f0f\u3067\u3001\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u3084numeric\u30c7\u30fc\u30bf\u578b\u306e\u8868\u73fe\u306fPostgreSQL\u306e\u3082\u306e\u3092\u305d\u306e\u307e\u307e\u5229\u7528\u3057\u3066\u3044\u307e\u3057\u305f\u3002 \u305d\u306e\u5f8c\u3001GPU\u4e0a\u3067\u306e\u30c7\u30fc\u30bf\u4ea4\u63db\u7528\u5171\u901a\u5f62\u5f0f\u3068\u3057\u3066\u3001Apache Arrow\u5f62\u5f0f\u3092\u5143\u306b\u3057\u305fNVIDIA RAPIDS(cuDF)\u304c\u516c\u958b\u3055\u308c\u3001\u591a\u304f\u306e\u6a5f\u68b0\u5b66\u7fd2\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3084Python\u3067\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30b9\u30bf\u30c3\u30af\u306a\u3069\u5bfe\u5fdc\u304c\u5f37\u5316\u3055\u308c\u3064\u3064\u3042\u308a\u307e\u3059\u3002 \u4eca\u5f8c\u3001PG-Strom\u306fGstore_Fdw\u306e\u5185\u90e8\u30c7\u30fc\u30bf\u5f62\u5f0f\u3092cuDF\u3068\u5171\u901a\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u5909\u66f4\u3057\u3001\u3053\u308c\u3089\u6a5f\u68b0\u5b66\u7fd2\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u306e\u76f8\u4e92\u904b\u7528\u6027\u3092\u6539\u5584\u3057\u307e\u3059\u3002\u30b3\u30fc\u30c9\u306e\u4fdd\u5b88\u6027\u3092\u9ad8\u304f\u3059\u308b\u305f\u3081\u3001\u5f93\u6765\u306e\u72ec\u81ea\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f\u5ec3\u6b62\u3068\u306a\u308a\u307e\u3059\u3002 \u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u30ad\u30e3\u30c3\u30b7\u30e5 \u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5206\u6790\u3057\u305f\u7d50\u679c\u3001\u591a\u304f\u306e\u30b1\u30fc\u30b9\u3067\u306fArrow_Fdw\u3067\u5341\u5206\u306b\u4ee3\u66ff\u53ef\u80fd\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3042\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u3002\u91cd\u8907\u6a5f\u80fd\u3067\u3042\u308b\u305f\u3081\u3001\u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u524a\u9664\u3055\u308c\u307e\u3057\u305f\u3002","title":"PG-Strom v2.2"},{"location":"release_v2.2/#pg-strom-v22","text":"PG-Strom Development Team (1-May-2019)","title":"PG-Strom v2.2\u30ea\u30ea\u30fc\u30b9"},{"location":"release_v2.2/#_1","text":"PG-Strom v2.2\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u6a5f\u80fd\u5f37\u5316\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3078\u306e\u5bfe\u5fdc Arrow_Fdw\u306b\u3088\u308b\u5217\u6307\u5411\u30b9\u30c8\u30a2\u306e\u30b5\u30dd\u30fc\u30c8 \u30d3\u30eb\u30c9\u6e08\u307fGPU\u30d0\u30a4\u30ca\u30ea\u3078\u306e\u5bfe\u5fdc Jsonb\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc \u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b\u3092\u8fd4\u3059GPU\u95a2\u6570\u306e\u5bfe\u5fdc GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\uff08Gstore_Fdw\uff09\u306e\u30bd\u30fc\u30c8\u5bfe\u5fdc NVMEoF\u3078\u306e\u5bfe\u5fdc\uff08\u5b9f\u9a13\u7684\u6a5f\u80fd\uff09","title":"\u6982\u8981"},{"location":"release_v2.2/#_2","text":"PostgreSQL v9.6, v10, v11 CUDA Toolkit 10.1 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d)","title":"\u52d5\u4f5c\u74b0\u5883"},{"location":"release_v2.2/#_3","text":"\u30c6\u30fc\u30d6\u30eb\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3078\u306e\u5bfe\u5fdc \u30de\u30eb\u30c1GPU\u69cb\u6210\u306e\u5834\u5408\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3092\u69cb\u6210\u3059\u308b\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u7269\u7406\u7684\u306aGPU\u3068\u306e\u8ddd\u96e2\u306b\u5fdc\u3058\u3066\u6700\u9069\u306aGPU\u3092\u9078\u629e\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002NVME-oF\u74b0\u5883\u306a\u3069PCIe\u30d0\u30b9\u306e\u69cb\u6210\u3060\u3051\u3067\u306f\u6700\u9069\u8ddd\u96e2\u3092\u5224\u65ad\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u3001DB\u7ba1\u7406\u8005\u306f pg_strom.nvme_distance_map \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u7528\u3044\u3066\u5bfe\u5fdc\u95a2\u4fc2\u3092\u8a2d\u5b9a\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3068\u306eJOIN\u6642\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3068\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3068\u306eJOIN\u3092\u884c\u3063\u305f\u5f8c\u3001\u5404\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u51e6\u7406\u7d50\u679c\u3092\u7d50\u5408\u3059\u308b\u3088\u3046\u306a\u5b9f\u884c\u8a08\u753b\u3092\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u672c\u6a5f\u80fd\u306f Asymmetric Partition-wise JOIN \u3068\u3044\u3046\u540d\u79f0\u3067PostgreSQL v13\u306e\u672c\u4f53\u6a5f\u80fd\u3078\u3068\u63d0\u6848\u3055\u308c\u3066\u3044\u307e\u3059\u3002 Arrow_Fdw\u306b\u3088\u308b\u5217\u6307\u5411\u30b9\u30c8\u30a2\u306e\u30b5\u30dd\u30fc\u30c8 \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u7d4c\u7531\u3067Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u51fa\u3057\u306b\u5bfe\u5fdc\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 SSD-to-GPU Direct SQL\u3092\u7528\u3044\u305fApache Arrow\u306e\u8aad\u307f\u51fa\u3057\u3068SQL\u5b9f\u884c\u306b\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 \u30d3\u30eb\u30c9\u6e08\u307fGPU\u30d0\u30a4\u30ca\u30ea\u3078\u306e\u5bfe\u5fdc SQL\u304b\u3089GPU\u30d0\u30a4\u30ca\u30ea\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b\u969b\u3001\u5f93\u6765\u306f\u52d5\u7684\u306b\u5909\u66f4\u3059\u308b\u8981\u7d20\u306e\u306a\u3044\u95a2\u6570\u7fa4\uff08\u30e9\u30a4\u30d6\u30e9\u30ea\u95a2\u6570\u306b\u9177\u4f3c\uff09\u3082\u542b\u3081\u3066CUDA C\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3057\u3001\u305d\u308c\u3092NVRTC(NVIDIA Run-Time Compiler)\u3092\u7528\u3044\u3066\u30d3\u30eb\u30c9\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u4e00\u90e8\u306e\u8907\u96d1\u306a\u95a2\u6570\u306e\u5f71\u97ff\u3067\u30d3\u30eb\u30c9\u6642\u9593\u304c\u6975\u7aef\u306b\u9577\u304f\u306a\u308b\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002 v2.2\u306b\u304a\u3044\u3066\u3001\u9759\u7684\u306a\u95a2\u6570\u7fa4\u306f\u4e8b\u524d\u306b\u30d3\u30eb\u30c9\u3055\u308c\u3001SQL\u304b\u3089\u52d5\u7684\u306b\u751f\u6210\u3059\u308b\u90e8\u5206\u306e\u307f\u3092\u5b9f\u884c\u6642\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001GPU\u30d0\u30a4\u30ca\u30ea\u306e\u751f\u6210\u6642\u9593\u304c\u5927\u5e45\u306b\u6e1b\u5c11\u3059\u308b\u4e8b\u3068\u306a\u308a\u307e\u3057\u305f\u3002 JSONB\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc GPU\u5074\u3067JSONB\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5b50\u8981\u7d20\u3092\u53c2\u7167\u3057\u3001 numeric \u3084 text \u5024\u3068\u3057\u3066\u6761\u4ef6\u53e5\u306a\u3069\u3067\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002 \u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b\u3092\u8fd4\u3059GPU\u95a2\u6570\u306e\u5bfe\u5fdc textcat \u306a\u3069\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b\u3092\u8fd4\u3059SQL\u95a2\u6570\u3092GPU\u5074\u3067\u5b9f\u88c5\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\uff08Gstore_Fdw\uff09\u306e\u30bd\u30fc\u30c8\u5bfe\u5fdc PL/CUDA\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u4ee5\u5916\u306b\u3001GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3057\u3066\u5b9f\u884c\u3059\u308bSQL\u3092GPU\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u5bfe\u5fdc\u3057\u3066\u3044\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306fGpuScan\u304a\u3088\u3073GpuSort\u306e\uff12\u7a2e\u985e\u3067\u3001JOIN\u304a\u3088\u3073GROUP BY\u306b\u306f\u307e\u3060\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002 \u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u306e\u8ffd\u52a0 \u7c21\u6613\u306a\u30c6\u30b9\u30c8\u306e\u305f\u3081\u3001\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 NVME-oF\u3078\u306e\u5bfe\u5fdc\uff08\u5b9f\u9a13\u7684\u6a5f\u80fd\uff09 NVME-over-Fabric\u3092\u7528\u3044\u3066\u30de\u30a6\u30f3\u30c8\u3055\u308c\u305f\u30ea\u30e2\u30fc\u30c8\u306eNVME\u30c7\u30a3\u30b9\u30af\u304b\u3089\u306eSSD-to-GPU Direct SQL\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u305f\u3060\u3057\u3001Red Hat Enterprise Linux 7.x / CentOS 7.x\u3067\u306f nvme_rdma \u30c9\u30e9\u30a4\u30d0\u306e\u5165\u308c\u66ff\u3048\u304c\u5fc5\u8981\u3068\u306a\u308a\u3001\u73fe\u5728\u306e\u3068\u3053\u308d\u5b9f\u9a13\u7684\u6a5f\u80fd\u3068\u3044\u3046\u5f62\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002","title":"\u65b0\u6a5f\u80fd"},{"location":"release_v2.2/#_4","text":"PostgreSQL v9.6\u30b5\u30dd\u30fc\u30c8 PostgreSQL v9.6\u306eCustomScan API\u306b\u306f\u3001\u52d5\u7684\u5171\u6709\u30e1\u30e2\u30ea(DSM)\u306e\u6b63\u3057\u3044\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306b\u5fc5\u8981\u306a\u5e7e\u3064\u304b\u306eAPI\u304c\u6b20\u3051\u3066\u304a\u308a\u3001\u5b9f\u884c\u6642\u7d71\u8a08\u60c5\u5831\u306e\u63a1\u53d6\u306a\u3069\u304c\u4e0d\u53ef\u80fd\u3067\u3057\u305f\u3002 \u307e\u305f\u3001\u5185\u90e8\u7684\u306b\u5f0f\u8868\u73fe(Expression)\u3092\u4fdd\u6301\u3059\u308b\u305f\u3081\u306e\u65b9\u6cd5\u306b\u3082\u5909\u66f4\u304c\u52a0\u3048\u3089\u308c\u3066\u3044\u308b\u4e8b\u304b\u3089\u3001\u5c11\u306a\u304f\u306a\u3044\u7b87\u6240\u3067 #if ... #endif \u30d6\u30ed\u30c3\u30af\u304c\u5fc5\u8981\u3068\u306a\u308a\u3001\u30b3\u30fc\u30c9\u306e\u4fdd\u5b88\u6027\u3092\u640d\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002 \u3053\u308c\u3089\u306e\u554f\u984c\u306b\u3088\u308a\u3001PostgreSQL v9.6\u30b5\u30dd\u30fc\u30c8\u306f\u672c\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u6700\u5f8c\u3068\u306a\u308a\u307e\u3059\u3002PG-Strom\u3092PostgreSQL v9.6\u3067\u304a\u4f7f\u3044\u306e\u5834\u5408\u306f\u3001\u65e9\u671f\u306bPostgreSQL v11\u3078\u3068\u79fb\u884c\u3055\u308c\u308b\u4e8b\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002 Gstore_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306epgstrom\u30d5\u30a9\u30fc\u30de\u30c3\u30c8 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u4e0a\u306e\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f\u3001\u5143\u3005PL/CUDA\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u305f\u72ec\u81ea\u306e\u5217\u5f62\u5f0f\u3067\u3001\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u3084numeric\u30c7\u30fc\u30bf\u578b\u306e\u8868\u73fe\u306fPostgreSQL\u306e\u3082\u306e\u3092\u305d\u306e\u307e\u307e\u5229\u7528\u3057\u3066\u3044\u307e\u3057\u305f\u3002 \u305d\u306e\u5f8c\u3001GPU\u4e0a\u3067\u306e\u30c7\u30fc\u30bf\u4ea4\u63db\u7528\u5171\u901a\u5f62\u5f0f\u3068\u3057\u3066\u3001Apache Arrow\u5f62\u5f0f\u3092\u5143\u306b\u3057\u305fNVIDIA RAPIDS(cuDF)\u304c\u516c\u958b\u3055\u308c\u3001\u591a\u304f\u306e\u6a5f\u68b0\u5b66\u7fd2\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3084Python\u3067\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30b9\u30bf\u30c3\u30af\u306a\u3069\u5bfe\u5fdc\u304c\u5f37\u5316\u3055\u308c\u3064\u3064\u3042\u308a\u307e\u3059\u3002 \u4eca\u5f8c\u3001PG-Strom\u306fGstore_Fdw\u306e\u5185\u90e8\u30c7\u30fc\u30bf\u5f62\u5f0f\u3092cuDF\u3068\u5171\u901a\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u5909\u66f4\u3057\u3001\u3053\u308c\u3089\u6a5f\u68b0\u5b66\u7fd2\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u306e\u76f8\u4e92\u904b\u7528\u6027\u3092\u6539\u5584\u3057\u307e\u3059\u3002\u30b3\u30fc\u30c9\u306e\u4fdd\u5b88\u6027\u3092\u9ad8\u304f\u3059\u308b\u305f\u3081\u3001\u5f93\u6765\u306e\u72ec\u81ea\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f\u5ec3\u6b62\u3068\u306a\u308a\u307e\u3059\u3002","title":"\u5c06\u6765\u5ec3\u6b62\u4e88\u5b9a\u306e\u6a5f\u80fd"},{"location":"release_v2.2/#_5","text":"\u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u30ad\u30e3\u30c3\u30b7\u30e5 \u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5206\u6790\u3057\u305f\u7d50\u679c\u3001\u591a\u304f\u306e\u30b1\u30fc\u30b9\u3067\u306fArrow_Fdw\u3067\u5341\u5206\u306b\u4ee3\u66ff\u53ef\u80fd\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3042\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u3002\u91cd\u8907\u6a5f\u80fd\u3067\u3042\u308b\u305f\u3081\u3001\u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u524a\u9664\u3055\u308c\u307e\u3057\u305f\u3002","title":"\u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd"},{"location":"release_v2.3/","text":"PG-Strom v2.3\u30ea\u30ea\u30fc\u30b9 PG-Strom Development Team (1-Apr-2020) \u6982\u8981 PG-Strom v2.3\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u6a5f\u80fd\u5f37\u5316\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 GpuJoin\u306eInner\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u304cCPU\u4e26\u5217\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 Arrow_Fdw\u304cINSERT/TRUNCATE\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 pg2arrow\u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u8a18\u30e2\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 mysql2arrow\u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002 \u52d5\u4f5c\u74b0\u5883 PostgreSQL v10, v11, v12 CUDA Toolkit 10.1 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal or Volta) \u65b0\u6a5f\u80fd GpuJoin\u306eInner\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u304cCPU\u4e26\u5217\u306b\u5bfe\u5fdc \u5f93\u6765\u306fGpuJoin\u306eInner\u5074\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u306f\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306e\u307f\u304c\u884c\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u306e\u5236\u7d04\u306b\u3088\u308a\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u4e26\u5217\u30b9\u30ad\u30e3\u30f3\u304c\u6975\u7aef\u306b\u9045\u5ef6\u3059\u308b\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u672c\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306e\u6a5f\u80fd\u5f37\u5316\u306b\u3088\u308a\u3001\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u3001\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306e\u3069\u3061\u3089\u3067\u3082Inner\u5074\u30d0\u30c3\u30d5\u30a1\u3092\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u5834\u5408\u3067\u3082\u3001\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u30d7\u30ed\u30bb\u30b9\u304c\u76f4\u3061\u306bGpuJoin\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 Partition-wise Asymmetric GpuJoin\u306e\u518d\u8a2d\u8a08 \u5168\u4f53\u7684\u306a\u30c7\u30b6\u30a4\u30f3\u306e\u518d\u8a2d\u8a08\u3092\u884c\u3044\u3001\u9069\u5207\u306a\u5c40\u9762\u306b\u304a\u3044\u3066\u591a\u6bb5GpuJoin\u304c\u9078\u629e\u3055\u308c\u3084\u3059\u304f\u306a\u308b\u3088\u3046\u6539\u826f\u3092\u884c\u3044\u307e\u3057\u305f\u3002 Arrow_Fdw\u304cINSERT/TRUNCATE\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u3001 INSERT \u306b\u3088\u308b\u30d0\u30eb\u30af\u30ed\u30fc\u30c9\u3068\u3001 pgstrom.arrow_fdw_truncate \u306b\u3088\u308bTRUNCATE\u51e6\u7406\u3092\u884c\u3046\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 CuPy\u9023\u643a\u3068\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306eGPU\u30a8\u30af\u30b9\u30dd\u30fc\u30c8 Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306e\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306b\u30ed\u30fc\u30c9\u3057\u3001\u3053\u308c\u3092CuPy\u306e cupy.ndarray \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066Python\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089\u53c2\u7167\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 pg2arrow\u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u8a18\u30e2\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 pg2arrow \u30b3\u30de\u30f3\u30c9\u306b --append \u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u8ffd\u52a0\u3055\u308c\u3001\u65e2\u5b58\u306eApache Arrow\u306b\u5bfe\u3057\u3066\u8ffd\u8a18\u3092\u884c\u3046\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 \u307e\u305f\u540c\u6642\u306b\u3001 SELECT * FROM table \u306e\u5225\u540d\u8868\u8a18\u3068\u3057\u3066 -t table \u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002 mysql2arrow\u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002 PostgreSQL\u3067\u306f\u306a\u304f\u3001MySQL\u306b\u63a5\u7d9a\u3057\u3066\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b mysql2arrow \u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 \u5217\u6319\u578b\u306e\u30c7\u30fc\u30bf\u3082\u901a\u5e38\u306eUtf8\u578b\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\uff08DictionaryBatch\u3092\u4f7f\u7528\u3057\u306a\u3044\uff09\u4ee5\u5916\u306f\u3001 pg2arrow \u3068\u540c\u7b49\u306e\u6a5f\u80fd\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 \u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f PostgreSQL\u306e\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u5408\u308f\u305b\u3066\u3001\u5e7e\u3064\u304b\u306e\u57fa\u672c\u7684\u306a\u30c6\u30b9\u30c8\u30b1\u30fc\u30b9\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002 \u4fee\u6b63\u3055\u308c\u305f\u4e3b\u306a\u4e0d\u5177\u5408 GPU\u30c7\u30d0\u30a4\u30b9\u95a2\u6570/\u578b\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u7121\u52b9\u5316\u306e\u30ed\u30b8\u30c3\u30af\u3092\u6539\u5584 ALTER\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u6642\u3001\u5168\u3066\u306eGPU\u30c7\u30d0\u30a4\u30b9\u95a2\u6570/\u578b\u306e\u30e1\u30bf\u60c5\u5831\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u7121\u52b9\u5316\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u5b9f\u969b\u306b\u7121\u52b9\u5316\u306e\u5fc5\u8981\u306e\u3042\u308b\u30a8\u30f3\u30c8\u30ea\u306e\u307f\u3092\u30af\u30ea\u30a2\u3059\u308b\u3088\u3046\u4fee\u6b63\u3092\u884c\u3044\u307e\u3057\u305f\u3002 GROUP BY\u3067\u540c\u3058\u5217\u3092\u5076\u6570\u56de\u6307\u5b9a\u3057\u305f\u969b\u306b\u6975\u7aef\u306a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u4f4e\u4e0b\u3092\u4fee\u6b63 GROUP BY\u306e\u30ad\u30fc\u5024\u304c\u8907\u6570\u3042\u308b\u6642\u306b\u3001GpuPreAgg\u306f\u30cf\u30c3\u30b7\u30e5\u5024\u3092XOR\u3067\u7d50\u5408\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u305d\u306e\u305f\u3081\u3001\u540c\u3058\u5217\u3092\u5076\u6570\u56de\u6307\u5b9a\u3057\u305f\u5834\u5408\u306b\u306f\u5e38\u306b\u30cf\u30c3\u30b7\u30e5\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c0\u306b\u306a\u308b\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u9069\u5f53\u306a\u30e9\u30f3\u30c0\u30e0\u5316\u51e6\u7406\u3092\u52a0\u3048\u308b\u4e8b\u3067\u30cf\u30c3\u30b7\u30e5\u5024\u304c\u5206\u6563\u3059\u308b\u3088\u3046\u4fee\u6b63\u3057\u3066\u3044\u307e\u3059\u3002 \u6f5c\u5728\u7684\u306aGpuScan\u7121\u9650\u30eb\u30fc\u30d7\u306e\u554f\u984c\u3092\u4fee\u6b63 SSD2GPU Direct SQL\u306e\u4f7f\u7528\u6642\u3001\u5909\u6570\u306e\u672a\u521d\u671f\u5316\u306b\u3088\u308aGpuScan\u304c\u7121\u9650\u30eb\u30fc\u30d7\u306b\u9665\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u6f5c\u5728\u7684\u306aGpuJoin\u306eGPU\u30ab\u30fc\u30cd\u30eb\u30af\u30e9\u30c3\u30b7\u30e5 3\u500b\u4ee5\u4e0a\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u7d50\u5408\u3059\u308bGpuJoin\u3067\u3001\u5909\u6570\u306e\u672a\u521d\u671f\u5316\u306b\u3088\u308aGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd PostgreSQL v9.6\u30b5\u30dd\u30fc\u30c8 PostgreSQL v9.6\u306eCustomScan API\u306b\u306f\u3001\u52d5\u7684\u5171\u6709\u30e1\u30e2\u30ea(DSM)\u306e\u6b63\u3057\u3044\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306b\u5fc5\u8981\u306a\u5e7e\u3064\u304b\u306eAPI\u304c\u6b20\u3051\u3066\u304a\u308a\u3001v10\u4ee5\u964d\u3068\u5171\u901a\u306e\u30b3\u30fc\u30c9\u3092\u4fdd\u5b88\u3059\u308b\u4e0a\u3067\u969c\u5bb3\u3068\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u306e\u554f\u984c\u304b\u3089\u3001\u672c\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f PostgreSQL v9.6 \u306f\u30b5\u30dd\u30fc\u30c8\u5916\u3068\u306a\u308a\u307e\u3059\u3002 PL/CUDA \u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5206\u6790\u3057\u305f\u7d50\u679c\u3001\u72ec\u81ea\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u74b0\u5883\u3088\u308a\u3082\u3001Python\u8a00\u8a9e\u306a\u3069\u30e6\u30fc\u30b6\u306e\u4f7f\u3044\u6163\u308c\u305f\u8a00\u8a9e\u74b0\u5883\u306e\u65b9\u304c\u671b\u307e\u3057\u3044\u4e8b\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u3002 \u4eca\u5f8c\u306f\u3001Arrow_Fdw\u306eGPU\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u6a5f\u80fd\u3068PL/Python\u7d4c\u7531\u3067\u306eCuPy\u547c\u51fa\u3057\u3092\u4f75\u7528\u3059\u308b\u4e8b\u3067\u3001In-database\u6a5f\u68b0\u5b66\u7fd2/\u7d71\u8a08\u89e3\u6790\u306e\u4ee3\u66ff\u624b\u6bb5\u3068\u306a\u308a\u307e\u3059\u3002 Gstore_Fdw \u672c\u6a5f\u80fd\u306f\u3001\u66f8\u304d\u8fbc\u307f\u53ef\u80fdArrow_Fdw\u3068GPU\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u6a5f\u80fd\u306b\u3088\u308a\u4ee3\u66ff\u3055\u308c\u307e\u3057\u305f\u3002 Largeobject\uff5eGPU\u9593\u30a8\u30af\u30b9\u30dd\u30fc\u30c8/\u30a4\u30f3\u30dd\u30fc\u30c8 \u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5206\u6790\u3057\u305f\u7d50\u679c\u3001\u672c\u6a5f\u80fd\u306f\u4e0d\u8981\u3068\u5224\u65ad\u3057\u307e\u3057\u305f\u3002","title":"PG-Strom v2.3"},{"location":"release_v2.3/#pg-strom-v23","text":"PG-Strom Development Team (1-Apr-2020)","title":"PG-Strom v2.3\u30ea\u30ea\u30fc\u30b9"},{"location":"release_v2.3/#_1","text":"PG-Strom v2.3\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u6a5f\u80fd\u5f37\u5316\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 GpuJoin\u306eInner\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u304cCPU\u4e26\u5217\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 Arrow_Fdw\u304cINSERT/TRUNCATE\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 pg2arrow\u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u8a18\u30e2\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 mysql2arrow\u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002","title":"\u6982\u8981"},{"location":"release_v2.3/#_2","text":"PostgreSQL v10, v11, v12 CUDA Toolkit 10.1 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal or Volta)","title":"\u52d5\u4f5c\u74b0\u5883"},{"location":"release_v2.3/#_3","text":"GpuJoin\u306eInner\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u304cCPU\u4e26\u5217\u306b\u5bfe\u5fdc \u5f93\u6765\u306fGpuJoin\u306eInner\u5074\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u306f\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306e\u307f\u304c\u884c\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u306e\u5236\u7d04\u306b\u3088\u308a\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u4e26\u5217\u30b9\u30ad\u30e3\u30f3\u304c\u6975\u7aef\u306b\u9045\u5ef6\u3059\u308b\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u672c\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306e\u6a5f\u80fd\u5f37\u5316\u306b\u3088\u308a\u3001\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u3001\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306e\u3069\u3061\u3089\u3067\u3082Inner\u5074\u30d0\u30c3\u30d5\u30a1\u3092\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u5834\u5408\u3067\u3082\u3001\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u30d7\u30ed\u30bb\u30b9\u304c\u76f4\u3061\u306bGpuJoin\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 Partition-wise Asymmetric GpuJoin\u306e\u518d\u8a2d\u8a08 \u5168\u4f53\u7684\u306a\u30c7\u30b6\u30a4\u30f3\u306e\u518d\u8a2d\u8a08\u3092\u884c\u3044\u3001\u9069\u5207\u306a\u5c40\u9762\u306b\u304a\u3044\u3066\u591a\u6bb5GpuJoin\u304c\u9078\u629e\u3055\u308c\u3084\u3059\u304f\u306a\u308b\u3088\u3046\u6539\u826f\u3092\u884c\u3044\u307e\u3057\u305f\u3002 Arrow_Fdw\u304cINSERT/TRUNCATE\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u3001 INSERT \u306b\u3088\u308b\u30d0\u30eb\u30af\u30ed\u30fc\u30c9\u3068\u3001 pgstrom.arrow_fdw_truncate \u306b\u3088\u308bTRUNCATE\u51e6\u7406\u3092\u884c\u3046\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 CuPy\u9023\u643a\u3068\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306eGPU\u30a8\u30af\u30b9\u30dd\u30fc\u30c8 Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306e\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306b\u30ed\u30fc\u30c9\u3057\u3001\u3053\u308c\u3092CuPy\u306e cupy.ndarray \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066Python\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089\u53c2\u7167\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 pg2arrow\u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u8a18\u30e2\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 pg2arrow \u30b3\u30de\u30f3\u30c9\u306b --append \u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u8ffd\u52a0\u3055\u308c\u3001\u65e2\u5b58\u306eApache Arrow\u306b\u5bfe\u3057\u3066\u8ffd\u8a18\u3092\u884c\u3046\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 \u307e\u305f\u540c\u6642\u306b\u3001 SELECT * FROM table \u306e\u5225\u540d\u8868\u8a18\u3068\u3057\u3066 -t table \u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002 mysql2arrow\u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002 PostgreSQL\u3067\u306f\u306a\u304f\u3001MySQL\u306b\u63a5\u7d9a\u3057\u3066\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b mysql2arrow \u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 \u5217\u6319\u578b\u306e\u30c7\u30fc\u30bf\u3082\u901a\u5e38\u306eUtf8\u578b\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\uff08DictionaryBatch\u3092\u4f7f\u7528\u3057\u306a\u3044\uff09\u4ee5\u5916\u306f\u3001 pg2arrow \u3068\u540c\u7b49\u306e\u6a5f\u80fd\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 \u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f PostgreSQL\u306e\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u5408\u308f\u305b\u3066\u3001\u5e7e\u3064\u304b\u306e\u57fa\u672c\u7684\u306a\u30c6\u30b9\u30c8\u30b1\u30fc\u30b9\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002","title":"\u65b0\u6a5f\u80fd"},{"location":"release_v2.3/#_4","text":"GPU\u30c7\u30d0\u30a4\u30b9\u95a2\u6570/\u578b\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u7121\u52b9\u5316\u306e\u30ed\u30b8\u30c3\u30af\u3092\u6539\u5584 ALTER\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u6642\u3001\u5168\u3066\u306eGPU\u30c7\u30d0\u30a4\u30b9\u95a2\u6570/\u578b\u306e\u30e1\u30bf\u60c5\u5831\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u7121\u52b9\u5316\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u5b9f\u969b\u306b\u7121\u52b9\u5316\u306e\u5fc5\u8981\u306e\u3042\u308b\u30a8\u30f3\u30c8\u30ea\u306e\u307f\u3092\u30af\u30ea\u30a2\u3059\u308b\u3088\u3046\u4fee\u6b63\u3092\u884c\u3044\u307e\u3057\u305f\u3002 GROUP BY\u3067\u540c\u3058\u5217\u3092\u5076\u6570\u56de\u6307\u5b9a\u3057\u305f\u969b\u306b\u6975\u7aef\u306a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u4f4e\u4e0b\u3092\u4fee\u6b63 GROUP BY\u306e\u30ad\u30fc\u5024\u304c\u8907\u6570\u3042\u308b\u6642\u306b\u3001GpuPreAgg\u306f\u30cf\u30c3\u30b7\u30e5\u5024\u3092XOR\u3067\u7d50\u5408\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u305d\u306e\u305f\u3081\u3001\u540c\u3058\u5217\u3092\u5076\u6570\u56de\u6307\u5b9a\u3057\u305f\u5834\u5408\u306b\u306f\u5e38\u306b\u30cf\u30c3\u30b7\u30e5\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c0\u306b\u306a\u308b\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u9069\u5f53\u306a\u30e9\u30f3\u30c0\u30e0\u5316\u51e6\u7406\u3092\u52a0\u3048\u308b\u4e8b\u3067\u30cf\u30c3\u30b7\u30e5\u5024\u304c\u5206\u6563\u3059\u308b\u3088\u3046\u4fee\u6b63\u3057\u3066\u3044\u307e\u3059\u3002 \u6f5c\u5728\u7684\u306aGpuScan\u7121\u9650\u30eb\u30fc\u30d7\u306e\u554f\u984c\u3092\u4fee\u6b63 SSD2GPU Direct SQL\u306e\u4f7f\u7528\u6642\u3001\u5909\u6570\u306e\u672a\u521d\u671f\u5316\u306b\u3088\u308aGpuScan\u304c\u7121\u9650\u30eb\u30fc\u30d7\u306b\u9665\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u6f5c\u5728\u7684\u306aGpuJoin\u306eGPU\u30ab\u30fc\u30cd\u30eb\u30af\u30e9\u30c3\u30b7\u30e5 3\u500b\u4ee5\u4e0a\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u7d50\u5408\u3059\u308bGpuJoin\u3067\u3001\u5909\u6570\u306e\u672a\u521d\u671f\u5316\u306b\u3088\u308aGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3057\u305f\u3002","title":"\u4fee\u6b63\u3055\u308c\u305f\u4e3b\u306a\u4e0d\u5177\u5408"},{"location":"release_v2.3/#_5","text":"PostgreSQL v9.6\u30b5\u30dd\u30fc\u30c8 PostgreSQL v9.6\u306eCustomScan API\u306b\u306f\u3001\u52d5\u7684\u5171\u6709\u30e1\u30e2\u30ea(DSM)\u306e\u6b63\u3057\u3044\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306b\u5fc5\u8981\u306a\u5e7e\u3064\u304b\u306eAPI\u304c\u6b20\u3051\u3066\u304a\u308a\u3001v10\u4ee5\u964d\u3068\u5171\u901a\u306e\u30b3\u30fc\u30c9\u3092\u4fdd\u5b88\u3059\u308b\u4e0a\u3067\u969c\u5bb3\u3068\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u306e\u554f\u984c\u304b\u3089\u3001\u672c\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f PostgreSQL v9.6 \u306f\u30b5\u30dd\u30fc\u30c8\u5916\u3068\u306a\u308a\u307e\u3059\u3002 PL/CUDA \u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5206\u6790\u3057\u305f\u7d50\u679c\u3001\u72ec\u81ea\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u74b0\u5883\u3088\u308a\u3082\u3001Python\u8a00\u8a9e\u306a\u3069\u30e6\u30fc\u30b6\u306e\u4f7f\u3044\u6163\u308c\u305f\u8a00\u8a9e\u74b0\u5883\u306e\u65b9\u304c\u671b\u307e\u3057\u3044\u4e8b\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u3002 \u4eca\u5f8c\u306f\u3001Arrow_Fdw\u306eGPU\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u6a5f\u80fd\u3068PL/Python\u7d4c\u7531\u3067\u306eCuPy\u547c\u51fa\u3057\u3092\u4f75\u7528\u3059\u308b\u4e8b\u3067\u3001In-database\u6a5f\u68b0\u5b66\u7fd2/\u7d71\u8a08\u89e3\u6790\u306e\u4ee3\u66ff\u624b\u6bb5\u3068\u306a\u308a\u307e\u3059\u3002 Gstore_Fdw \u672c\u6a5f\u80fd\u306f\u3001\u66f8\u304d\u8fbc\u307f\u53ef\u80fdArrow_Fdw\u3068GPU\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u6a5f\u80fd\u306b\u3088\u308a\u4ee3\u66ff\u3055\u308c\u307e\u3057\u305f\u3002 Largeobject\uff5eGPU\u9593\u30a8\u30af\u30b9\u30dd\u30fc\u30c8/\u30a4\u30f3\u30dd\u30fc\u30c8 \u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5206\u6790\u3057\u305f\u7d50\u679c\u3001\u672c\u6a5f\u80fd\u306f\u4e0d\u8981\u3068\u5224\u65ad\u3057\u307e\u3057\u305f\u3002","title":"\u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd"},{"location":"release_v3.0/","text":"PG-Strom v3.0\u30ea\u30ea\u30fc\u30b9 PG-Strom Development Team (29-Jun-2021) \u6982\u8981 PG-Strom v3.0\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u5909\u66f4\u306f\u70b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 NVIDIA GPUDirect Storage (cuFile) \u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u3044\u304f\u3064\u304b\u306ePostGIS\u95a2\u6570\u304cGPU\u3067\u5b9f\u884c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3057\u305fGpuJoin\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u65b0\u305f\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u6a5f\u80fd\u304c\u5b9f\u88c5\u3055\u308c\u307e\u3057\u305f\u3002 \u30e6\u30fc\u30b6\u5b9a\u7fa9\u306eGPU\u30c7\u30fc\u30bf\u578b/\u95a2\u6570/\u6f14\u7b97\u5b50\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002(\u5b9f\u9a13\u7684) \u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30e9\u30a4\u30bb\u30f3\u30b9\u3092GPLv2\u304b\u3089PostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u3078\u3068\u5207\u308a\u66ff\u3048\u307e\u3057\u305f\u3002 \u52d5\u4f5c\u74b0\u5883 PostgreSQL v11, v12, v13 CUDA Toolkit 11.2 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d) NVIDIA GPUDirect Storage GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL \u7528\u306e\u30c9\u30e9\u30a4\u30d0\u3068\u3057\u3066\u3001\u5f93\u6765\u306e nvme_strom \u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u52a0\u3048\u3066\u3001 NVIDIA\u304c\u958b\u767a\u3092\u9032\u3081\u3066\u3044\u308b GPUDirect Storage \u306b\u3082\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u3069\u3061\u3089\u306e\u30c9\u30e9\u30a4\u30d0\u3082\u6982\u306d\u540c\u7b49\u306e\u6a5f\u80fd\u3001\u6027\u80fd\u3092\u6709\u3057\u3066\u3044\u307e\u3059\u304c\u3001GPUDirect Storage\u306e\u5bfe\u5fdc\u306b\u3088\u308a\u3001\u5f93\u6765\u304b\u3089\u306e\u30ed\u30fc\u30ab\u30ebNVME-SSD\u306b\u52a0\u3048\u3066\u3001NVME-oF(NVME over Fabrics)\u30c7\u30d0\u30a4\u30b9\u3084SDS(Software Defined Storage)\u30c7\u30d0\u30a4\u30b9\u3001\u304a\u3088\u3073\u305d\u306e\u4e0a\u306b\u69cb\u7bc9\u3055\u308c\u305f\u5171\u6709\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u306eGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306b\u3082\u5bfe\u5fdc\u3059\u308b\u4e8b\u3068\u306a\u308a\u3001\u3088\u308a\u5927\u898f\u6a21\u3067\u67d4\u8edf\u306a\u30b9\u30c8\u30ec\u30fc\u30b8\u69cb\u6210\u3092\u53d6\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002 GPUDirect SQL\u306f\u3001PostgreSQL\u6a19\u6e96\u306eHeap\u30c6\u30fc\u30d6\u30eb\u3068Apache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u51fa\u3057\u306b\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u3044\u305a\u308c\u306e\u5834\u5408\u306b\u304a\u3044\u3066\u3082\u3001\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u304c\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u3068\u306a\u308b\u3088\u3046\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u304a\u3044\u3066\u9855\u8457\u306a\u9ad8\u901f\u5316\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u6e2c\u5b9a\u7d50\u679c\u306f\u3001GPU 1\u53f0\u3068NVME-SSD 4\u53f0\u3092\u7528\u3044\u3066\u3001SSBM(Star Schema Benchmark)\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPUDirect SQL\u3092GPUDirect Storage\u30c9\u30e9\u30a4\u30d0\u306e\u4e0b\u3067\u5b9f\u884c\u3057\u305f\u3082\u306e\u3067\u3059\u304c\u3001PostgreSQL heap\u3068Apache Arrow\u306e\u3044\u305a\u308c\u306e\u30b1\u30fc\u30b9\u306b\u304a\u3044\u3066\u3082\u3001\u5358\u4f4d\u6642\u9593\u3042\u305f\u308a\u306e\u30c7\u30fc\u30bf\u51e6\u7406\u4ef6\u6570\u306fPostgreSQL\u306b\u6bd4\u3079\u5927\u5e45\u306b\u6539\u5584\u3057\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 \u307e\u305f\u3001\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u4e2d\u306eNVME-SSD\u304b\u3089\u306e\u8aad\u307f\u51fa\u3057\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u3092\u6bd4\u8f03\u3057\u3066\u307f\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4ecb\u3057\u305f\u8aad\u51fa\u3057\uff08PostgreSQL Heap Storage\uff09\u306b\u6bd4\u3079\u3001GPUDirect Storage\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u306b\u306f\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9650\u754c\u306b\u8fd1\u3044\u6027\u80fd\u5024\u3092\u5f15\u304d\u51fa\u305b\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 GPU\u7248PostGIS\u3068GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9 \u3044\u304f\u3064\u304b\u306ePostGIS\u95a2\u6570\u306bGPU\u7248\u3092\u5b9f\u88c5\u3057\u307e\u3057\u305f\u3002 \u6761\u4ef6\u53e5\u3067\u3053\u308c\u3089\u306ePostGIS\u95a2\u6570\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001PG-Strom\u306fGPU\u5074\u3067\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046GPU\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u81ea\u52d5\u751f\u6210\u3057\u307e\u3059\u3002 GPU\u7248PostGIS\u306e\u4e3b\u305f\u308b\u30bf\u30fc\u30b2\u30c3\u30c8\u306f\u3001\u643a\u5e2f\u96fb\u8a71\u3084\u81ea\u52d5\u8eca\u3068\u3044\u3063\u305f\u79fb\u52d5\u4f53\u30c7\u30d0\u30a4\u30b9\u306e\u6700\u65b0\u306e\u4f4d\u7f6e\u60c5\u5831\uff08Real-time Location Data\uff09\u3068\u3001\u5e02\u533a\u753a\u6751\u3084\u5b66\u533a\u306e\u5883\u754c\u3068\u3044\u3063\u305f\u9818\u57df\uff08Area Definition Data\uff09\u3068\u306e\u9593\u3067\u884c\u308f\u308c\u308b\u7a81\u5408\u51e6\u7406\u3067\u3059\u3002 \u4f8b\u3048\u3070\u3001\u4e00\u5b9a\u306e\u30a8\u30ea\u30a2\u5185\u306b\u5b58\u5728\u3059\u308b\u643a\u5e2f\u96fb\u8a71\u306b\u5e83\u544a\u3092\u914d\u4fe1\u3057\u305f\u3044\u6642\u3001\u4e00\u5b9a\u306e\u30a8\u30ea\u30a2\u5185\u306b\u5b58\u5728\u3059\u308b\u81ea\u52d5\u8eca\u306b\u6e0b\u6ede\u60c5\u5831\u3092\u914d\u4fe1\u3057\u305f\u3044\u6642\u306a\u3069\u3001\u4f4d\u7f6e\u3092\u30ad\u30fc\u3068\u3057\u3066\u8a72\u5f53\u3059\u308b\u30c7\u30d0\u30a4\u30b9\u3092\u691c\u7d22\u3059\u308b\u51e6\u7406\u306b\u52b9\u679c\u3092\u767a\u63ee\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u6771\u4eac\u8fd1\u90ca\u30a8\u30ea\u30a2\u3092\u5305\u542b\u3059\u308b\u77e9\u5f62\u9818\u57df\u5185\u306b\u30e9\u30f3\u30c0\u30e0\u306a1600\u4e07\u500b\u306e\u70b9\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3057\u3001\u5e02\u533a\u753a\u6751\u3054\u3068\u306b\u305d\u306e\u9818\u57df\u5185\u306b\u542b\u307e\u308c\u308b\u70b9\u306e\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u3059\u308b\u3068\u3044\u3046\u51e6\u7406\u306e\u5fdc\u7b54\u6642\u9593\u3092\u8a08\u6e2c\u3057\u305f\u3082\u306e\u3067\u3059\u3002 \u901a\u5e38\u306ePostGIS\u3068GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u306f160\u79d2\u4ee5\u4e0a\u3092\u8981\u3057\u305f\u51e6\u7406\u304c\u3001GPU\u7248PostGIS\u3068GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u304a\u3044\u3066\u306f\u3001\u50c5\u304b0.830\u79d2\u3067\u5fdc\u7b54\u3057\u3066\u3044\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5 GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u4e88\u3081\u9818\u57df\u3092\u78ba\u4fdd\u3057\u3066\u304a\u304d\u3001\u5bfe\u8c61\u3068\u306a\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u8907\u88fd\u3092\u4fdd\u6301\u3057\u3066\u304a\u304f\u6a5f\u80fd\u3067\u3059\u3002 \u6bd4\u8f03\u7684\u5c0f\u898f\u6a21\u306e\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\uff08\uff5e10GB\u7a0b\u5ea6\uff09\u3067\u3001\u66f4\u65b0\u983b\u5ea6\u306e\u9ad8\u3044\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u5206\u6790/\u691c\u7d22\u7cfb\u306e\u30af\u30a8\u30ea\u3092\u52b9\u7387\u3088\u304f\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u307e\u3057\u305f\u3002 \u5206\u6790/\u691c\u7d22\u7cfb\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u6642\u306b\u306f\u3001GPU\u4e0a\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u53c2\u7167\u3059\u308b\u4e8b\u3067\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3059\u4e8b\u306a\u304fGPU\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u51e6\u7406\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u5178\u578b\u7684\u306b\u306f\u3001\u6570\u767e\u4e07\u30c7\u30d0\u30a4\u30b9\u306e\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30c7\u30fc\u30bf\u3092GPU\u4e0a\u306b\u4fdd\u6301\u3057\u3066\u304a\u304d\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3084\u4f4d\u7f6e\u60c5\u5831\u306e\u66f4\u65b0\u304c\u9ad8\u983b\u5ea6\u3067\u767a\u751f\u3059\u308b\u3068\u3044\u3063\u305f\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u66f4\u65b0\u3059\u308b\u3068\u3001\u305d\u306e\u66f4\u65b0\u5c65\u6b74\u3092\u30aa\u30f3\u30e1\u30e2\u30ea\u306eREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u683c\u7d0d\u3057\u3001\u305d\u308c\u3092\u4e00\u5b9a\u9593\u9694\u304b\u3001\u307e\u305f\u306f\u5206\u6790/\u691c\u7d22\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u5b9f\u884c\u524d\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u5074\u306b\u53cd\u6620\u3057\u307e\u3059\u3002 \u3053\u306e\u4ed5\u7d44\u307f\u306b\u3088\u308a\u3001\u9ad8\u983b\u5ea6\u3067\u306e\u66f4\u65b0\u3068\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3068\u306e\u6574\u5408\u6027\u3068\u3092\u4e21\u7acb\u3057\u3066\u3044\u307e\u3059\u3002 \u30e6\u30fc\u30b6\u5b9a\u7fa9\u306eGPU\u30c7\u30fc\u30bf\u578b/\u95a2\u6570 \u30e6\u30fc\u30b6\u5b9a\u7fa9\u306eGPU\u30c7\u30fc\u30bf\u578b/\u95a2\u6570\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306eAPI\u3092\u65b0\u305f\u306b\u63d0\u4f9b\u3057\u307e\u3059\u3002 \u3053\u308c\u306b\u3088\u308a\u3001PG-Strom\u81ea\u4f53\u306b\u306f\u624b\u3092\u52a0\u3048\u308b\u3053\u3068\u306a\u304f\u3001\u30cb\u30c3\u30c1\u306a\u7528\u9014\u306e\u30c7\u30fc\u30bf\u578b\u3084\u305d\u308c\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306eSQL\u95a2\u6570\u3092\u30e6\u30fc\u30b6\u304c\u72ec\u81ea\u306b\u5b9a\u7fa9\u3001\u5b9f\u88c5\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 Notice \u672cAPI\u306f\u5b9f\u9a13\u7684\u30b9\u30c6\u30fc\u30bf\u30b9\u3067\u3042\u308a\u3001\u5c06\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u4e88\u544a\u306a\u304f\u5909\u66f4\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u307e\u305f\u3001\u672cAPI\u306e\u5229\u7528\u306b\u306fPG-Strom\u5185\u90e8\u69cb\u9020\u3092\u5341\u5206\u306b\u7406\u89e3\u3057\u3066\u3044\u308b\u4e8b\u304c\u524d\u63d0\u3067\u3059\u306e\u3067\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 PostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u63a1\u7528 PG-Strom v3.0\u4ee5\u964d\u3067\u306fPostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u3092\u63a1\u7528\u3057\u307e\u3059\u3002 \u6b74\u53f2\u7684\u306a\u7d4c\u7def\u306b\u3088\u308a\u3001\u3053\u308c\u307e\u3067\u306ePG-Strom\u3067\u306fGPLv2\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001PG-Strom\u30b3\u30a2\u6a5f\u80fd\u3084\u5468\u8fba\u30c4\u30fc\u30eb\u3068\u7d44\u307f\u5408\u308f\u305b\u305f\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306b\u30e9\u30a4\u30bb\u30f3\u30b9\u4f53\u7cfb\u304c\u969c\u5bb3\u306b\u306a\u308b\u3068\u306e\u58f0\u3092\u8907\u6570\u3044\u305f\u3060\u3044\u3066\u3044\u307e\u3057\u305f\u3002 \u305d\u306e\u4ed6\u306e\u5909\u66f4 \u72ec\u81ea\u306b int1 (8bit\u6574\u6570) \u30c7\u30fc\u30bf\u578b\u3001\u304a\u3088\u3073\u95a2\u9023\u3059\u308b\u6f14\u7b97\u5b50\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 pg2arrow \u306b --inner-join \u304a\u3088\u3073 --outer-join \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002PostgreSQL\u306e\u5217\u6570\u5236\u9650\u3092\u8d8a\u3048\u305f\u6570\u306e\u5217\u3092\u6301\u3064Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u30de\u30eb\u30c1GPU\u74b0\u5883\u3067\u306f\u3001GPU\u3054\u3068\u306b\u5c02\u7528\u306eGPU Memory Keeper\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u304c\u7acb\u3061\u4e0a\u304c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 PostgreSQL v13.x \u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 CUDA 11.2 \u304a\u3088\u3073 Ampere\u4e16\u4ee3\u306eGPU\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 ScaleFlux\u793e\u306eComputational Storage\u88fd\u54c1CSD2000\u30b7\u30ea\u30fc\u30ba\u3067\u306eGPUDirect SQL\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\uff08cuFile\u30c9\u30e9\u30a4\u30d0\u306e\u307f\uff09 \u96d1\u591a\u306a\u30d0\u30b0\u306e\u4fee\u6b63 \u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd PostgreSQL v10.x \u7cfb\u5217\u306e\u30b5\u30dd\u30fc\u30c8\u304c\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002 Python\u30b9\u30af\u30ea\u30d7\u30c8\u3068\u306e\u30c7\u30fc\u30bf\u9023\u643a\u6a5f\u80fd\uff08PyStrom\uff09\u304c\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002","title":"PG-Strom v3.0"},{"location":"release_v3.0/#pg-strom-v30","text":"PG-Strom Development Team (29-Jun-2021)","title":"PG-Strom v3.0\u30ea\u30ea\u30fc\u30b9"},{"location":"release_v3.0/#_1","text":"PG-Strom v3.0\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u5909\u66f4\u306f\u70b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 NVIDIA GPUDirect Storage (cuFile) \u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u3044\u304f\u3064\u304b\u306ePostGIS\u95a2\u6570\u304cGPU\u3067\u5b9f\u884c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3057\u305fGpuJoin\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u65b0\u305f\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u6a5f\u80fd\u304c\u5b9f\u88c5\u3055\u308c\u307e\u3057\u305f\u3002 \u30e6\u30fc\u30b6\u5b9a\u7fa9\u306eGPU\u30c7\u30fc\u30bf\u578b/\u95a2\u6570/\u6f14\u7b97\u5b50\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002(\u5b9f\u9a13\u7684) \u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30e9\u30a4\u30bb\u30f3\u30b9\u3092GPLv2\u304b\u3089PostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u3078\u3068\u5207\u308a\u66ff\u3048\u307e\u3057\u305f\u3002","title":"\u6982\u8981"},{"location":"release_v3.0/#_2","text":"PostgreSQL v11, v12, v13 CUDA Toolkit 11.2 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d)","title":"\u52d5\u4f5c\u74b0\u5883"},{"location":"release_v3.0/#nvidia-gpudirect-storage","text":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL \u7528\u306e\u30c9\u30e9\u30a4\u30d0\u3068\u3057\u3066\u3001\u5f93\u6765\u306e nvme_strom \u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u52a0\u3048\u3066\u3001 NVIDIA\u304c\u958b\u767a\u3092\u9032\u3081\u3066\u3044\u308b GPUDirect Storage \u306b\u3082\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u3069\u3061\u3089\u306e\u30c9\u30e9\u30a4\u30d0\u3082\u6982\u306d\u540c\u7b49\u306e\u6a5f\u80fd\u3001\u6027\u80fd\u3092\u6709\u3057\u3066\u3044\u307e\u3059\u304c\u3001GPUDirect Storage\u306e\u5bfe\u5fdc\u306b\u3088\u308a\u3001\u5f93\u6765\u304b\u3089\u306e\u30ed\u30fc\u30ab\u30ebNVME-SSD\u306b\u52a0\u3048\u3066\u3001NVME-oF(NVME over Fabrics)\u30c7\u30d0\u30a4\u30b9\u3084SDS(Software Defined Storage)\u30c7\u30d0\u30a4\u30b9\u3001\u304a\u3088\u3073\u305d\u306e\u4e0a\u306b\u69cb\u7bc9\u3055\u308c\u305f\u5171\u6709\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u306eGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306b\u3082\u5bfe\u5fdc\u3059\u308b\u4e8b\u3068\u306a\u308a\u3001\u3088\u308a\u5927\u898f\u6a21\u3067\u67d4\u8edf\u306a\u30b9\u30c8\u30ec\u30fc\u30b8\u69cb\u6210\u3092\u53d6\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002 GPUDirect SQL\u306f\u3001PostgreSQL\u6a19\u6e96\u306eHeap\u30c6\u30fc\u30d6\u30eb\u3068Apache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u51fa\u3057\u306b\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u3044\u305a\u308c\u306e\u5834\u5408\u306b\u304a\u3044\u3066\u3082\u3001\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u304c\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u3068\u306a\u308b\u3088\u3046\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u304a\u3044\u3066\u9855\u8457\u306a\u9ad8\u901f\u5316\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u6e2c\u5b9a\u7d50\u679c\u306f\u3001GPU 1\u53f0\u3068NVME-SSD 4\u53f0\u3092\u7528\u3044\u3066\u3001SSBM(Star Schema Benchmark)\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPUDirect SQL\u3092GPUDirect Storage\u30c9\u30e9\u30a4\u30d0\u306e\u4e0b\u3067\u5b9f\u884c\u3057\u305f\u3082\u306e\u3067\u3059\u304c\u3001PostgreSQL heap\u3068Apache Arrow\u306e\u3044\u305a\u308c\u306e\u30b1\u30fc\u30b9\u306b\u304a\u3044\u3066\u3082\u3001\u5358\u4f4d\u6642\u9593\u3042\u305f\u308a\u306e\u30c7\u30fc\u30bf\u51e6\u7406\u4ef6\u6570\u306fPostgreSQL\u306b\u6bd4\u3079\u5927\u5e45\u306b\u6539\u5584\u3057\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 \u307e\u305f\u3001\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u4e2d\u306eNVME-SSD\u304b\u3089\u306e\u8aad\u307f\u51fa\u3057\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u3092\u6bd4\u8f03\u3057\u3066\u307f\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4ecb\u3057\u305f\u8aad\u51fa\u3057\uff08PostgreSQL Heap Storage\uff09\u306b\u6bd4\u3079\u3001GPUDirect Storage\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u306b\u306f\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9650\u754c\u306b\u8fd1\u3044\u6027\u80fd\u5024\u3092\u5f15\u304d\u51fa\u305b\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002","title":"NVIDIA GPUDirect Storage"},{"location":"release_v3.0/#gpupostgisgist","text":"\u3044\u304f\u3064\u304b\u306ePostGIS\u95a2\u6570\u306bGPU\u7248\u3092\u5b9f\u88c5\u3057\u307e\u3057\u305f\u3002 \u6761\u4ef6\u53e5\u3067\u3053\u308c\u3089\u306ePostGIS\u95a2\u6570\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001PG-Strom\u306fGPU\u5074\u3067\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046GPU\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u81ea\u52d5\u751f\u6210\u3057\u307e\u3059\u3002 GPU\u7248PostGIS\u306e\u4e3b\u305f\u308b\u30bf\u30fc\u30b2\u30c3\u30c8\u306f\u3001\u643a\u5e2f\u96fb\u8a71\u3084\u81ea\u52d5\u8eca\u3068\u3044\u3063\u305f\u79fb\u52d5\u4f53\u30c7\u30d0\u30a4\u30b9\u306e\u6700\u65b0\u306e\u4f4d\u7f6e\u60c5\u5831\uff08Real-time Location Data\uff09\u3068\u3001\u5e02\u533a\u753a\u6751\u3084\u5b66\u533a\u306e\u5883\u754c\u3068\u3044\u3063\u305f\u9818\u57df\uff08Area Definition Data\uff09\u3068\u306e\u9593\u3067\u884c\u308f\u308c\u308b\u7a81\u5408\u51e6\u7406\u3067\u3059\u3002 \u4f8b\u3048\u3070\u3001\u4e00\u5b9a\u306e\u30a8\u30ea\u30a2\u5185\u306b\u5b58\u5728\u3059\u308b\u643a\u5e2f\u96fb\u8a71\u306b\u5e83\u544a\u3092\u914d\u4fe1\u3057\u305f\u3044\u6642\u3001\u4e00\u5b9a\u306e\u30a8\u30ea\u30a2\u5185\u306b\u5b58\u5728\u3059\u308b\u81ea\u52d5\u8eca\u306b\u6e0b\u6ede\u60c5\u5831\u3092\u914d\u4fe1\u3057\u305f\u3044\u6642\u306a\u3069\u3001\u4f4d\u7f6e\u3092\u30ad\u30fc\u3068\u3057\u3066\u8a72\u5f53\u3059\u308b\u30c7\u30d0\u30a4\u30b9\u3092\u691c\u7d22\u3059\u308b\u51e6\u7406\u306b\u52b9\u679c\u3092\u767a\u63ee\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u6771\u4eac\u8fd1\u90ca\u30a8\u30ea\u30a2\u3092\u5305\u542b\u3059\u308b\u77e9\u5f62\u9818\u57df\u5185\u306b\u30e9\u30f3\u30c0\u30e0\u306a1600\u4e07\u500b\u306e\u70b9\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3057\u3001\u5e02\u533a\u753a\u6751\u3054\u3068\u306b\u305d\u306e\u9818\u57df\u5185\u306b\u542b\u307e\u308c\u308b\u70b9\u306e\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u3059\u308b\u3068\u3044\u3046\u51e6\u7406\u306e\u5fdc\u7b54\u6642\u9593\u3092\u8a08\u6e2c\u3057\u305f\u3082\u306e\u3067\u3059\u3002 \u901a\u5e38\u306ePostGIS\u3068GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u306f160\u79d2\u4ee5\u4e0a\u3092\u8981\u3057\u305f\u51e6\u7406\u304c\u3001GPU\u7248PostGIS\u3068GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u304a\u3044\u3066\u306f\u3001\u50c5\u304b0.830\u79d2\u3067\u5fdc\u7b54\u3057\u3066\u3044\u307e\u3059\u3002","title":"GPU\u7248PostGIS\u3068GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9"},{"location":"release_v3.0/#gpu","text":"GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u4e88\u3081\u9818\u57df\u3092\u78ba\u4fdd\u3057\u3066\u304a\u304d\u3001\u5bfe\u8c61\u3068\u306a\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u8907\u88fd\u3092\u4fdd\u6301\u3057\u3066\u304a\u304f\u6a5f\u80fd\u3067\u3059\u3002 \u6bd4\u8f03\u7684\u5c0f\u898f\u6a21\u306e\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\uff08\uff5e10GB\u7a0b\u5ea6\uff09\u3067\u3001\u66f4\u65b0\u983b\u5ea6\u306e\u9ad8\u3044\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u5206\u6790/\u691c\u7d22\u7cfb\u306e\u30af\u30a8\u30ea\u3092\u52b9\u7387\u3088\u304f\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u307e\u3057\u305f\u3002 \u5206\u6790/\u691c\u7d22\u7cfb\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u6642\u306b\u306f\u3001GPU\u4e0a\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u53c2\u7167\u3059\u308b\u4e8b\u3067\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3059\u4e8b\u306a\u304fGPU\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u51e6\u7406\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u5178\u578b\u7684\u306b\u306f\u3001\u6570\u767e\u4e07\u30c7\u30d0\u30a4\u30b9\u306e\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30c7\u30fc\u30bf\u3092GPU\u4e0a\u306b\u4fdd\u6301\u3057\u3066\u304a\u304d\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3084\u4f4d\u7f6e\u60c5\u5831\u306e\u66f4\u65b0\u304c\u9ad8\u983b\u5ea6\u3067\u767a\u751f\u3059\u308b\u3068\u3044\u3063\u305f\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u66f4\u65b0\u3059\u308b\u3068\u3001\u305d\u306e\u66f4\u65b0\u5c65\u6b74\u3092\u30aa\u30f3\u30e1\u30e2\u30ea\u306eREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u683c\u7d0d\u3057\u3001\u305d\u308c\u3092\u4e00\u5b9a\u9593\u9694\u304b\u3001\u307e\u305f\u306f\u5206\u6790/\u691c\u7d22\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u5b9f\u884c\u524d\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u5074\u306b\u53cd\u6620\u3057\u307e\u3059\u3002 \u3053\u306e\u4ed5\u7d44\u307f\u306b\u3088\u308a\u3001\u9ad8\u983b\u5ea6\u3067\u306e\u66f4\u65b0\u3068\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3068\u306e\u6574\u5408\u6027\u3068\u3092\u4e21\u7acb\u3057\u3066\u3044\u307e\u3059\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5"},{"location":"release_v3.0/#gpu_1","text":"\u30e6\u30fc\u30b6\u5b9a\u7fa9\u306eGPU\u30c7\u30fc\u30bf\u578b/\u95a2\u6570\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306eAPI\u3092\u65b0\u305f\u306b\u63d0\u4f9b\u3057\u307e\u3059\u3002 \u3053\u308c\u306b\u3088\u308a\u3001PG-Strom\u81ea\u4f53\u306b\u306f\u624b\u3092\u52a0\u3048\u308b\u3053\u3068\u306a\u304f\u3001\u30cb\u30c3\u30c1\u306a\u7528\u9014\u306e\u30c7\u30fc\u30bf\u578b\u3084\u305d\u308c\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306eSQL\u95a2\u6570\u3092\u30e6\u30fc\u30b6\u304c\u72ec\u81ea\u306b\u5b9a\u7fa9\u3001\u5b9f\u88c5\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 Notice \u672cAPI\u306f\u5b9f\u9a13\u7684\u30b9\u30c6\u30fc\u30bf\u30b9\u3067\u3042\u308a\u3001\u5c06\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u4e88\u544a\u306a\u304f\u5909\u66f4\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u307e\u305f\u3001\u672cAPI\u306e\u5229\u7528\u306b\u306fPG-Strom\u5185\u90e8\u69cb\u9020\u3092\u5341\u5206\u306b\u7406\u89e3\u3057\u3066\u3044\u308b\u4e8b\u304c\u524d\u63d0\u3067\u3059\u306e\u3067\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002","title":"\u30e6\u30fc\u30b6\u5b9a\u7fa9\u306eGPU\u30c7\u30fc\u30bf\u578b/\u95a2\u6570"},{"location":"release_v3.0/#postgresql","text":"PG-Strom v3.0\u4ee5\u964d\u3067\u306fPostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u3092\u63a1\u7528\u3057\u307e\u3059\u3002 \u6b74\u53f2\u7684\u306a\u7d4c\u7def\u306b\u3088\u308a\u3001\u3053\u308c\u307e\u3067\u306ePG-Strom\u3067\u306fGPLv2\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001PG-Strom\u30b3\u30a2\u6a5f\u80fd\u3084\u5468\u8fba\u30c4\u30fc\u30eb\u3068\u7d44\u307f\u5408\u308f\u305b\u305f\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306b\u30e9\u30a4\u30bb\u30f3\u30b9\u4f53\u7cfb\u304c\u969c\u5bb3\u306b\u306a\u308b\u3068\u306e\u58f0\u3092\u8907\u6570\u3044\u305f\u3060\u3044\u3066\u3044\u307e\u3057\u305f\u3002","title":"PostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u63a1\u7528"},{"location":"release_v3.0/#_3","text":"\u72ec\u81ea\u306b int1 (8bit\u6574\u6570) \u30c7\u30fc\u30bf\u578b\u3001\u304a\u3088\u3073\u95a2\u9023\u3059\u308b\u6f14\u7b97\u5b50\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 pg2arrow \u306b --inner-join \u304a\u3088\u3073 --outer-join \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002PostgreSQL\u306e\u5217\u6570\u5236\u9650\u3092\u8d8a\u3048\u305f\u6570\u306e\u5217\u3092\u6301\u3064Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u30de\u30eb\u30c1GPU\u74b0\u5883\u3067\u306f\u3001GPU\u3054\u3068\u306b\u5c02\u7528\u306eGPU Memory Keeper\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u304c\u7acb\u3061\u4e0a\u304c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 PostgreSQL v13.x \u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 CUDA 11.2 \u304a\u3088\u3073 Ampere\u4e16\u4ee3\u306eGPU\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 ScaleFlux\u793e\u306eComputational Storage\u88fd\u54c1CSD2000\u30b7\u30ea\u30fc\u30ba\u3067\u306eGPUDirect SQL\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\uff08cuFile\u30c9\u30e9\u30a4\u30d0\u306e\u307f\uff09 \u96d1\u591a\u306a\u30d0\u30b0\u306e\u4fee\u6b63","title":"\u305d\u306e\u4ed6\u306e\u5909\u66f4"},{"location":"release_v3.0/#_4","text":"PostgreSQL v10.x \u7cfb\u5217\u306e\u30b5\u30dd\u30fc\u30c8\u304c\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002 Python\u30b9\u30af\u30ea\u30d7\u30c8\u3068\u306e\u30c7\u30fc\u30bf\u9023\u643a\u6a5f\u80fd\uff08PyStrom\uff09\u304c\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002","title":"\u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd"},{"location":"release_v5.0/","text":"PG-Strom v5.0\u30ea\u30ea\u30fc\u30b9 PG-Strom Development Team (15-Dec-2023) \u6982\u8981 PG-Strom v5.0\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u5909\u66f4\u306f\u70b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 \u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u3092\u4e00\u65b0\u3057\u3001\u5f93\u6765\u306e\u8a2d\u8a08\u306b\u304a\u3051\u308b\u554f\u984c\u70b9\u3092\u6539\u826f\u3057\u307e\u3057\u305f\u3002 \u30d7\u30ed\u30bb\u30b9\u30e2\u30c7\u30eb\u304c\u30de\u30eb\u30c1\u30d7\u30ed\u30bb\u30b9\u304b\u3089\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001GPU\u30ea\u30bd\u30fc\u30b9\u306e\u6d88\u8cbb\u91cf\u3092\u524a\u6e1b\u3057\u3001\u30bf\u30b9\u30af\u30b9\u30a4\u30c3\u30c1\u30f3\u30b0\u304c\u8efd\u91cf\u306b\u306a\u308a\u307e\u3057\u305f\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u306fCUDA C++\u3067\u52d5\u7684\u751f\u6210\u3055\u308c\u305f\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u304b\u3089\u7591\u4f3c\u30b3\u30fc\u30c9\u3078\u3068\u7f6e\u304d\u63db\u3048\u3089\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5b9f\u884c\u6642\u30b3\u30f3\u30d1\u30a4\u30eb(NVRTC)\u304c\u4e0d\u8981\u3068\u306a\u308a\u30af\u30a8\u30ea\u306e\u5fdc\u7b54\u901f\u5ea6\u304c\u5411\u4e0a\u3057\u305f\u307b\u304b\u3001\u5c06\u6765\u7684\u306bCSD(Computational Storage Drive)\u3084DPU(Data Processing Unit)\u3067\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u8a2d\u8a08\u5909\u66f4\u3067\u3059\u3002 GPU-Cache\u306fCUDA\u30de\u30cd\u30fc\u30b8\u30c9\u30e1\u30e2\u30ea\u4e0a\u306b\u5c55\u958b\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30aa\u30fc\u30d0\u30fc\u30b3\u30df\u30c3\u30c8\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u4e0a\u306ePostgreSQL\u30c7\u30fc\u30bf\u578b\u306e\u8868\u73fe\u304c\u3001Coalesced Memory Access\u3092\u610f\u8b58\u3057\u305f\u30ec\u30a4\u30a2\u30a6\u30c8\u306b\u5909\u308f\u308a\u307e\u3057\u305f\u3002 GpuPreAgg\u3067\u306eGROUP BY\u51e6\u7406\u304c\u4e00\u65b0\u3055\u308c\u3001\u5168\u822c\u7684\u306a\u51e6\u7406\u901f\u5ea6\u304c\u5411\u4e0a\u3057\u307e\u3057\u305f\u3002 GpuJoin\u306e\u6bb5\u6570\u304c\u6df1\u304f\u306a\u3063\u3066\u3082\u3001\u30bf\u30d7\u30eb\u306e\u5c55\u958b\u306f\u4e00\u56de\u3060\u3051\u3067\u6e08\u3080\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 Arrow_Fdw\u304a\u3088\u3073Pg2Arrow\u304cmin/max\u7d71\u8a08\u5024\u4ed8\u304d\u306eArrow\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d1\u30b1\u30c3\u30c8\u3092\u30ad\u30e3\u30d7\u30c1\u30e3\u3059\u308bPcap2Arrow\u30c4\u30fc\u30eb\u3001\u304a\u3088\u3073Arrow\u30d5\u30a1\u30a4\u30eb\u3092CSV\u51fa\u529b\u3059\u308barrow2csv\u30c4\u30fc\u30eb\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 \u52d5\u4f5c\u74b0\u5883 PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d; Volta\u4ee5\u964d\u3092\u63a8\u5968) \u30d7\u30ed\u30bb\u30b9\u30e2\u30c7\u30eb\u306e\u5909\u66f4 v5.0\u3067\u306f\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\uff08PG-Strom GPU Service\uff09\u304cGPU\u306e\u30ea\u30bd\u30fc\u30b9\u7ba1\u7406\u3084\u30bf\u30b9\u30af\u6295\u5165\u3092\u7d71\u62ec\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u3001PostgreSQL\u306e\u5404\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306fIPC\u3092\u901a\u3058\u3066GPU Service\u3078\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u51fa\u3057\u3001\u7d50\u679c\u3092\u53d7\u3051\u53d6\u308b\u5f62\u306b\u6539\u3081\u3089\u308c\u307e\u3057\u305f\u3002 v3.x\u7cfb\u5217\u307e\u3067\u306fPostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u304c\u500b\u5225\u306bGPU\u3092\u5236\u5fa1\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u306e\u8a2d\u8a08\u306f\u3001\u304b\u3064\u3066CUDA\u3084PG-Strom\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u54c1\u8cea\u304c\u5341\u5206\u3067\u306a\u3044\u6642\u4ee3\u306b\u554f\u984c\u7b87\u6240\u306e\u7279\u5b9a\u3092\u5bb9\u6613\u306b\u3059\u308b\u3068\u3044\u3046\u5229\u70b9\u304c\u3042\u3063\u305f\u3082\u306e\u306e\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30bb\u30c3\u30b7\u30e7\u30f3\u6570\u304c\u5897\u52a0\u3059\u308b\u3068\u6975\u7aef\u306bGPU\u30ea\u30bd\u30fc\u30b9\u3092\u6d88\u8cbb\u3057\u3001\u307e\u305f\u30bf\u30b9\u30af\u5207\u308a\u66ff\u3048\u306e\u89b3\u70b9\u304b\u3089\u3082\u975e\u63a8\u5968\u3068\u3055\u308c\u308b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u69cb\u9020\u3067\u3057\u305f\u3002 \u3053\u306e\u8a2d\u8a08\u5909\u66f4\u306b\u3088\u308a\u3001PG-Strom v5.0\u306f\u540c\u6642\u5b9f\u884c\u6570\u306e\u5897\u52a0\u306b\u5bfe\u3057\u3066\u9811\u5f37\u306b\u306a\u3063\u305f\u4ed6\u3001\u9ad8\u8ca0\u8377\u306aGPU\u30bf\u30b9\u30af\u306e\u5b9f\u884c\u6027\u80fd\u304c\u5411\u4e0a\u3057\u3066\u3044\u307e\u3059\u3002 \u7591\u4f3c\u30b3\u30fc\u30c9\u306e\u5c0e\u5165 PG-Strom v5.0\u3067\u306f\u3001SQL\u304b\u3089\u72ec\u81ea\u306e\u300e\u7591\u4f3c\u30b3\u30fc\u30c9\u300f\u3092\u751f\u6210\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u306f\u3053\u306e\u300e\u7591\u4f3c\u30b3\u30fc\u30c9\u300f\u3092\u5b9f\u884c\u3059\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u3068\u3057\u3066\u50cd\u304d\u307e\u3059\u3002v3.x\u7cfb\u5217\u306e\u3088\u3046\u306bCUDA C++\u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u3053\u308c\u306f\u4e00\u898b\u3001\u6027\u80fd\u4f4e\u4e0b\u306e\u8981\u56e0\u3068\u898b\u3048\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u3057\u304b\u3057\u3001\u5143\u3005\u52d5\u7684\u30b3\u30fc\u30c9\u751f\u6210\u306e\u5bfe\u8c61\u3068\u306a\u3063\u3066\u3044\u305f\u306e\u306fWHERE\u53e5\u306a\u3069\u30af\u30a8\u30ea\u306e\u5ea6\u306b\u5909\u5316\u3059\u308b\u3054\u304f\u4e00\u90e8\u5206\u3060\u3051\u3067\u3042\u308a\u3001\u5927\u534a\u306e\u5b9f\u88c5\u306f\u9759\u7684\u306b\u30d3\u30eb\u30c9\u3055\u308c\u3066\u3044\u305f\u307b\u304b\u3001NVRTC\u306b\u3088\u308b\u5b9f\u884c\u6642\u30b3\u30f3\u30d1\u30a4\u30eb\u306e\u51e6\u7406\uff08150ms\uff5e\u7a0b\u5ea6\uff09\u3092\u7701\u7565\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u305f\u3081\u3001\u5fdc\u7b54\u6642\u9593\u306e\u6539\u5584\u306b\u5bc4\u4e0e\u3057\u3066\u3044\u307e\u3059\u3002 \u300e\u7591\u4f3c\u30b3\u30fc\u30c9\u300f\u306fEXPLAIN VERBOSE\u306b\u3088\u3063\u3066\u8868\u793a\u3055\u308c\u308b\u4f4e\u30ec\u30d9\u30eb\u306a\u30b3\u30de\u30f3\u30c9\u30bb\u30c3\u30c8\u3067\u3001\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bWHERE\u53e5\u306b lo_quantity > 10 \u3068\u3044\u3046\u6f14\u7b97\u5f0f\u3092\u542b\u3080\u30af\u30a8\u30ea\u306f\u3001 Scan Quals OpCode \u3068\u3057\u3066 lo_quantity \u5217\u3068\u5b9a\u6570 10 \u3068\u306e\u5927\u5c0f\u95a2\u4fc2\u3092\u6bd4\u8f03\u3059\u308b numeric_gt \u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u3088\u3046\u51e6\u7406\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002 postgres=# explain verbose select count(*), sum(lo_quantity), lo_shipmode from lineorder where lo_quantity > 10 group by lo_shipmode; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- HashAggregate (cost=3242387.01..3242387.10 rows=7 width=51) Output: pgstrom.fcount((pgstrom.nrows())), pgstrom.sum_fp_num((pgstrom.psum((lo_quantity)::double precision))), lo_shipmode Group Key: lineorder.lo_shipmode -> Custom Scan (GpuPreAgg) on public.lineorder (cost=3242386.89..3242386.96 rows=7 width=51) Output: (pgstrom.nrows()), (pgstrom.psum((lo_quantity)::double precision)), lo_shipmode GPU Projection: pgstrom.nrows(), pgstrom.psum((lo_quantity)::double precision), lo_shipmode GPU Scan Quals: (lo_quantity > '10'::numeric) [rows: 600128800 -> 479262800] GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , KVecs-Buffer: nbytes: 83968, ndims: 2, items=[kvec0=<0x0000-dfff, type='numeric', expr='lo_quantity'>, kvec1=<0xe000-147ff, type='bpchar', expr='lo_shipmode'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, ]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, ]}}} Scan Quals OpCode: {Func(bool)::numeric_gt args=[{Var(numeric): slot=0, expr='lo_quantity'}, {Const(numeric): value='10'}]} Group-By KeyHash OpCode: {HashValue arg={SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}} Group-By KeyLoad OpCode: {LoadVars(depth=-2): kvars=[]} Group-By KeyComp OpCode: {Func(bool)::bpchareq args=[{Var(bpchar): slot=1, expr='lo_shipmode'}, {Var(bpchar): slot=2, expr='lo_shipmode'}]} Partial Aggregation OpCode: {AggFuncs args=[{SaveExpr: arg={Func(float8)::float8 arg={Var(numeric): kvec=0x0000-e000, expr='lo_quantity'}}}, {SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}]} Partial Function BufSz: 24 (18 rows) \u73fe\u5728\u306f\u307e\u3060\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u3053\u306e\u7591\u4f3c\u30b3\u30fc\u30c9\u306f\u3001\u5c06\u6765\u7684\u306bCSD(Computational Storage Drive)\u3084DPU(Data Processing Unit)\u3067SQL\u51e6\u7406\u3092\u30aa\u30d5\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u6539\u5584 CPU\u3068\u6bd4\u8f03\u3057\u3066\u3001GPU\u306f\u5e83\u5e2f\u57df\u306a\u30e1\u30e2\u30ea\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u6027\u80fd\u3092\u5f15\u304d\u51fa\u3059\u306b\u306f\u8fd1\u508d\u306e\u30e1\u30e2\u30ea\u9818\u57df\u3092\u540c\u3058\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308bCoalesced Memory Access\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 v5.0\u3067\u306fGPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u306b\u304a\u3051\u308bPostgreSQL\u30c7\u30fc\u30bf\u578b\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u304c\u6539\u826f\u3055\u308c\u3001Coalesced Memory Access\u306b\u9069\u3057\u305f\u5f62\u5f0f\u3068\u306a\u308a\u307e\u3057\u305f\u3002 PostgreSQL\u306e\u30c7\u30fc\u30bf\u578b\u3092\u305d\u306e\u307e\u307e\u5229\u7528\u3057\u305f\u5834\u5408\u3001\u3042\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u53c2\u7167\u3055\u308c\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u98db\u3073\u98db\u3073\u306e\u4f4d\u7f6e\u3092\u53d6\u308b\u4e8b\u306b\u306a\u308a\u3001DRAM\u304b\u3089\u306e\u8aad\u51fa\u3057\u5e2f\u57df\u3092\u6709\u52b9\u306b\u6d3b\u7528\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u308c\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u6bce\u306b\u8907\u6570\u500b\u307e\u3068\u3081\u3066\u914d\u7f6e\u3059\u308b\u4e8b\u3067\u3001\u96a3\u63a5\u30b3\u30a2\u304c\u96a3\u63a5\u9818\u57df\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u3001Coalesced Memory Access\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002 \u3053\u306e\u6539\u826f\u306f\u3001\u6975\u3081\u3066\u9ad8\u6027\u80fd\u306a\u30e1\u30e2\u30ea\u5e2f\u57df\u3092\u6301\u3064\u30cf\u30a4\u30a8\u30f3\u30c9GPU\u88fd\u54c1\u3060\u3051\u3067\u306a\u304f\u3001\u30df\u30c9\u30eb\u30a8\u30f3\u30c9\u7d1a\u306eGPU\u3067\u3082\u5341\u5206\u306a\u5b9f\u884c\u6027\u80fd\u3092\u5f15\u304d\u51fa\u3059\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002 Arrow_Fdw\u306e\u7d71\u8a08\u60c5\u5831\u30b5\u30dd\u30fc\u30c8 Pg2Arrow\u3067min/max\u7d71\u8a08\u60c5\u5831\u4ed8\u304d\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 Pg2Arrow\u306e\u65b0\u305f\u306a\u30aa\u30d7\u30b7\u30e7\u30f3 --stat=COLUMN_NAME \u306f\u3001RecordBatch\u5358\u4f4d\u3067\u6307\u5b9a\u3057\u305f\u5217\u306e\u6700\u5927\u5024/\u6700\u5c0f\u5024\u3092\u8a18\u9332\u3057\u3066\u304a\u304d\u3001\u305d\u308c\u3092Apache Arrow\u306eCustom-Metadata\u30e1\u30ab\u30cb\u30ba\u30e0\u3092\u5229\u7528\u3057\u3066\u30d5\u30c3\u30bf\u306b\u57cb\u3081\u8fbc\u307f\u307e\u3059\u3002 Arrow_Fdw\u3092\u4ecb\u3057\u3066Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u51fa\u3059\u969b\u3001\u4e0a\u8a18\u306emin/max\u7d71\u8a08\u60c5\u5831\u3092\u5229\u7528\u3057\u305f\u7bc4\u56f2\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30b9\u30ad\u30e3\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b\u691c\u7d22\u6761\u4ef6\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3042\u3063\u305f\u5834\u5408\u3001 WHERE ymd BETERRN '2020-01-01'::date AND '2021-12-31'::date ymd\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6700\u5927\u5024\u304c '2020-01-01'::date \u672a\u6e80\u3067\u3042\u308bRecord Batch\u3084\u3001 ymd\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6700\u5c0f\u5024\u304c '2021-12-31 ::date`\u3088\u308a\u5927\u304d\u306aRecord Batch\u306f\u3001 \u691c\u7d22\u6761\u4ef6\u306b\u30de\u30c3\u30c1\u3057\u306a\u3044\u4e8b\u304c\u660e\u3089\u304b\u3067\u3042\u308b\u305f\u3081\u3001Arrow_Fdw\u306f\u3053\u306eRecord Batch\u3092\u8aad\u307f\u98db\u3070\u3057\u307e\u3059\u3002 \u3053\u308c\u306b\u3088\u308a\u3001\u4f8b\u3048\u3070\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u306a\u3069\u3001\u8fd1\u3057\u3044\u5024\u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u304c\u8fd1\u508d\u306b\u96c6\u307e\u3063\u3066\u3044\u308b\u30d1\u30bf\u30fc\u30f3\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u304a\u3044\u3066\u306f\u3001\u7bc4\u56f2\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u7528\u3044\u305f\u7d5e\u8fbc\u307f\u3068\u540c\u7b49\u306e\u6027\u80fd\u304c\u5f97\u3089\u308c\u307e\u3059\u3002 \u305d\u306e\u4ed6\u306e\u5909\u66f4\u70b9 PostgreSQL v14 \u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002v15\u4ee5\u964d\u3078\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3092\u304a\u9858\u3044\u3057\u307e\u3059\u3002 Partition-wise GpuJoin\u6a5f\u80fd\u306b\u95a2\u3057\u3066\u306f\u3001\u958b\u767a\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u4e0a\u306e\u7406\u7531\u306b\u3088\u308a\u3001v5.0\u3067\u306f\u7121\u52b9\u5316\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5c06\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u518d\u3073\u5b9f\u88c5\u3055\u308c\u308b\u4e88\u5b9a\u3067\u3059\u3002","title":"PG-Strom v5.0"},{"location":"release_v5.0/#pg-strom-v50","text":"PG-Strom Development Team (15-Dec-2023)","title":"PG-Strom v5.0\u30ea\u30ea\u30fc\u30b9"},{"location":"release_v5.0/#_1","text":"PG-Strom v5.0\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u5909\u66f4\u306f\u70b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 \u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u3092\u4e00\u65b0\u3057\u3001\u5f93\u6765\u306e\u8a2d\u8a08\u306b\u304a\u3051\u308b\u554f\u984c\u70b9\u3092\u6539\u826f\u3057\u307e\u3057\u305f\u3002 \u30d7\u30ed\u30bb\u30b9\u30e2\u30c7\u30eb\u304c\u30de\u30eb\u30c1\u30d7\u30ed\u30bb\u30b9\u304b\u3089\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001GPU\u30ea\u30bd\u30fc\u30b9\u306e\u6d88\u8cbb\u91cf\u3092\u524a\u6e1b\u3057\u3001\u30bf\u30b9\u30af\u30b9\u30a4\u30c3\u30c1\u30f3\u30b0\u304c\u8efd\u91cf\u306b\u306a\u308a\u307e\u3057\u305f\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u306fCUDA C++\u3067\u52d5\u7684\u751f\u6210\u3055\u308c\u305f\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u304b\u3089\u7591\u4f3c\u30b3\u30fc\u30c9\u3078\u3068\u7f6e\u304d\u63db\u3048\u3089\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5b9f\u884c\u6642\u30b3\u30f3\u30d1\u30a4\u30eb(NVRTC)\u304c\u4e0d\u8981\u3068\u306a\u308a\u30af\u30a8\u30ea\u306e\u5fdc\u7b54\u901f\u5ea6\u304c\u5411\u4e0a\u3057\u305f\u307b\u304b\u3001\u5c06\u6765\u7684\u306bCSD(Computational Storage Drive)\u3084DPU(Data Processing Unit)\u3067\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u8a2d\u8a08\u5909\u66f4\u3067\u3059\u3002 GPU-Cache\u306fCUDA\u30de\u30cd\u30fc\u30b8\u30c9\u30e1\u30e2\u30ea\u4e0a\u306b\u5c55\u958b\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30aa\u30fc\u30d0\u30fc\u30b3\u30df\u30c3\u30c8\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u4e0a\u306ePostgreSQL\u30c7\u30fc\u30bf\u578b\u306e\u8868\u73fe\u304c\u3001Coalesced Memory Access\u3092\u610f\u8b58\u3057\u305f\u30ec\u30a4\u30a2\u30a6\u30c8\u306b\u5909\u308f\u308a\u307e\u3057\u305f\u3002 GpuPreAgg\u3067\u306eGROUP BY\u51e6\u7406\u304c\u4e00\u65b0\u3055\u308c\u3001\u5168\u822c\u7684\u306a\u51e6\u7406\u901f\u5ea6\u304c\u5411\u4e0a\u3057\u307e\u3057\u305f\u3002 GpuJoin\u306e\u6bb5\u6570\u304c\u6df1\u304f\u306a\u3063\u3066\u3082\u3001\u30bf\u30d7\u30eb\u306e\u5c55\u958b\u306f\u4e00\u56de\u3060\u3051\u3067\u6e08\u3080\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 Arrow_Fdw\u304a\u3088\u3073Pg2Arrow\u304cmin/max\u7d71\u8a08\u5024\u4ed8\u304d\u306eArrow\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d1\u30b1\u30c3\u30c8\u3092\u30ad\u30e3\u30d7\u30c1\u30e3\u3059\u308bPcap2Arrow\u30c4\u30fc\u30eb\u3001\u304a\u3088\u3073Arrow\u30d5\u30a1\u30a4\u30eb\u3092CSV\u51fa\u529b\u3059\u308barrow2csv\u30c4\u30fc\u30eb\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002","title":"\u6982\u8981"},{"location":"release_v5.0/#_2","text":"PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d; Volta\u4ee5\u964d\u3092\u63a8\u5968)","title":"\u52d5\u4f5c\u74b0\u5883"},{"location":"release_v5.0/#_3","text":"v5.0\u3067\u306f\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\uff08PG-Strom GPU Service\uff09\u304cGPU\u306e\u30ea\u30bd\u30fc\u30b9\u7ba1\u7406\u3084\u30bf\u30b9\u30af\u6295\u5165\u3092\u7d71\u62ec\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u3001PostgreSQL\u306e\u5404\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306fIPC\u3092\u901a\u3058\u3066GPU Service\u3078\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u51fa\u3057\u3001\u7d50\u679c\u3092\u53d7\u3051\u53d6\u308b\u5f62\u306b\u6539\u3081\u3089\u308c\u307e\u3057\u305f\u3002 v3.x\u7cfb\u5217\u307e\u3067\u306fPostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u304c\u500b\u5225\u306bGPU\u3092\u5236\u5fa1\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u306e\u8a2d\u8a08\u306f\u3001\u304b\u3064\u3066CUDA\u3084PG-Strom\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u54c1\u8cea\u304c\u5341\u5206\u3067\u306a\u3044\u6642\u4ee3\u306b\u554f\u984c\u7b87\u6240\u306e\u7279\u5b9a\u3092\u5bb9\u6613\u306b\u3059\u308b\u3068\u3044\u3046\u5229\u70b9\u304c\u3042\u3063\u305f\u3082\u306e\u306e\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30bb\u30c3\u30b7\u30e7\u30f3\u6570\u304c\u5897\u52a0\u3059\u308b\u3068\u6975\u7aef\u306bGPU\u30ea\u30bd\u30fc\u30b9\u3092\u6d88\u8cbb\u3057\u3001\u307e\u305f\u30bf\u30b9\u30af\u5207\u308a\u66ff\u3048\u306e\u89b3\u70b9\u304b\u3089\u3082\u975e\u63a8\u5968\u3068\u3055\u308c\u308b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u69cb\u9020\u3067\u3057\u305f\u3002 \u3053\u306e\u8a2d\u8a08\u5909\u66f4\u306b\u3088\u308a\u3001PG-Strom v5.0\u306f\u540c\u6642\u5b9f\u884c\u6570\u306e\u5897\u52a0\u306b\u5bfe\u3057\u3066\u9811\u5f37\u306b\u306a\u3063\u305f\u4ed6\u3001\u9ad8\u8ca0\u8377\u306aGPU\u30bf\u30b9\u30af\u306e\u5b9f\u884c\u6027\u80fd\u304c\u5411\u4e0a\u3057\u3066\u3044\u307e\u3059\u3002","title":"\u30d7\u30ed\u30bb\u30b9\u30e2\u30c7\u30eb\u306e\u5909\u66f4"},{"location":"release_v5.0/#_4","text":"PG-Strom v5.0\u3067\u306f\u3001SQL\u304b\u3089\u72ec\u81ea\u306e\u300e\u7591\u4f3c\u30b3\u30fc\u30c9\u300f\u3092\u751f\u6210\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u306f\u3053\u306e\u300e\u7591\u4f3c\u30b3\u30fc\u30c9\u300f\u3092\u5b9f\u884c\u3059\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u3068\u3057\u3066\u50cd\u304d\u307e\u3059\u3002v3.x\u7cfb\u5217\u306e\u3088\u3046\u306bCUDA C++\u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u3053\u308c\u306f\u4e00\u898b\u3001\u6027\u80fd\u4f4e\u4e0b\u306e\u8981\u56e0\u3068\u898b\u3048\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u3057\u304b\u3057\u3001\u5143\u3005\u52d5\u7684\u30b3\u30fc\u30c9\u751f\u6210\u306e\u5bfe\u8c61\u3068\u306a\u3063\u3066\u3044\u305f\u306e\u306fWHERE\u53e5\u306a\u3069\u30af\u30a8\u30ea\u306e\u5ea6\u306b\u5909\u5316\u3059\u308b\u3054\u304f\u4e00\u90e8\u5206\u3060\u3051\u3067\u3042\u308a\u3001\u5927\u534a\u306e\u5b9f\u88c5\u306f\u9759\u7684\u306b\u30d3\u30eb\u30c9\u3055\u308c\u3066\u3044\u305f\u307b\u304b\u3001NVRTC\u306b\u3088\u308b\u5b9f\u884c\u6642\u30b3\u30f3\u30d1\u30a4\u30eb\u306e\u51e6\u7406\uff08150ms\uff5e\u7a0b\u5ea6\uff09\u3092\u7701\u7565\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u305f\u3081\u3001\u5fdc\u7b54\u6642\u9593\u306e\u6539\u5584\u306b\u5bc4\u4e0e\u3057\u3066\u3044\u307e\u3059\u3002 \u300e\u7591\u4f3c\u30b3\u30fc\u30c9\u300f\u306fEXPLAIN VERBOSE\u306b\u3088\u3063\u3066\u8868\u793a\u3055\u308c\u308b\u4f4e\u30ec\u30d9\u30eb\u306a\u30b3\u30de\u30f3\u30c9\u30bb\u30c3\u30c8\u3067\u3001\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bWHERE\u53e5\u306b lo_quantity > 10 \u3068\u3044\u3046\u6f14\u7b97\u5f0f\u3092\u542b\u3080\u30af\u30a8\u30ea\u306f\u3001 Scan Quals OpCode \u3068\u3057\u3066 lo_quantity \u5217\u3068\u5b9a\u6570 10 \u3068\u306e\u5927\u5c0f\u95a2\u4fc2\u3092\u6bd4\u8f03\u3059\u308b numeric_gt \u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u3088\u3046\u51e6\u7406\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002 postgres=# explain verbose select count(*), sum(lo_quantity), lo_shipmode from lineorder where lo_quantity > 10 group by lo_shipmode; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- HashAggregate (cost=3242387.01..3242387.10 rows=7 width=51) Output: pgstrom.fcount((pgstrom.nrows())), pgstrom.sum_fp_num((pgstrom.psum((lo_quantity)::double precision))), lo_shipmode Group Key: lineorder.lo_shipmode -> Custom Scan (GpuPreAgg) on public.lineorder (cost=3242386.89..3242386.96 rows=7 width=51) Output: (pgstrom.nrows()), (pgstrom.psum((lo_quantity)::double precision)), lo_shipmode GPU Projection: pgstrom.nrows(), pgstrom.psum((lo_quantity)::double precision), lo_shipmode GPU Scan Quals: (lo_quantity > '10'::numeric) [rows: 600128800 -> 479262800] GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , KVecs-Buffer: nbytes: 83968, ndims: 2, items=[kvec0=<0x0000-dfff, type='numeric', expr='lo_quantity'>, kvec1=<0xe000-147ff, type='bpchar', expr='lo_shipmode'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, ]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, ]}}} Scan Quals OpCode: {Func(bool)::numeric_gt args=[{Var(numeric): slot=0, expr='lo_quantity'}, {Const(numeric): value='10'}]} Group-By KeyHash OpCode: {HashValue arg={SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}} Group-By KeyLoad OpCode: {LoadVars(depth=-2): kvars=[]} Group-By KeyComp OpCode: {Func(bool)::bpchareq args=[{Var(bpchar): slot=1, expr='lo_shipmode'}, {Var(bpchar): slot=2, expr='lo_shipmode'}]} Partial Aggregation OpCode: {AggFuncs args=[{SaveExpr: arg={Func(float8)::float8 arg={Var(numeric): kvec=0x0000-e000, expr='lo_quantity'}}}, {SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}]} Partial Function BufSz: 24 (18 rows) \u73fe\u5728\u306f\u307e\u3060\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u3053\u306e\u7591\u4f3c\u30b3\u30fc\u30c9\u306f\u3001\u5c06\u6765\u7684\u306bCSD(Computational Storage Drive)\u3084DPU(Data Processing Unit)\u3067SQL\u51e6\u7406\u3092\u30aa\u30d5\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002","title":"\u7591\u4f3c\u30b3\u30fc\u30c9\u306e\u5c0e\u5165"},{"location":"release_v5.0/#_5","text":"CPU\u3068\u6bd4\u8f03\u3057\u3066\u3001GPU\u306f\u5e83\u5e2f\u57df\u306a\u30e1\u30e2\u30ea\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u6027\u80fd\u3092\u5f15\u304d\u51fa\u3059\u306b\u306f\u8fd1\u508d\u306e\u30e1\u30e2\u30ea\u9818\u57df\u3092\u540c\u3058\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308bCoalesced Memory Access\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 v5.0\u3067\u306fGPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u306b\u304a\u3051\u308bPostgreSQL\u30c7\u30fc\u30bf\u578b\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u304c\u6539\u826f\u3055\u308c\u3001Coalesced Memory Access\u306b\u9069\u3057\u305f\u5f62\u5f0f\u3068\u306a\u308a\u307e\u3057\u305f\u3002 PostgreSQL\u306e\u30c7\u30fc\u30bf\u578b\u3092\u305d\u306e\u307e\u307e\u5229\u7528\u3057\u305f\u5834\u5408\u3001\u3042\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u53c2\u7167\u3055\u308c\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u98db\u3073\u98db\u3073\u306e\u4f4d\u7f6e\u3092\u53d6\u308b\u4e8b\u306b\u306a\u308a\u3001DRAM\u304b\u3089\u306e\u8aad\u51fa\u3057\u5e2f\u57df\u3092\u6709\u52b9\u306b\u6d3b\u7528\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u308c\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u6bce\u306b\u8907\u6570\u500b\u307e\u3068\u3081\u3066\u914d\u7f6e\u3059\u308b\u4e8b\u3067\u3001\u96a3\u63a5\u30b3\u30a2\u304c\u96a3\u63a5\u9818\u57df\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u3001Coalesced Memory Access\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002 \u3053\u306e\u6539\u826f\u306f\u3001\u6975\u3081\u3066\u9ad8\u6027\u80fd\u306a\u30e1\u30e2\u30ea\u5e2f\u57df\u3092\u6301\u3064\u30cf\u30a4\u30a8\u30f3\u30c9GPU\u88fd\u54c1\u3060\u3051\u3067\u306a\u304f\u3001\u30df\u30c9\u30eb\u30a8\u30f3\u30c9\u7d1a\u306eGPU\u3067\u3082\u5341\u5206\u306a\u5b9f\u884c\u6027\u80fd\u3092\u5f15\u304d\u51fa\u3059\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002","title":"\u30c7\u30fc\u30bf\u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u6539\u5584"},{"location":"release_v5.0/#arrow_fdw","text":"Pg2Arrow\u3067min/max\u7d71\u8a08\u60c5\u5831\u4ed8\u304d\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 Pg2Arrow\u306e\u65b0\u305f\u306a\u30aa\u30d7\u30b7\u30e7\u30f3 --stat=COLUMN_NAME \u306f\u3001RecordBatch\u5358\u4f4d\u3067\u6307\u5b9a\u3057\u305f\u5217\u306e\u6700\u5927\u5024/\u6700\u5c0f\u5024\u3092\u8a18\u9332\u3057\u3066\u304a\u304d\u3001\u305d\u308c\u3092Apache Arrow\u306eCustom-Metadata\u30e1\u30ab\u30cb\u30ba\u30e0\u3092\u5229\u7528\u3057\u3066\u30d5\u30c3\u30bf\u306b\u57cb\u3081\u8fbc\u307f\u307e\u3059\u3002 Arrow_Fdw\u3092\u4ecb\u3057\u3066Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u51fa\u3059\u969b\u3001\u4e0a\u8a18\u306emin/max\u7d71\u8a08\u60c5\u5831\u3092\u5229\u7528\u3057\u305f\u7bc4\u56f2\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30b9\u30ad\u30e3\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b\u691c\u7d22\u6761\u4ef6\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3042\u3063\u305f\u5834\u5408\u3001 WHERE ymd BETERRN '2020-01-01'::date AND '2021-12-31'::date ymd\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6700\u5927\u5024\u304c '2020-01-01'::date \u672a\u6e80\u3067\u3042\u308bRecord Batch\u3084\u3001 ymd\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6700\u5c0f\u5024\u304c '2021-12-31 ::date`\u3088\u308a\u5927\u304d\u306aRecord Batch\u306f\u3001 \u691c\u7d22\u6761\u4ef6\u306b\u30de\u30c3\u30c1\u3057\u306a\u3044\u4e8b\u304c\u660e\u3089\u304b\u3067\u3042\u308b\u305f\u3081\u3001Arrow_Fdw\u306f\u3053\u306eRecord Batch\u3092\u8aad\u307f\u98db\u3070\u3057\u307e\u3059\u3002 \u3053\u308c\u306b\u3088\u308a\u3001\u4f8b\u3048\u3070\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u306a\u3069\u3001\u8fd1\u3057\u3044\u5024\u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u304c\u8fd1\u508d\u306b\u96c6\u307e\u3063\u3066\u3044\u308b\u30d1\u30bf\u30fc\u30f3\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u304a\u3044\u3066\u306f\u3001\u7bc4\u56f2\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u7528\u3044\u305f\u7d5e\u8fbc\u307f\u3068\u540c\u7b49\u306e\u6027\u80fd\u304c\u5f97\u3089\u308c\u307e\u3059\u3002","title":"Arrow_Fdw\u306e\u7d71\u8a08\u60c5\u5831\u30b5\u30dd\u30fc\u30c8"},{"location":"release_v5.0/#_6","text":"PostgreSQL v14 \u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002v15\u4ee5\u964d\u3078\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3092\u304a\u9858\u3044\u3057\u307e\u3059\u3002 Partition-wise GpuJoin\u6a5f\u80fd\u306b\u95a2\u3057\u3066\u306f\u3001\u958b\u767a\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u4e0a\u306e\u7406\u7531\u306b\u3088\u308a\u3001v5.0\u3067\u306f\u7121\u52b9\u5316\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5c06\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u518d\u3073\u5b9f\u88c5\u3055\u308c\u308b\u4e88\u5b9a\u3067\u3059\u3002","title":"\u305d\u306e\u4ed6\u306e\u5909\u66f4\u70b9"},{"location":"release_v5.1/","text":"PG-Strom v5.1\u30ea\u30ea\u30fc\u30b9 PG-Strom Development Team (17-Apr-2024) \u6982\u8981 PG-Strom v5.1\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u5909\u66f4\u306f\u70b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3057\u305fGpuJoin/PreAgg\u306e\u30b5\u30dd\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 GPU\u30b3\u30fc\u30c9\u306e\u30d3\u30eb\u30c9\u3092\u8d77\u52d5\u6642\u306b\u5b9f\u884c\u74b0\u5883\u3067\u884c\u3046\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 pg2arrow\u304c\u4e26\u5217\u51e6\u7406\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 CUDA Stack\u306e\u30b5\u30a4\u30ba\u3092\u9069\u5fdc\u7684\u306b\u8a2d\u5b9a\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u7d2f\u7a4d\u7684\u306a\u30d0\u30b0\u306e\u4fee\u6b63 \u52d5\u4f5c\u74b0\u5883 PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d; Volta\u4ee5\u964d\u3092\u63a8\u5968) \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5bfe\u5fdc PostgreSQL\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3078\u306e\u5bfe\u5fdc\u81ea\u4f53\u306fPG-Strom v3.0\u3067\u3082\u884c\u308f\u308c\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u3046\u307e\u304f\u5b9f\u884c\u8a08\u753b\u3092\u4f5c\u6210\u3067\u304d\u306a\u3044\u4e8b\u304c\u591a\u304f\u3001\u5b9f\u9a13\u7684\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u8131\u3059\u308b\u4e8b\u306e\u3067\u304d\u306a\u3044\u3082\u306e\u3067\u3057\u305f\u3002\u305d\u3053\u3067\u3001PG-Strom v5.1\u3067\u306f\u5185\u90e8\u306e\u8a2d\u8a08\u3092\u6839\u672c\u7684\u306b\u898b\u76f4\u3057\u3066\u518d\u5ea6\u5b9f\u88c5\u3057\u3001\u518d\u3073\u6b63\u5f0f\u306a\u6a5f\u80fd\u3068\u3057\u3066\u53d6\u308a\u5165\u308c\u307e\u3057\u305f\u3002 \u4ee5\u4e0b\u306e lineorder \u30c6\u30fc\u30d6\u30eb\u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u3066\u304a\u308a\u3001 date1 \u30c6\u30fc\u30d6\u30eb\u304c\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b\u5834\u5408\u3001\u3053\u308c\u307e\u3067\u306f\u3001 lineorder \u914d\u4e0b\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u3092\u5168\u3066 Append \u30ce\u30fc\u30c9\u306b\u3088\u3063\u3066\u7d50\u5408\u3055\u308c\u305f\u5f8c\u3067\u306a\u3051\u308c\u3070JOIN\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 \u901a\u5e38\u3001PG-Strom\u306fCPU\u3092\u30d0\u30a4\u30d1\u30b9\u3057\u3066NVME-SSD\u304b\u3089GPU\u3078\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\u3057\u3066\u5404\u7a2e\u306eSQL\u51e6\u7406\u3092\u884c\u3046\uff08GPU-Direct SQL\uff09\u305f\u3081\u3001JOIN\u306b\u5148\u7acb\u3063\u3066CPU\u5074\u3078\u30c7\u30fc\u30bf\u3092\u623b\u3055\u306d\u3070\u306a\u3089\u306a\u3044\u3068\u3044\u3046\u306e\u306f\u5927\u304d\u306a\u30da\u30ca\u30eb\u30c6\u30a3\u3067\u3059\u3002 ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate -> Hash Join Hash Cond: (lineorder.lo_orderdate = date1.d_datekey) -> Append -> Custom Scan (GpuScan) on lineorder__p1992 lineorder_1 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1993 lineorder_2 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1994 lineorder_3 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1995 lineorder_4 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1996 lineorder_5 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1997 lineorder_6 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1998 lineorder_7 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on lineorder__p1999 lineorder_8 Filter: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash -> Seq Scan on date1 Filter: (d_year = 1993) (37 rows) PG-Strom v5.1\u3067\u306f\u3001\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3092\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3057\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u3068JOIN\u3057\u3066\u304b\u3089\u7d50\u679c\u3092\u8fd4\u3059\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u5834\u5408\u306b\u3088\u3063\u3066\u306fGROUP-BY\u51e6\u7406\u307e\u3067\u6e08\u307e\u305b\u305f\u4e0a\u3067CPU\u5074\u306b\u623b\u3059\u4e8b\u3082\u3067\u304d\u3001\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001\u7dcf\u65706\u5104\u4ef6\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u691c\u7d22\u6761\u4ef6\u3092\u6e80\u305f\u30597\u5343\u4e07\u884c\u3092\u8fd4\u3055\u306d\u3070\u306a\u3089\u306a\u3044\u3068\u3053\u308d\u3001\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b date1 \u3068\u306eJOIN\u3068\u3001\u305d\u306e\u6b21\u306b\u5b9f\u884c\u3059\u308b\u96c6\u7d04\u95a2\u6570 SUM() \u3092\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306b\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u4e8b\u3067\u3001CPU\u3067\u306f\u50c5\u304b8\u884c\u3092\u51e6\u7406\u3059\u308b\u3060\u3051\u3067\u6e08\u3093\u3067\u3044\u307e\u3059\u3002 INNER\u5074\u306e\u8aad\u51fa\u3057\u304c\u8907\u6570\u56de\u767a\u751f\u3059\u308b\u3068\u3044\u3046\u30c7\u30e1\u30ea\u30c3\u30c8\u306f\u3042\u308a\u307e\u3059\u304c\uff08\u203b\u5c06\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u6539\u4fee\u3055\u308c\u308b\u4e88\u5b9a\u3067\u3059\uff09\u3001\u3053\u306e\u3088\u3046\u306a\u66f8\u304d\u63db\u3048\u306b\u3088\u3063\u3066CPU\u3067\u51e6\u7406\u3059\u3079\u304d\u30c7\u30fc\u30bf\u304c\u5927\u5e45\u306b\u6e1b\u5c11\u3057\u3001\u51e6\u7406\u901f\u5ea6\u306e\u6539\u5584\u306b\u5bc4\u4e0e\u3057\u307e\u3059\u3002 ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------- Aggregate -> Append -> Custom Scan (GpuPreAgg) on lineorder__p1992 lineorder_1 GPU Projection: pgstrom.psum(((lineorder_1.lo_extendedprice * lineorder_1.lo_discount))::double precision) GPU Scan Quals: ((lineorder_1.lo_discount >= '1'::numeric) AND (lineorder_1.lo_discount <= '3'::numeric) AND (lineorder_1.lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU Join Quals [1]: (lineorder_1.lo_orderdate = date1.d_datekey) ... [nrows: 11911380 -> 1700960] GPU Outer Hash [1]: lineorder_1.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1993 lineorder_2 GPU Projection: pgstrom.psum(((lineorder_2.lo_extendedprice * lineorder_2.lo_discount))::double precision) GPU Scan Quals: ((lineorder_2.lo_discount >= '1'::numeric) AND (lineorder_2.lo_discount <= '3'::numeric) AND (lineorder_2.lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU Join Quals [1]: (lineorder_2.lo_orderdate = date1.d_datekey) ... [nrows: 11980460 -> 1710824] GPU Outer Hash [1]: lineorder_2.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1994 lineorder_3 GPU Projection: pgstrom.psum(((lineorder_3.lo_extendedprice * lineorder_3.lo_discount))::double precision) GPU Scan Quals: ((lineorder_3.lo_discount >= '1'::numeric) AND (lineorder_3.lo_discount <= '3'::numeric) AND (lineorder_3.lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU Join Quals [1]: (lineorder_3.lo_orderdate = date1.d_datekey) ... [nrows: 12150700 -> 1735135] GPU Outer Hash [1]: lineorder_3.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1995 lineorder_4 GPU Projection: pgstrom.psum(((lineorder_4.lo_extendedprice * lineorder_4.lo_discount))::double precision) GPU Scan Quals: ((lineorder_4.lo_discount >= '1'::numeric) AND (lineorder_4.lo_discount <= '3'::numeric) AND (lineorder_4.lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU Join Quals [1]: (lineorder_4.lo_orderdate = date1.d_datekey) ... [nrows: 11779920 -> 1682188] GPU Outer Hash [1]: lineorder_4.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1996 lineorder_5 GPU Projection: pgstrom.psum(((lineorder_5.lo_extendedprice * lineorder_5.lo_discount))::double precision) GPU Scan Quals: ((lineorder_5.lo_discount >= '1'::numeric) AND (lineorder_5.lo_discount <= '3'::numeric) AND (lineorder_5.lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU Join Quals [1]: (lineorder_5.lo_orderdate = date1.d_datekey) ... [nrows: 11942810 -> 1705448] GPU Outer Hash [1]: lineorder_5.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1997 lineorder_6 GPU Projection: pgstrom.psum(((lineorder_6.lo_extendedprice * lineorder_6.lo_discount))::double precision) GPU Scan Quals: ((lineorder_6.lo_discount >= '1'::numeric) AND (lineorder_6.lo_discount <= '3'::numeric) AND (lineorder_6.lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU Join Quals [1]: (lineorder_6.lo_orderdate = date1.d_datekey) ... [nrows: 12069740 -> 1723574] GPU Outer Hash [1]: lineorder_6.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1998 lineorder_7 GPU Projection: pgstrom.psum(((lineorder_7.lo_extendedprice * lineorder_7.lo_discount))::double precision) GPU Scan Quals: ((lineorder_7.lo_discount >= '1'::numeric) AND (lineorder_7.lo_discount <= '3'::numeric) AND (lineorder_7.lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU Join Quals [1]: (lineorder_7.lo_orderdate = date1.d_datekey) ... [nrows: 6898138 -> 985063] GPU Outer Hash [1]: lineorder_7.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1999 lineorder_8 GPU Projection: pgstrom.psum(((lineorder_8.lo_extendedprice * lineorder_8.lo_discount))::double precision) GPU Scan Quals: ((lineorder_8.lo_discount >= '1'::numeric) AND (lineorder_8.lo_discount <= '3'::numeric) AND (lineorder_8.lo_quantity < '25'::numeric)) [rows: 150 -> 1] GPU Join Quals [1]: (lineorder_8.lo_orderdate = date1.d_datekey) ... [nrows: 1 -> 1] GPU Outer Hash [1]: lineorder_8.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) (82 rows) GPU\u30b3\u30fc\u30c9\u306e\u8d77\u52d5\u6642\u30d3\u30eb\u30c9 \u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePG-Strom\u3067\u306f\u3001\u4e88\u3081\u30d3\u30eb\u30c9\u3055\u308c\u305fGPU\u5411\u3051\u306e\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u914d\u5e03\u3059\u308b\u65b9\u5f0f\u3092\u3068\u3063\u3066\u3044\u307e\u3057\u305f\u3002 \u3053\u308c\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u306f\u3042\u308b\u306e\u3067\u3059\u304c\u3001PG-Strom\uff08PostgreSQL\uff09\u5b9f\u884c\u74b0\u5883\u306eCUDA Toolkit\u3084NVIDIA\u30c9\u30e9\u30a4\u30d0\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u7d44\u5408\u305b\u306b\u3088\u3063\u3066\u306f\u3001GPU\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8a8d\u8b58\u3067\u304d\u305a\u5b9f\u884c\u6642\u30a8\u30e9\u30fc\u3092\u8d77\u3053\u3057\u3066\u3057\u307e\u3046\u4e8b\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u5178\u578b\u7684\u306b\u306f\u3001RPM\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30d3\u30eb\u30c9\u3057\u305f\u74b0\u5883\u3088\u308a\u3082\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306eCUDA Toolkit\u3084NVIDIA\u30c9\u30e9\u30a4\u30d0\u304c\u5b9f\u884c\u74b0\u5883\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3067\u3059\u3002 PG-Strom v5.1\u3067\u306f\u3001\u8d77\u52d5\u6642\u306bGPU\u7528\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3084CUDA Toolkit\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u3001\u5dee\u5206\u304c\u3042\u308c\u3070GPU\u5411\u3051\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30d3\u30eb\u30c9\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u306e\u4fee\u6b63\u306b\u3088\u308a\u3001PG-Strom\u306f\u5b9f\u884c\u74b0\u5883\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305fGPU\u30c7\u30d0\u30a4\u30b9\u3001\u304a\u3088\u3073CUDA Toolkit\u5411\u3051\u306eGPU\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u4e00\u90e8\u306ePG-Strom\u7528GPU\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u306f\u30d3\u30eb\u30c9\u306b\u6642\u9593\u304c\u304b\u304b\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001PG-Strom\u3084CUDA Toolkit\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u5f8c\u3001\u521d\u56de\u306e\u8d77\u52d5\u6642\u306b\u306fPG-Strom\u306e\u6a5f\u80fd\u304c\u5229\u7528\u53ef\u80fd\u3068\u306a\u308b\u307e\u3067\u6570\u5206\u306e\u6642\u9593\u304c\u304b\u304b\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 pg2arrow\u306e\u4e26\u5217\u5b9f\u884c pg2arrow \u306f\u65b0\u305f\u306b -n|--num-workers \u30aa\u30d7\u30b7\u30e7\u30f3\u3068 -k|--parallel-keys \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 -n N_WORKERS \u306f\u6307\u5b9a\u3057\u305f\u6570\u306e\u30b9\u30ec\u30c3\u30c9\u304c\u305d\u308c\u305e\u308cPostgreSQL\u306b\u63a5\u7d9a\u3057\u3001\u4e26\u5217\u306b\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3092Apache Arrow\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002\u30af\u30a8\u30ea\u306b\u306f\u7279\u6b8a\u306a\u6587\u5b57\u5217 $(N_WORKERS) \u3068 $(WORKER_ID) \u3092\u542b\u3080\u4e8b\u304c\u3067\u304d\u3001\u3053\u308c\u3089\u306fPostgreSQL\u306b\u30af\u30a8\u30ea\u3092\u6295\u3052\u308b\u969b\u306b\u3001\u305d\u308c\u305e\u308c\u30ef\u30fc\u30ab\u30fc\u6570\u3068\u30ef\u30fc\u30ab\u30fc\u56fa\u6709\u306eID\u5024\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u307e\u3059\u3002\u30e6\u30fc\u30b6\u306f\u3053\u308c\u3092\u5229\u7528\u3057\u3066\u3001\u5404\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u8aad\u307f\u51fa\u3059\u30bf\u30d7\u30eb\u304c\u4e92\u3044\u306b\u91cd\u8907\u3057\u305f\u308a\u6b20\u640d\u3057\u305f\u308a\u3057\u306a\u3044\u3088\u3046\u306b\u8abf\u6574\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u3082\u3046\u4e00\u3064\u306e -k|--parallel-key \u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u5f15\u6570\u3067\u4e0e\u3048\u305f\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u30ad\u30fc\u5024\u306e\u305d\u308c\u305e\u308c\u306b\u5bfe\u3057\u3066\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u3092\u8d77\u52d5\u3057\u3001\u30af\u30a8\u30ea\u4e2d\u306e $(PARALLEL_KEY) \u3092\u30ad\u30fc\u3068\u7f6e\u304d\u63db\u3048\u305f\u4e0a\u3067\u3001\u3053\u308c\u3092PostgreSQL\u3067\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3092Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001 lineorder \u30c6\u30fc\u30d6\u30eb\u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u3066\u304a\u308a\u3001\u5b50\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u3001 lineorder__sun , lineorder__mon , ... lineorder__sat \u304c\u5b58\u5728\u3057\u305f\u5834\u5408\u3001\u500b\u3005\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u305d\u308c\u305e\u308c\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u3068\u3044\u3063\u305f\u5f62\u3067\u51e6\u7406\u3092\u4e26\u5217\u5316\u3067\u304d\u307e\u3059\u3002 \u3053\u306e\u5834\u5408\u3001 -k \u30aa\u30d7\u30b7\u30e7\u30f3\u306f -k sun,mon,tue,wed,thu,fri,sat \u3068\u6307\u5b9a\u3057\u3001 -c \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u306f SELECT * FROM lineorder__$(PARALLEL_KEY) \u3068\u6307\u5b9a\u3059\u308c\u3070\u30017\u500b\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u305d\u308c\u305e\u308c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 $ pg2arrow -d ssbm -c 'SELECT * FROM lineorder__$(PARALLEL_KEY)' -o /path/to/f_lineorder.arrow -k=sun,mon,tue,wed,thu,fri,sat --progress worker:1 SQL=[SELECT * FROM lineorder__sun] worker:3 SQL=[SELECT * FROM lineorder__tue] worker:2 SQL=[SELECT * FROM lineorder__mon] worker:4 SQL=[SELECT * FROM lineorder__wed] worker:5 SQL=[SELECT * FROM lineorder__thu] : :","title":"PG-Strom v5.1"},{"location":"release_v5.1/#pg-strom-v51","text":"PG-Strom Development Team (17-Apr-2024)","title":"PG-Strom v5.1\u30ea\u30ea\u30fc\u30b9"},{"location":"release_v5.1/#_1","text":"PG-Strom v5.1\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u5909\u66f4\u306f\u70b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3057\u305fGpuJoin/PreAgg\u306e\u30b5\u30dd\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 GPU\u30b3\u30fc\u30c9\u306e\u30d3\u30eb\u30c9\u3092\u8d77\u52d5\u6642\u306b\u5b9f\u884c\u74b0\u5883\u3067\u884c\u3046\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 pg2arrow\u304c\u4e26\u5217\u51e6\u7406\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 CUDA Stack\u306e\u30b5\u30a4\u30ba\u3092\u9069\u5fdc\u7684\u306b\u8a2d\u5b9a\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u7d2f\u7a4d\u7684\u306a\u30d0\u30b0\u306e\u4fee\u6b63","title":"\u6982\u8981"},{"location":"release_v5.1/#_2","text":"PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d; Volta\u4ee5\u964d\u3092\u63a8\u5968)","title":"\u52d5\u4f5c\u74b0\u5883"},{"location":"release_v5.1/#_3","text":"PostgreSQL\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3078\u306e\u5bfe\u5fdc\u81ea\u4f53\u306fPG-Strom v3.0\u3067\u3082\u884c\u308f\u308c\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u3046\u307e\u304f\u5b9f\u884c\u8a08\u753b\u3092\u4f5c\u6210\u3067\u304d\u306a\u3044\u4e8b\u304c\u591a\u304f\u3001\u5b9f\u9a13\u7684\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u8131\u3059\u308b\u4e8b\u306e\u3067\u304d\u306a\u3044\u3082\u306e\u3067\u3057\u305f\u3002\u305d\u3053\u3067\u3001PG-Strom v5.1\u3067\u306f\u5185\u90e8\u306e\u8a2d\u8a08\u3092\u6839\u672c\u7684\u306b\u898b\u76f4\u3057\u3066\u518d\u5ea6\u5b9f\u88c5\u3057\u3001\u518d\u3073\u6b63\u5f0f\u306a\u6a5f\u80fd\u3068\u3057\u3066\u53d6\u308a\u5165\u308c\u307e\u3057\u305f\u3002 \u4ee5\u4e0b\u306e lineorder \u30c6\u30fc\u30d6\u30eb\u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u3066\u304a\u308a\u3001 date1 \u30c6\u30fc\u30d6\u30eb\u304c\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b\u5834\u5408\u3001\u3053\u308c\u307e\u3067\u306f\u3001 lineorder \u914d\u4e0b\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u3092\u5168\u3066 Append \u30ce\u30fc\u30c9\u306b\u3088\u3063\u3066\u7d50\u5408\u3055\u308c\u305f\u5f8c\u3067\u306a\u3051\u308c\u3070JOIN\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 \u901a\u5e38\u3001PG-Strom\u306fCPU\u3092\u30d0\u30a4\u30d1\u30b9\u3057\u3066NVME-SSD\u304b\u3089GPU\u3078\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\u3057\u3066\u5404\u7a2e\u306eSQL\u51e6\u7406\u3092\u884c\u3046\uff08GPU-Direct SQL\uff09\u305f\u3081\u3001JOIN\u306b\u5148\u7acb\u3063\u3066CPU\u5074\u3078\u30c7\u30fc\u30bf\u3092\u623b\u3055\u306d\u3070\u306a\u3089\u306a\u3044\u3068\u3044\u3046\u306e\u306f\u5927\u304d\u306a\u30da\u30ca\u30eb\u30c6\u30a3\u3067\u3059\u3002 ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate -> Hash Join Hash Cond: (lineorder.lo_orderdate = date1.d_datekey) -> Append -> Custom Scan (GpuScan) on lineorder__p1992 lineorder_1 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1993 lineorder_2 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1994 lineorder_3 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1995 lineorder_4 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1996 lineorder_5 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1997 lineorder_6 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1998 lineorder_7 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on lineorder__p1999 lineorder_8 Filter: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash -> Seq Scan on date1 Filter: (d_year = 1993) (37 rows) PG-Strom v5.1\u3067\u306f\u3001\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3092\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3057\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u3068JOIN\u3057\u3066\u304b\u3089\u7d50\u679c\u3092\u8fd4\u3059\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u5834\u5408\u306b\u3088\u3063\u3066\u306fGROUP-BY\u51e6\u7406\u307e\u3067\u6e08\u307e\u305b\u305f\u4e0a\u3067CPU\u5074\u306b\u623b\u3059\u4e8b\u3082\u3067\u304d\u3001\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001\u7dcf\u65706\u5104\u4ef6\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u691c\u7d22\u6761\u4ef6\u3092\u6e80\u305f\u30597\u5343\u4e07\u884c\u3092\u8fd4\u3055\u306d\u3070\u306a\u3089\u306a\u3044\u3068\u3053\u308d\u3001\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b date1 \u3068\u306eJOIN\u3068\u3001\u305d\u306e\u6b21\u306b\u5b9f\u884c\u3059\u308b\u96c6\u7d04\u95a2\u6570 SUM() \u3092\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306b\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u4e8b\u3067\u3001CPU\u3067\u306f\u50c5\u304b8\u884c\u3092\u51e6\u7406\u3059\u308b\u3060\u3051\u3067\u6e08\u3093\u3067\u3044\u307e\u3059\u3002 INNER\u5074\u306e\u8aad\u51fa\u3057\u304c\u8907\u6570\u56de\u767a\u751f\u3059\u308b\u3068\u3044\u3046\u30c7\u30e1\u30ea\u30c3\u30c8\u306f\u3042\u308a\u307e\u3059\u304c\uff08\u203b\u5c06\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u6539\u4fee\u3055\u308c\u308b\u4e88\u5b9a\u3067\u3059\uff09\u3001\u3053\u306e\u3088\u3046\u306a\u66f8\u304d\u63db\u3048\u306b\u3088\u3063\u3066CPU\u3067\u51e6\u7406\u3059\u3079\u304d\u30c7\u30fc\u30bf\u304c\u5927\u5e45\u306b\u6e1b\u5c11\u3057\u3001\u51e6\u7406\u901f\u5ea6\u306e\u6539\u5584\u306b\u5bc4\u4e0e\u3057\u307e\u3059\u3002 ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------- Aggregate -> Append -> Custom Scan (GpuPreAgg) on lineorder__p1992 lineorder_1 GPU Projection: pgstrom.psum(((lineorder_1.lo_extendedprice * lineorder_1.lo_discount))::double precision) GPU Scan Quals: ((lineorder_1.lo_discount >= '1'::numeric) AND (lineorder_1.lo_discount <= '3'::numeric) AND (lineorder_1.lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU Join Quals [1]: (lineorder_1.lo_orderdate = date1.d_datekey) ... [nrows: 11911380 -> 1700960] GPU Outer Hash [1]: lineorder_1.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1993 lineorder_2 GPU Projection: pgstrom.psum(((lineorder_2.lo_extendedprice * lineorder_2.lo_discount))::double precision) GPU Scan Quals: ((lineorder_2.lo_discount >= '1'::numeric) AND (lineorder_2.lo_discount <= '3'::numeric) AND (lineorder_2.lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU Join Quals [1]: (lineorder_2.lo_orderdate = date1.d_datekey) ... [nrows: 11980460 -> 1710824] GPU Outer Hash [1]: lineorder_2.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1994 lineorder_3 GPU Projection: pgstrom.psum(((lineorder_3.lo_extendedprice * lineorder_3.lo_discount))::double precision) GPU Scan Quals: ((lineorder_3.lo_discount >= '1'::numeric) AND (lineorder_3.lo_discount <= '3'::numeric) AND (lineorder_3.lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU Join Quals [1]: (lineorder_3.lo_orderdate = date1.d_datekey) ... [nrows: 12150700 -> 1735135] GPU Outer Hash [1]: lineorder_3.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1995 lineorder_4 GPU Projection: pgstrom.psum(((lineorder_4.lo_extendedprice * lineorder_4.lo_discount))::double precision) GPU Scan Quals: ((lineorder_4.lo_discount >= '1'::numeric) AND (lineorder_4.lo_discount <= '3'::numeric) AND (lineorder_4.lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU Join Quals [1]: (lineorder_4.lo_orderdate = date1.d_datekey) ... [nrows: 11779920 -> 1682188] GPU Outer Hash [1]: lineorder_4.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1996 lineorder_5 GPU Projection: pgstrom.psum(((lineorder_5.lo_extendedprice * lineorder_5.lo_discount))::double precision) GPU Scan Quals: ((lineorder_5.lo_discount >= '1'::numeric) AND (lineorder_5.lo_discount <= '3'::numeric) AND (lineorder_5.lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU Join Quals [1]: (lineorder_5.lo_orderdate = date1.d_datekey) ... [nrows: 11942810 -> 1705448] GPU Outer Hash [1]: lineorder_5.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1997 lineorder_6 GPU Projection: pgstrom.psum(((lineorder_6.lo_extendedprice * lineorder_6.lo_discount))::double precision) GPU Scan Quals: ((lineorder_6.lo_discount >= '1'::numeric) AND (lineorder_6.lo_discount <= '3'::numeric) AND (lineorder_6.lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU Join Quals [1]: (lineorder_6.lo_orderdate = date1.d_datekey) ... [nrows: 12069740 -> 1723574] GPU Outer Hash [1]: lineorder_6.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1998 lineorder_7 GPU Projection: pgstrom.psum(((lineorder_7.lo_extendedprice * lineorder_7.lo_discount))::double precision) GPU Scan Quals: ((lineorder_7.lo_discount >= '1'::numeric) AND (lineorder_7.lo_discount <= '3'::numeric) AND (lineorder_7.lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU Join Quals [1]: (lineorder_7.lo_orderdate = date1.d_datekey) ... [nrows: 6898138 -> 985063] GPU Outer Hash [1]: lineorder_7.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1999 lineorder_8 GPU Projection: pgstrom.psum(((lineorder_8.lo_extendedprice * lineorder_8.lo_discount))::double precision) GPU Scan Quals: ((lineorder_8.lo_discount >= '1'::numeric) AND (lineorder_8.lo_discount <= '3'::numeric) AND (lineorder_8.lo_quantity < '25'::numeric)) [rows: 150 -> 1] GPU Join Quals [1]: (lineorder_8.lo_orderdate = date1.d_datekey) ... [nrows: 1 -> 1] GPU Outer Hash [1]: lineorder_8.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) (82 rows)","title":"\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5bfe\u5fdc"},{"location":"release_v5.1/#gpu","text":"\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePG-Strom\u3067\u306f\u3001\u4e88\u3081\u30d3\u30eb\u30c9\u3055\u308c\u305fGPU\u5411\u3051\u306e\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u914d\u5e03\u3059\u308b\u65b9\u5f0f\u3092\u3068\u3063\u3066\u3044\u307e\u3057\u305f\u3002 \u3053\u308c\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u306f\u3042\u308b\u306e\u3067\u3059\u304c\u3001PG-Strom\uff08PostgreSQL\uff09\u5b9f\u884c\u74b0\u5883\u306eCUDA Toolkit\u3084NVIDIA\u30c9\u30e9\u30a4\u30d0\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u7d44\u5408\u305b\u306b\u3088\u3063\u3066\u306f\u3001GPU\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8a8d\u8b58\u3067\u304d\u305a\u5b9f\u884c\u6642\u30a8\u30e9\u30fc\u3092\u8d77\u3053\u3057\u3066\u3057\u307e\u3046\u4e8b\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u5178\u578b\u7684\u306b\u306f\u3001RPM\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30d3\u30eb\u30c9\u3057\u305f\u74b0\u5883\u3088\u308a\u3082\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306eCUDA Toolkit\u3084NVIDIA\u30c9\u30e9\u30a4\u30d0\u304c\u5b9f\u884c\u74b0\u5883\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3067\u3059\u3002 PG-Strom v5.1\u3067\u306f\u3001\u8d77\u52d5\u6642\u306bGPU\u7528\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3084CUDA Toolkit\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u3001\u5dee\u5206\u304c\u3042\u308c\u3070GPU\u5411\u3051\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30d3\u30eb\u30c9\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u306e\u4fee\u6b63\u306b\u3088\u308a\u3001PG-Strom\u306f\u5b9f\u884c\u74b0\u5883\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305fGPU\u30c7\u30d0\u30a4\u30b9\u3001\u304a\u3088\u3073CUDA Toolkit\u5411\u3051\u306eGPU\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u4e00\u90e8\u306ePG-Strom\u7528GPU\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u306f\u30d3\u30eb\u30c9\u306b\u6642\u9593\u304c\u304b\u304b\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001PG-Strom\u3084CUDA Toolkit\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u5f8c\u3001\u521d\u56de\u306e\u8d77\u52d5\u6642\u306b\u306fPG-Strom\u306e\u6a5f\u80fd\u304c\u5229\u7528\u53ef\u80fd\u3068\u306a\u308b\u307e\u3067\u6570\u5206\u306e\u6642\u9593\u304c\u304b\u304b\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002","title":"GPU\u30b3\u30fc\u30c9\u306e\u8d77\u52d5\u6642\u30d3\u30eb\u30c9"},{"location":"release_v5.1/#pg2arrow","text":"pg2arrow \u306f\u65b0\u305f\u306b -n|--num-workers \u30aa\u30d7\u30b7\u30e7\u30f3\u3068 -k|--parallel-keys \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 -n N_WORKERS \u306f\u6307\u5b9a\u3057\u305f\u6570\u306e\u30b9\u30ec\u30c3\u30c9\u304c\u305d\u308c\u305e\u308cPostgreSQL\u306b\u63a5\u7d9a\u3057\u3001\u4e26\u5217\u306b\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3092Apache Arrow\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002\u30af\u30a8\u30ea\u306b\u306f\u7279\u6b8a\u306a\u6587\u5b57\u5217 $(N_WORKERS) \u3068 $(WORKER_ID) \u3092\u542b\u3080\u4e8b\u304c\u3067\u304d\u3001\u3053\u308c\u3089\u306fPostgreSQL\u306b\u30af\u30a8\u30ea\u3092\u6295\u3052\u308b\u969b\u306b\u3001\u305d\u308c\u305e\u308c\u30ef\u30fc\u30ab\u30fc\u6570\u3068\u30ef\u30fc\u30ab\u30fc\u56fa\u6709\u306eID\u5024\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u307e\u3059\u3002\u30e6\u30fc\u30b6\u306f\u3053\u308c\u3092\u5229\u7528\u3057\u3066\u3001\u5404\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u8aad\u307f\u51fa\u3059\u30bf\u30d7\u30eb\u304c\u4e92\u3044\u306b\u91cd\u8907\u3057\u305f\u308a\u6b20\u640d\u3057\u305f\u308a\u3057\u306a\u3044\u3088\u3046\u306b\u8abf\u6574\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u3082\u3046\u4e00\u3064\u306e -k|--parallel-key \u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u5f15\u6570\u3067\u4e0e\u3048\u305f\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u30ad\u30fc\u5024\u306e\u305d\u308c\u305e\u308c\u306b\u5bfe\u3057\u3066\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u3092\u8d77\u52d5\u3057\u3001\u30af\u30a8\u30ea\u4e2d\u306e $(PARALLEL_KEY) \u3092\u30ad\u30fc\u3068\u7f6e\u304d\u63db\u3048\u305f\u4e0a\u3067\u3001\u3053\u308c\u3092PostgreSQL\u3067\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3092Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001 lineorder \u30c6\u30fc\u30d6\u30eb\u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u3066\u304a\u308a\u3001\u5b50\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u3001 lineorder__sun , lineorder__mon , ... lineorder__sat \u304c\u5b58\u5728\u3057\u305f\u5834\u5408\u3001\u500b\u3005\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u305d\u308c\u305e\u308c\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u3068\u3044\u3063\u305f\u5f62\u3067\u51e6\u7406\u3092\u4e26\u5217\u5316\u3067\u304d\u307e\u3059\u3002 \u3053\u306e\u5834\u5408\u3001 -k \u30aa\u30d7\u30b7\u30e7\u30f3\u306f -k sun,mon,tue,wed,thu,fri,sat \u3068\u6307\u5b9a\u3057\u3001 -c \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u306f SELECT * FROM lineorder__$(PARALLEL_KEY) \u3068\u6307\u5b9a\u3059\u308c\u3070\u30017\u500b\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u305d\u308c\u305e\u308c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 $ pg2arrow -d ssbm -c 'SELECT * FROM lineorder__$(PARALLEL_KEY)' -o /path/to/f_lineorder.arrow -k=sun,mon,tue,wed,thu,fri,sat --progress worker:1 SQL=[SELECT * FROM lineorder__sun] worker:3 SQL=[SELECT * FROM lineorder__tue] worker:2 SQL=[SELECT * FROM lineorder__mon] worker:4 SQL=[SELECT * FROM lineorder__wed] worker:5 SQL=[SELECT * FROM lineorder__thu] : :","title":"pg2arrow\u306e\u4e26\u5217\u5b9f\u884c"},{"location":"ssd2gpu/","text":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c \u6982\u8981 SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u9ad8\u901f\u306b\u51e6\u7406\u3059\u308b\u306b\u306f\u3001\u30d7\u30ed\u30bb\u30c3\u30b5\u304c\u52b9\u7387\u3088\u304f\u51e6\u7406\u3092\u884c\u3046\u306e\u3068\u540c\u69d8\u306b\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3084\u30e1\u30e2\u30ea\u304b\u3089\u30d7\u30ed\u30bb\u30c3\u30b5\u3078\u9ad8\u901f\u306b\u30c7\u30fc\u30bf\u3092\u4f9b\u7d66\u3059\u308b\u4e8b\u304c\u91cd\u8981\u3067\u3059\u3002\u51e6\u7406\u3059\u3079\u304d\u30c7\u30fc\u30bf\u304c\u30d7\u30ed\u30bb\u30c3\u30b5\u306b\u5c4a\u3044\u3066\u3044\u306a\u3051\u308c\u3070\u3001\u30d7\u30ed\u30bb\u30c3\u30b5\u306f\u624b\u6301\u3061\u7121\u6c99\u6c70\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u6a5f\u80fd\u306f\u3001PCIe\u30d0\u30b9\u306b\u76f4\u7d50\u3059\u308b\u4e8b\u3067\u9ad8\u901f\u306aI/O\u51e6\u7406\u3092\u5b9f\u73fe\u3059\u308bNVMe-SSD\u3068\u3001\u540c\u3058PCIe\u30d0\u30b9\u4e0a\u306b\u63a5\u7d9a\u3055\u308c\u305fGPU\u3092\u30c0\u30a4\u30ec\u30af\u30c8\u306b\u63a5\u7d9a\u3057\u3001\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9650\u754c\u306b\u8fd1\u3044\u901f\u5ea6\u3067\u30c7\u30fc\u30bf\u3092\u30d7\u30ed\u30bb\u30c3\u30b5\u306b\u4f9b\u7d66\u3059\u308b\u4e8b\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u9ad8\u901f\u306b\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002 \u901a\u5e38\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u4e0a\u306b\u683c\u7d0d\u3055\u308c\u305fPostgreSQL\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u306f\u3001PCIe\u30d0\u30b9\u3092\u901a\u3057\u3066\u3044\u3063\u305f\u3093CPU/RAM\u3078\u3068\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002\u305d\u306e\u5f8c\u3001\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u306b\u3057\u305f\u304c\u3063\u3066WHERE\u53e5\u306b\u3088\u308b\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3084JOIN/GROUP BY\u3068\u3044\u3063\u305f\u51e6\u7406\u3092\u884c\u3046\u308f\u3051\u3067\u3059\u304c\u3001\u96c6\u8a08\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u7279\u6027\u4e0a\u3001\u5165\u529b\u3059\u308b\u30c7\u30fc\u30bf\u4ef6\u6570\u3088\u308a\u51fa\u529b\u3059\u308b\u30c7\u30fc\u30bf\u4ef6\u6570\u306e\u65b9\u304c\u306f\u308b\u304b\u306b\u5c11\u306a\u3044\u4ef6\u6570\u3068\u306a\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u6570\u5341\u5104\u884c\u3092\u8aad\u307f\u51fa\u3057\u305f\u7d50\u679c\u3092GROUP BY\u3067\u96c6\u7d04\u3057\u305f\u7d50\u679c\u304c\u9ad8\u3005\u6570\u767e\u884c\u3068\u3044\u3046\u4e8b\u3082\u73cd\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002 \u8a00\u3044\u63db\u3048\u308c\u3070\u3001\u6211\u3005\u306f\u30b4\u30df\u30c7\u30fc\u30bf\u3092\u904b\u3076\u305f\u3081\u306bPCIe\u30d0\u30b9\u4e0a\u306e\u5e2f\u57df\u3092\u6d88\u8cbb\u3057\u3066\u3044\u308b\u3068\u3082\u8a00\u3048\u307e\u3059\u304c\u3001CPU\u304c\u30ec\u30b3\u30fc\u30c9\u306e\u4e2d\u8eab\u3092\u8abf\u3079\u308b\u307e\u3067\u306f\u3001\u305d\u306e\u8981\u4e0d\u8981\u3092\u5224\u65ad\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u4e00\u822c\u7684\u306a\u5b9f\u88c5\u3067\u306f\u3053\u308c\u306f\u4e0d\u53ef\u907f\u3068\u8a00\u3048\u307e\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u30c7\u30fc\u30bf\u306e\u6d41\u308c\u3092\u5909\u3048\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u4e0a\u306e\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092PCIe\u30d0\u30b9\u4e0a\u306eP2P DMA\u3092\u7528\u3044\u3066GPU\u306b\u76f4\u63a5\u8ee2\u9001\u3057\u3001GPU\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u51e6\u7406\u3059\u308b\u4e8b\u3067CPU\u304c\u51e6\u7406\u3059\u3079\u304d\u30ec\u30b3\u30fc\u30c9\u6570\u3092\u6e1b\u3089\u3059\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002\u3044\u308f\u3070\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3068CPU/RAM\u306e\u9593\u306b\u4f4d\u7f6e\u3057\u3066SQL\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u30d7\u30ea\u30d7\u30ed\u30bb\u30c3\u30b5\u3068\u3057\u3066GPU\u3092\u6d3b\u7528\u3057\u3001\u7d50\u679c\u3068\u3057\u3066I/O\u51e6\u7406\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u3059\u3002 \u672c\u6a5f\u80fd\u306f\u3001\u5185\u90e8\u7684\u306bNVIDIA GPUDirect Storage\u30e2\u30b8\u30e5\u30fc\u30eb\uff08 nvidia-fs \uff09\u3092\u4f7f\u7528\u3057\u3066\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u3068NVME\u30b9\u30c8\u30ec\u30fc\u30b8\u3068\u306e\u9593\u3067P2P\u306e\u30c7\u30fc\u30bf\u8ee2\u9001\u3092\u884c\u3044\u307e\u3059\u3002 \u3057\u305f\u304c\u3063\u3066\u3001\u672c\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u3001PostgreSQL\u306e\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3042\u308bPG-Strom\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u4e0a\u8a18\u306eLinux kernel\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002 \u307e\u305f\u3001\u672c\u6a5f\u80fd\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u306e\u306fNVME\u4ed5\u69d8\u306eSSD\u3084\u3001NVME-oF\u3067\u63a5\u7d9a\u3055\u308c\u305f\u30ea\u30e2\u30fc\u30c8\u30c7\u30d0\u30a4\u30b9\u306e\u307f\u3067\u3059\u3002 SAS\u3084SATA\u3068\u3044\u3063\u305f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3067\u63a5\u7d9a\u3055\u308c\u305f\u65e7\u5f0f\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002 \u4eca\u307e\u3067\u306b\u52d5\u4f5c\u5b9f\u7e3e\u306e\u3042\u308bNVME-SSD\u306b\u3064\u3044\u3066\u306f 002: HW Validation List \u304c\u53c2\u8003\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002 \u521d\u671f\u8a2d\u5b9a \u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u4ee5\u524d\u306ePG-Strom\u3067\u306f\u3001GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306e\u5229\u7528\u306b\u306fHeteroDB\u793e\u306e\u958b\u767a\u3057\u305f\u72ec\u81ea\u306eLinux kernel\u30c9\u30e9\u30a4\u30d0\u304c\u5fc5\u8981\u3067\u3057\u305f\u304c\u3001v3.0\u4ee5\u964d\u3067\u306fNVIDIA\u306e\u63d0\u4f9b\u3059\u308bGPUDirect Storage\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u8a2d\u8a08\u3092\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002GPUDirect Storage\u7528\u306eLinux kernel\u30c9\u30e9\u30a4\u30d0\uff08 nvidia-fs \uff09\u306fCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d7\u30ed\u30bb\u30b9\u306b\u7d71\u5408\u3055\u308c\u3001\u672c\u30de\u30cb\u30e5\u30a2\u30eb\u306e\u300c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d\u306e\u7ae0\u306b\u8a18\u8f09\u306e\u624b\u9806\u3067\u30b7\u30b9\u30c6\u30e0\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u305f\u5834\u5408\u3001\u7279\u306b\u8ffd\u52a0\u306e\u8a2d\u5b9a\u306f\u5fc5\u8981\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u5fc5\u8981\u306aLinux kernel\u30c9\u30e9\u30a4\u30d0\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3001 modinfo \u30b3\u30de\u30f3\u30c9\u3084 lsmod \u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u3066\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 $ modinfo nvidia-fs filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/nvidia-fs.ko.xz description: NVIDIA GPUDirect Storage license: GPL v2 version: 2.20.5 rhelversion: 9.4 srcversion: 096A726CAEC0A059E24049E depends: retpoline: Y name: nvidia_fs vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions sig_id: PKCS#7 signer: DKMS module signing key sig_key: 18:B4:AE:27:B8:7D:74:4F:C2:27:68:2A:EB:E0:6A:F0:84:B2:94:EE sig_hashalgo: sha512 : : $ lsmod | grep nvidia nvidia_fs 323584 32 nvidia_uvm 6877184 4 nvidia 8822784 43 nvidia_uvm,nvidia_fs drm 741376 2 drm_kms_helper,nvidia \u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306e\u8a2d\u8a08 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u4ee5\u4e0b\u306e\u6761\u4ef6\u3067\u767a\u52d5\u3057\u307e\u3059\u3002 \u30b9\u30ad\u30e3\u30f3\u5bfe\u8c61\u306e\u30c6\u30fc\u30d6\u30eb\u304cNVMe-SSD\u3067\u69cb\u6210\u3055\u308c\u305f\u533a\u753b\u306b\u914d\u7f6e\u3055\u308c\u3066\u3044\u308b\u3002 /dev/nvmeXXXX \u30d6\u30ed\u30c3\u30af\u30c7\u30d0\u30a4\u30b9\u3001\u307e\u305f\u306f /dev/nvmeXXXX \u30d6\u30ed\u30c3\u30af\u30c7\u30d0\u30a4\u30b9\u306e\u307f\u304b\u3089\u69cb\u6210\u3055\u308c\u305fmd-raid0\u533a\u753b\u304c\u5bfe\u8c61\u3067\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u30b5\u30a4\u30ba\u304c pg_strom.gpudirect_threshold \u3088\u308a\u3082\u5927\u304d\u3044\u4e8b\u3002 \u3053\u306e\u8a2d\u5b9a\u5024\u306f\u4efb\u610f\u306b\u5909\u66f4\u53ef\u80fd\u3067\u3059\u304c\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f\u672c\u4f53\u642d\u8f09\u7269\u7406\u30e1\u30e2\u30ea\u306b shared_buffers \u306e\u8a2d\u5b9a\u5024\u306e1/3\u3092\u52a0\u3048\u305f\u5927\u304d\u3055\u3067\u3059\u3002 Note md-raid0\u3092\u7528\u3044\u3066\u8907\u6570\u306eNVMe-SSD\u533a\u753b\u304b\u3089\u30b9\u30c8\u30e9\u30a4\u30d4\u30f3\u30b0\u8aad\u51fa\u3057\u3092\u884c\u3046\u306b\u306f\u3001HeteroDB\u793e\u306e\u63d0\u4f9b\u3059\u308b\u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30ba\u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3\u306e\u9069\u7528\u304c\u5fc5\u8981\u3067\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u3092NVMe-SSD\u3067\u69cb\u6210\u3055\u308c\u305f\u533a\u753b\u306b\u914d\u7f6e\u3059\u308b\u306b\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u5168\u4f53\u3092NVMe-SSD\u30dc\u30ea\u30e5\u30fc\u30e0\u306b\u683c\u7d0d\u3059\u308b\u4ee5\u5916\u306b\u3082\u3001PostgreSQL\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u6a5f\u80fd\u3092\u7528\u3044\u3066\u7279\u5b9a\u306e\u30c6\u30fc\u30d6\u30eb\u3084\u7279\u5b9a\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u307f\u3092NVMe-SSD\u30dc\u30ea\u30e5\u30fc\u30e0\u306b\u914d\u7f6e\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4f8b\u3048\u3070 /opt/nvme \u306bNVMe-SSD\u30dc\u30ea\u30e5\u30fc\u30e0\u304c\u30de\u30a6\u30f3\u30c8\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 PostgreSQL\u306e\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u306e\u6a29\u9650\u3067\u5f53\u8a72\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u66f8\u304d\u3067\u304d\u308b\u3088\u3046\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 CREATE TABLESPACE my_nvme LOCATION '/opt/nvme'; \u3053\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u4e0a\u306b\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001 CREATE TABLE \u69cb\u6587\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002 CREATE TABLE my_table (...) TABLESPACE my_nvme; \u3042\u308b\u3044\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u3092\u5909\u66f4\u3059\u308b\u306b\u306f\u3001 ALTER DATABASE \u69cb\u6587\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u306e\u5834\u5408\u3001\u65e2\u5b58\u30c6\u30fc\u30d6\u30eb\u306e\u914d\u7f6e\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306f\u5909\u66f4\u3055\u308c\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 ALTER DATABASE my_database SET TABLESPACE my_nvme; \u904b\u7528 GPU\u3068NVME-SSD\u9593\u306e\u8ddd\u96e2 \u30b5\u30fc\u30d0\u306e\u9078\u5b9a\u3068GPU\u304a\u3088\u3073NVME-SSD\u306e\u642d\u8f09\u306b\u3042\u305f\u308a\u3001\u30c7\u30d0\u30a4\u30b9\u306e\u6301\u3064\u6027\u80fd\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059\u306b\u306f\u3001\u30c7\u30d0\u30a4\u30b9\u9593\u306e\u8ddd\u96e2\u3092\u610f\u8b58\u3057\u305f\u30b3\u30f3\u30d5\u30a3\u30b0\u304c\u5fc5\u8981\u3067\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u304c\u305d\u306e\u57fa\u76e4\u3068\u3057\u3066\u4f7f\u7528\u3057\u3066\u3044\u308b NVIDIA GPUDirect RDMA \u306f\u3001P2P DMA\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u4e92\u3044\u306e\u30c7\u30d0\u30a4\u30b9\u304c\u540c\u3058PCIe root complex\u306e\u914d\u4e0b\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u8981\u6c42\u3057\u3066\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u30c7\u30e5\u30a2\u30ebCPU\u30b7\u30b9\u30c6\u30e0\u3067NVME-SSD\u304cCPU1\u306b\u3001GPU\u304cCPU2\u306b\u63a5\u7d9a\u3055\u308c\u3066\u304a\u308a\u3001P2P DMA\u304cCPU\u9593\u306eQPI\u3092\u6a2a\u5207\u308b\u3088\u3046\u69cb\u6210\u3059\u308b\u4e8b\u306f\u3067\u304d\u307e\u305b\u3093\u3002 \u307e\u305f\u3001\u6027\u80fd\u306e\u89b3\u70b9\u304b\u3089\u306fCPU\u5185\u8535\u306ePCIe\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3088\u308a\u3082\u3001\u5c02\u7528\u306ePCIe\u30b9\u30a4\u30c3\u30c1\u3092\u4ecb\u3057\u3066\u4e92\u3044\u306e\u30c7\u30d0\u30a4\u30b9\u3092\u63a5\u7d9a\u3059\u308b\u65b9\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u5199\u771f\u306fHPC\u5411\u3051\u30b5\u30fc\u30d0\u306e\u30de\u30b6\u30fc\u30dc\u30fc\u30c9\u3067\u30018\u672c\u306ePCIe x16\u30b9\u30ed\u30c3\u30c8\u304cPCIe\u30b9\u30a4\u30c3\u30c1\u3092\u4ecb\u3057\u3066\u4e92\u3044\u306b\u5bfe\u3068\u306a\u308b\u30b9\u30ed\u30c3\u30c8\u3068\u63a5\u7d9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u5199\u771f\u306e\u5de6\u5074\u306e\u30b9\u30ed\u30c3\u30c8\u306fCPU1\u306b\u3001\u53f3\u5074\u306e\u30b9\u30ed\u30c3\u30c8\u306fCPU2\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001SSD-2\u4e0a\u306b\u69cb\u7bc9\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3092\u7528\u3044\u3066\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u5834\u5408\u3001\u6700\u9069\u306aGPU\u306e\u9078\u629e\u306fGPU-2\u3067\u3057\u3087\u3046\u3002\u307e\u305fGPU-1\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001GPUDirect RDMA\u306e\u5236\u7d04\u304b\u3089\u3001GPU-3\u3068GPU-4\u306e\u4f7f\u7528\u306f\u907f\u3051\u306d\u3070\u306a\u308a\u307e\u305b\u3093\u3002 PG-Strom\u306f\u8d77\u52d5\u6642\u306b\u30b7\u30b9\u30c6\u30e0\u306ePCIe\u30d0\u30b9\u30c8\u30dd\u30ed\u30b8\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3001GPU\u3068NVME-SSD\u9593\u306e\u8ad6\u7406\u7684\u306a\u8ddd\u96e2\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8d77\u52d5\u6642\u306e\u30ed\u30b0\u306b\u8a18\u9332\u3055\u308c\u3066\u304a\u308a\u3001\u4f8b\u3048\u3070 /dev/nvme2 \u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u6642\u306fGPU1\u3068\u3044\u3063\u305f\u5177\u5408\u306b\u3001\u5404NVME-SSD\u3054\u3068\u306b\u6700\u3082\u8ddd\u96e2\u306e\u8fd1\u3044GPU\u3092\u512a\u5148\u3057\u3066\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 $ pg_ctl restart : LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78> LOG: [0000:81:00:0] nvme0 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] LOG: [0000:82:00:0] nvme2 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c2:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c6:00:0] nvme5 (Corsair MP600 CORE) --> GPU0 [dist=9] LOG: [0000:c3:00:0] nvme4 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c1:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c4:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] \u901a\u5e38\u306f\u81ea\u52d5\u8a2d\u5b9a\u3067\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002 \u305f\u3060\u3001NVME-over-Fabric(RDMA)\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306fPCIe\u30d0\u30b9\u4e0a\u306envme\u30c7\u30d0\u30a4\u30b9\u306e\u4f4d\u7f6e\u3092\u53d6\u5f97\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u624b\u52d5\u3067NVME-SSD\u3068GPU\u306e\u4f4d\u7f6e\u95a2\u4fc2\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u4f8b\u3048\u3070 nvme1 \u306b\u306f gpu2 \u3092\u3001 nvme2 \u3068 nvme3 \u306b\u306f gpu1 \u3092\u5272\u308a\u5f53\u3066\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092 postgresql.conf \u3078\u8a18\u8ff0\u3057\u307e\u3059\u3002\u3053\u306e\u624b\u52d5\u8a2d\u5b9a\u306f\u3001\u81ea\u52d5\u8a2d\u5b9a\u3088\u308a\u3082\u512a\u5148\u3059\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 pg_strom.nvme_distance_map = 'nvme1=gpu2,nvme2=gpu1,nvme3=gpu1' \u30ed\u30fc\u30ab\u30eb\u306eNVME-SSD\u30c7\u30d0\u30a4\u30b9\u4ee5\u5916\u3001\u4f8b\u3048\u3070100Gb\u30a4\u30fc\u30b5\u30cd\u30c3\u30c8\u3067\u63a5\u7d9a\u3055\u308c\u305f\u30b9\u30c8\u30ec\u30fc\u30b8\u30b5\u30fc\u30d0\u304b\u3089GPU-Direct SQL\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u306a\u3069\u3001PCI-E\u30d0\u30b9\u4e0a\u306e\u8ddd\u96e2\u306e\u6982\u5ff5\u304c\u5f53\u3066\u306f\u307e\u3089\u306a\u3044\u5834\u5408\u306f\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u304c\u30de\u30a6\u30f3\u30c8\u3055\u308c\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u3001\u305d\u3053\u306b\u95a2\u9023\u4ed8\u3051\u308bGPU\u3092\u6307\u5b9a\u3059\u308b\u4e8b\u3082\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306f\u8a2d\u5b9a\u4f8b\u3067\u3059\u3002 pg_strom.nvme_distance_map = '/mnt/0=gpu0,/mnt/1=gpu1' GUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308b\u5236\u5fa1 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306b\u95a2\u9023\u3059\u308bGUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306f2\u3064\u3042\u308a\u307e\u3059\u3002 \u4e00\u3064\u306f pg_strom.gpudirect_enabled \u3067\u3001GPU\u30c0\u30a4\u30ec\u30af\u30c8\u6a5f\u80fd\u306e\u6709\u52b9/\u7121\u52b9\u3092\u5358\u7d14\u306bon/off\u3057\u307e\u3059\u3002 \u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u304c off \u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b5\u30a4\u30ba\u3084\u7269\u7406\u914d\u7f6e\u3068\u306f\u7121\u95a2\u4fc2\u306bGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u4f7f\u7528\u3055\u308c\u307e\u305b\u3093\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f on \u3067\u3059\u3002 \u3082\u3046\u4e00\u3064\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f pg_strom.gpudirect_threshold \u3067\u3001GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u304c\u4f7f\u308f\u308c\u308b\u3079\u304d\u6700\u5c0f\u306e\u30c6\u30fc\u30d6\u30eb\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u306e\u7269\u7406\u914d\u7f6e\u304cNVME-SSD\u533a\u753b\uff08\u307e\u305f\u306f\u3001NVME-SSD\u306e\u307f\u3067\u69cb\u6210\u3055\u308c\u305fmd-raid0\u533a\u753b\uff09\u4e0a\u306b\u5b58\u5728\u3057\u3001\u304b\u3064\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b5\u30a4\u30ba\u304c\u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u6307\u5b9a\u5024\u3088\u308a\u3082\u5927\u304d\u306a\u5834\u5408\u3001PG-Strom\u306fGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3092\u9078\u629e\u3057\u307e\u3059\u3002 \u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f 2GB \u3067\u3059\u3002\u3064\u307e\u308a\u3001\u660e\u3089\u304b\u306b\u5c0f\u3055\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u306fGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3067\u306f\u306a\u304f\u3001PostgreSQL\u306e\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3059\u4e8b\u3092\u512a\u5148\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u3001\u4e00\u56de\u306e\u8aad\u307f\u51fa\u3057\u3067\u3042\u308c\u3070GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306b\u512a\u4f4d\u6027\u304c\u3042\u3063\u305f\u3068\u3057\u3066\u3082\u3001\u30aa\u30f3\u30e1\u30e2\u30ea\u51e6\u7406\u304c\u3067\u304d\u308b\u7a0b\u5ea6\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u306f\u3001\u4e8c\u56de\u76ee\u4ee5\u964d\u306e\u30c7\u30a3\u30b9\u30af\u30ad\u30e3\u30c3\u30b7\u30e5\u5229\u7528\u3092\u8003\u616e\u3059\u308b\u3068\u3001\u5fc5\u305a\u3057\u3082\u512a\u4f4d\u3068\u306f\u8a00\u3048\u306a\u3044\u3068\u3044\u3046\u4eee\u5b9a\u306b\u7acb\u3063\u3066\u3044\u308b\u3068\u3044\u3046\u4e8b\u3067\u3059\u3002 \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u7279\u6027\u306b\u3088\u3063\u3066\u306f\u5fc5\u305a\u3057\u3082\u3053\u306e\u8a2d\u5b9a\u304c\u6b63\u3057\u3044\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306e\u5229\u7528\u3092\u78ba\u8a8d\u3059\u308b EXPLAIN \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u5f53\u8a72\u30af\u30a8\u30ea\u3067GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u304c\u5229\u7528\u3055\u308c\u308b\u306e\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u306e\u4f8b\u3067\u306f\u3001 Custom Scan (GpuJoin) \u306b\u3088\u308b lineorder \u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b\u30b9\u30ad\u30e3\u30f3\u306b NVMe-Strom: enabled \u3068\u306e\u8868\u793a\u304c\u51fa\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001 lineorder \u30c6\u30fc\u30d6\u30eb\u304b\u3089\u306e\u8aad\u51fa\u3057\u306b\u306fGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u304c\u5229\u7528\u3055\u308c\u307e\u3059\u3002 # explain (costs off) select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_category = 'MFGR#12' and s_region = 'AMERICA' group by d_year, p_brand1 order by d_year, p_brand1; QUERY PLAN ---------------------------------------------------------------------------------------------- GroupAggregate Group Key: date1.d_year, part.p_brand1 -> Sort Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuPreAgg) Reduction: Local GPU Projection: pgstrom.psum((lo_revenue)::double precision), d_year, p_brand1 Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on lineorder GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue Outer Scan: lineorder Depth 1: GpuHashJoin (nrows 2406009600...97764190) HashKeys: lineorder.lo_partkey JoinQuals: (lineorder.lo_partkey = part.p_partkey) KDS-Hash (size: 10.67MB) Depth 2: GpuHashJoin (nrows 97764190...18544060) HashKeys: lineorder.lo_suppkey JoinQuals: (lineorder.lo_suppkey = supplier.s_suppkey) KDS-Hash (size: 131.59MB) Depth 3: GpuHashJoin (nrows 18544060...18544060) HashKeys: lineorder.lo_orderdate JoinQuals: (lineorder.lo_orderdate = date1.d_datekey) KDS-Hash (size: 461.89KB) NVMe-Strom: enabled -> Custom Scan (GpuScan) on part GPU Projection: p_brand1, p_partkey GPU Filter: (p_category = 'MFGR#12'::bpchar) -> Custom Scan (GpuScan) on supplier GPU Projection: s_suppkey GPU Filter: (s_region = 'AMERICA'::bpchar) -> Seq Scan on date1 (31 rows) Visibility Map\u306b\u95a2\u3059\u308b\u6ce8\u610f\u4e8b\u9805 \u73fe\u5728\u306e\u3068\u3053\u308d\u3001PG-Strom\u306eGPU\u5074\u51e6\u7406\u3067\u306f\u884c\u5358\u4f4d\u306eMVCC\u53ef\u8996\u6027\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001\u53ef\u8996\u6027\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u305f\u3081\u306b\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u69cb\u9020\u304c\u30db\u30b9\u30c8\u5074\u3060\u3051\u306b\u5b58\u5728\u3059\u308b\u305f\u3081\u3067\u3059\u304c\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u4e0a\u306e\u30d6\u30ed\u30c3\u30af\u3092\u76f4\u63a5GPU\u306b\u8ee2\u9001\u3059\u308b\u5834\u5408\u3001\u5c11\u3005\u5384\u4ecb\u306a\u554f\u984c\u304c\u751f\u3058\u307e\u3059\u3002 NVMe-SSD\u306bP2P DMA\u3092\u8981\u6c42\u3059\u308b\u6642\u70b9\u3067\u306f\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u30d6\u30ed\u30c3\u30af\u306e\u5185\u5bb9\u306f\u307e\u3060CPU/RAM\u3078\u3068\u8aad\u307f\u51fa\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u5177\u4f53\u7684\u306b\u3069\u306e\u884c\u304c\u53ef\u8996\u3067\u3042\u308b\u306e\u304b\u3001\u3069\u306e\u884c\u304c\u4e0d\u53ef\u8996\u3067\u3042\u308b\u306e\u304b\u3092\u5224\u5225\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001PostgreSQL\u304c\u30ec\u30b3\u30fc\u30c9\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u3078\u66f8\u304d\u51fa\u3059\u969b\u306bMVCC\u95a2\u9023\u306e\u5c5e\u6027\u3068\u5171\u306b\u66f8\u304d\u8fbc\u3093\u3067\u3044\u308b\u305f\u3081\u3067\u3001\u4f3c\u305f\u3088\u3046\u306a\u554f\u984c\u304cIndexOnlyScan\u3092\u5b9f\u88c5\u3059\u308b\u969b\u306b\u8868\u9762\u5316\u3057\u307e\u3057\u305f\u3002 \u3053\u308c\u306b\u5bfe\u51e6\u3059\u308b\u305f\u3081\u3001PostgreSQL\u306fVisibility Map\u3068\u547c\u3070\u308c\u308b\u30a4\u30f3\u30d5\u30e9\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u3042\u308b\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u4e2d\u306b\u5b58\u5728\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u304c\u5168\u3066\u306e\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u304b\u3089\u53ef\u8996\u3067\u3042\u308b\u4e8b\u304c\u660e\u3089\u304b\u3067\u3042\u308c\u3070\u3001\u8a72\u5f53\u3059\u308b\u30d3\u30c3\u30c8\u3092\u7acb\u3066\u308b\u4e8b\u3067\u3001\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092\u8aad\u3080\u3053\u3068\u306a\u304f\u5f53\u8a72\u30d6\u30ed\u30c3\u30af\u306bMVCC\u4e0d\u53ef\u8996\u306a\u30ec\u30b3\u30fc\u30c9\u304c\u5b58\u5728\u3059\u308b\u304b\u5426\u304b\u3092\u5224\u5b9a\u3059\u308b\u4e8b\u3092\u53ef\u80fd\u3068\u3059\u308b\u3082\u306e\u3067\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u3053\u306e\u30a4\u30f3\u30d5\u30e9\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u3001Visibility Map\u304c\u30bb\u30c3\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\"all-visible\"\u3067\u3042\u308b\u30d6\u30ed\u30c3\u30af\u3060\u3051\u304cP2P DMA\u3067\u8aad\u307f\u51fa\u3059\u3088\u3046\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u9001\u51fa\u3055\u308c\u307e\u3059\u3002 Visibility Map\u306fVACUUM\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u4f5c\u6210\u3055\u308c\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u660e\u793a\u7684\u306bVACUUM\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u3067\u5f37\u5236\u7684\u306bVisibility Map\u3092\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 VACUUM ANALYZE linerorder;","title":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL"},{"location":"ssd2gpu/#gpusql","text":"","title":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c"},{"location":"ssd2gpu/#_1","text":"SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u9ad8\u901f\u306b\u51e6\u7406\u3059\u308b\u306b\u306f\u3001\u30d7\u30ed\u30bb\u30c3\u30b5\u304c\u52b9\u7387\u3088\u304f\u51e6\u7406\u3092\u884c\u3046\u306e\u3068\u540c\u69d8\u306b\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3084\u30e1\u30e2\u30ea\u304b\u3089\u30d7\u30ed\u30bb\u30c3\u30b5\u3078\u9ad8\u901f\u306b\u30c7\u30fc\u30bf\u3092\u4f9b\u7d66\u3059\u308b\u4e8b\u304c\u91cd\u8981\u3067\u3059\u3002\u51e6\u7406\u3059\u3079\u304d\u30c7\u30fc\u30bf\u304c\u30d7\u30ed\u30bb\u30c3\u30b5\u306b\u5c4a\u3044\u3066\u3044\u306a\u3051\u308c\u3070\u3001\u30d7\u30ed\u30bb\u30c3\u30b5\u306f\u624b\u6301\u3061\u7121\u6c99\u6c70\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u6a5f\u80fd\u306f\u3001PCIe\u30d0\u30b9\u306b\u76f4\u7d50\u3059\u308b\u4e8b\u3067\u9ad8\u901f\u306aI/O\u51e6\u7406\u3092\u5b9f\u73fe\u3059\u308bNVMe-SSD\u3068\u3001\u540c\u3058PCIe\u30d0\u30b9\u4e0a\u306b\u63a5\u7d9a\u3055\u308c\u305fGPU\u3092\u30c0\u30a4\u30ec\u30af\u30c8\u306b\u63a5\u7d9a\u3057\u3001\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9650\u754c\u306b\u8fd1\u3044\u901f\u5ea6\u3067\u30c7\u30fc\u30bf\u3092\u30d7\u30ed\u30bb\u30c3\u30b5\u306b\u4f9b\u7d66\u3059\u308b\u4e8b\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u9ad8\u901f\u306b\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002 \u901a\u5e38\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u4e0a\u306b\u683c\u7d0d\u3055\u308c\u305fPostgreSQL\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u306f\u3001PCIe\u30d0\u30b9\u3092\u901a\u3057\u3066\u3044\u3063\u305f\u3093CPU/RAM\u3078\u3068\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002\u305d\u306e\u5f8c\u3001\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u306b\u3057\u305f\u304c\u3063\u3066WHERE\u53e5\u306b\u3088\u308b\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3084JOIN/GROUP BY\u3068\u3044\u3063\u305f\u51e6\u7406\u3092\u884c\u3046\u308f\u3051\u3067\u3059\u304c\u3001\u96c6\u8a08\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u7279\u6027\u4e0a\u3001\u5165\u529b\u3059\u308b\u30c7\u30fc\u30bf\u4ef6\u6570\u3088\u308a\u51fa\u529b\u3059\u308b\u30c7\u30fc\u30bf\u4ef6\u6570\u306e\u65b9\u304c\u306f\u308b\u304b\u306b\u5c11\u306a\u3044\u4ef6\u6570\u3068\u306a\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u6570\u5341\u5104\u884c\u3092\u8aad\u307f\u51fa\u3057\u305f\u7d50\u679c\u3092GROUP BY\u3067\u96c6\u7d04\u3057\u305f\u7d50\u679c\u304c\u9ad8\u3005\u6570\u767e\u884c\u3068\u3044\u3046\u4e8b\u3082\u73cd\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002 \u8a00\u3044\u63db\u3048\u308c\u3070\u3001\u6211\u3005\u306f\u30b4\u30df\u30c7\u30fc\u30bf\u3092\u904b\u3076\u305f\u3081\u306bPCIe\u30d0\u30b9\u4e0a\u306e\u5e2f\u57df\u3092\u6d88\u8cbb\u3057\u3066\u3044\u308b\u3068\u3082\u8a00\u3048\u307e\u3059\u304c\u3001CPU\u304c\u30ec\u30b3\u30fc\u30c9\u306e\u4e2d\u8eab\u3092\u8abf\u3079\u308b\u307e\u3067\u306f\u3001\u305d\u306e\u8981\u4e0d\u8981\u3092\u5224\u65ad\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u4e00\u822c\u7684\u306a\u5b9f\u88c5\u3067\u306f\u3053\u308c\u306f\u4e0d\u53ef\u907f\u3068\u8a00\u3048\u307e\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u30c7\u30fc\u30bf\u306e\u6d41\u308c\u3092\u5909\u3048\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u4e0a\u306e\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092PCIe\u30d0\u30b9\u4e0a\u306eP2P DMA\u3092\u7528\u3044\u3066GPU\u306b\u76f4\u63a5\u8ee2\u9001\u3057\u3001GPU\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u51e6\u7406\u3059\u308b\u4e8b\u3067CPU\u304c\u51e6\u7406\u3059\u3079\u304d\u30ec\u30b3\u30fc\u30c9\u6570\u3092\u6e1b\u3089\u3059\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002\u3044\u308f\u3070\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3068CPU/RAM\u306e\u9593\u306b\u4f4d\u7f6e\u3057\u3066SQL\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u30d7\u30ea\u30d7\u30ed\u30bb\u30c3\u30b5\u3068\u3057\u3066GPU\u3092\u6d3b\u7528\u3057\u3001\u7d50\u679c\u3068\u3057\u3066I/O\u51e6\u7406\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u3059\u3002 \u672c\u6a5f\u80fd\u306f\u3001\u5185\u90e8\u7684\u306bNVIDIA GPUDirect Storage\u30e2\u30b8\u30e5\u30fc\u30eb\uff08 nvidia-fs \uff09\u3092\u4f7f\u7528\u3057\u3066\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u3068NVME\u30b9\u30c8\u30ec\u30fc\u30b8\u3068\u306e\u9593\u3067P2P\u306e\u30c7\u30fc\u30bf\u8ee2\u9001\u3092\u884c\u3044\u307e\u3059\u3002 \u3057\u305f\u304c\u3063\u3066\u3001\u672c\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u3001PostgreSQL\u306e\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3042\u308bPG-Strom\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u4e0a\u8a18\u306eLinux kernel\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002 \u307e\u305f\u3001\u672c\u6a5f\u80fd\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u306e\u306fNVME\u4ed5\u69d8\u306eSSD\u3084\u3001NVME-oF\u3067\u63a5\u7d9a\u3055\u308c\u305f\u30ea\u30e2\u30fc\u30c8\u30c7\u30d0\u30a4\u30b9\u306e\u307f\u3067\u3059\u3002 SAS\u3084SATA\u3068\u3044\u3063\u305f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3067\u63a5\u7d9a\u3055\u308c\u305f\u65e7\u5f0f\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002 \u4eca\u307e\u3067\u306b\u52d5\u4f5c\u5b9f\u7e3e\u306e\u3042\u308bNVME-SSD\u306b\u3064\u3044\u3066\u306f 002: HW Validation List \u304c\u53c2\u8003\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002","title":"\u6982\u8981"},{"location":"ssd2gpu/#_2","text":"","title":"\u521d\u671f\u8a2d\u5b9a"},{"location":"ssd2gpu/#_3","text":"\u4ee5\u524d\u306ePG-Strom\u3067\u306f\u3001GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306e\u5229\u7528\u306b\u306fHeteroDB\u793e\u306e\u958b\u767a\u3057\u305f\u72ec\u81ea\u306eLinux kernel\u30c9\u30e9\u30a4\u30d0\u304c\u5fc5\u8981\u3067\u3057\u305f\u304c\u3001v3.0\u4ee5\u964d\u3067\u306fNVIDIA\u306e\u63d0\u4f9b\u3059\u308bGPUDirect Storage\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u8a2d\u8a08\u3092\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002GPUDirect Storage\u7528\u306eLinux kernel\u30c9\u30e9\u30a4\u30d0\uff08 nvidia-fs \uff09\u306fCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d7\u30ed\u30bb\u30b9\u306b\u7d71\u5408\u3055\u308c\u3001\u672c\u30de\u30cb\u30e5\u30a2\u30eb\u306e\u300c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d\u306e\u7ae0\u306b\u8a18\u8f09\u306e\u624b\u9806\u3067\u30b7\u30b9\u30c6\u30e0\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u305f\u5834\u5408\u3001\u7279\u306b\u8ffd\u52a0\u306e\u8a2d\u5b9a\u306f\u5fc5\u8981\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u5fc5\u8981\u306aLinux kernel\u30c9\u30e9\u30a4\u30d0\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3001 modinfo \u30b3\u30de\u30f3\u30c9\u3084 lsmod \u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u3066\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 $ modinfo nvidia-fs filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/nvidia-fs.ko.xz description: NVIDIA GPUDirect Storage license: GPL v2 version: 2.20.5 rhelversion: 9.4 srcversion: 096A726CAEC0A059E24049E depends: retpoline: Y name: nvidia_fs vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions sig_id: PKCS#7 signer: DKMS module signing key sig_key: 18:B4:AE:27:B8:7D:74:4F:C2:27:68:2A:EB:E0:6A:F0:84:B2:94:EE sig_hashalgo: sha512 : : $ lsmod | grep nvidia nvidia_fs 323584 32 nvidia_uvm 6877184 4 nvidia 8822784 43 nvidia_uvm,nvidia_fs drm 741376 2 drm_kms_helper,nvidia","title":"\u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"ssd2gpu/#_4","text":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u4ee5\u4e0b\u306e\u6761\u4ef6\u3067\u767a\u52d5\u3057\u307e\u3059\u3002 \u30b9\u30ad\u30e3\u30f3\u5bfe\u8c61\u306e\u30c6\u30fc\u30d6\u30eb\u304cNVMe-SSD\u3067\u69cb\u6210\u3055\u308c\u305f\u533a\u753b\u306b\u914d\u7f6e\u3055\u308c\u3066\u3044\u308b\u3002 /dev/nvmeXXXX \u30d6\u30ed\u30c3\u30af\u30c7\u30d0\u30a4\u30b9\u3001\u307e\u305f\u306f /dev/nvmeXXXX \u30d6\u30ed\u30c3\u30af\u30c7\u30d0\u30a4\u30b9\u306e\u307f\u304b\u3089\u69cb\u6210\u3055\u308c\u305fmd-raid0\u533a\u753b\u304c\u5bfe\u8c61\u3067\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u30b5\u30a4\u30ba\u304c pg_strom.gpudirect_threshold \u3088\u308a\u3082\u5927\u304d\u3044\u4e8b\u3002 \u3053\u306e\u8a2d\u5b9a\u5024\u306f\u4efb\u610f\u306b\u5909\u66f4\u53ef\u80fd\u3067\u3059\u304c\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f\u672c\u4f53\u642d\u8f09\u7269\u7406\u30e1\u30e2\u30ea\u306b shared_buffers \u306e\u8a2d\u5b9a\u5024\u306e1/3\u3092\u52a0\u3048\u305f\u5927\u304d\u3055\u3067\u3059\u3002 Note md-raid0\u3092\u7528\u3044\u3066\u8907\u6570\u306eNVMe-SSD\u533a\u753b\u304b\u3089\u30b9\u30c8\u30e9\u30a4\u30d4\u30f3\u30b0\u8aad\u51fa\u3057\u3092\u884c\u3046\u306b\u306f\u3001HeteroDB\u793e\u306e\u63d0\u4f9b\u3059\u308b\u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30ba\u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3\u306e\u9069\u7528\u304c\u5fc5\u8981\u3067\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u3092NVMe-SSD\u3067\u69cb\u6210\u3055\u308c\u305f\u533a\u753b\u306b\u914d\u7f6e\u3059\u308b\u306b\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u5168\u4f53\u3092NVMe-SSD\u30dc\u30ea\u30e5\u30fc\u30e0\u306b\u683c\u7d0d\u3059\u308b\u4ee5\u5916\u306b\u3082\u3001PostgreSQL\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u6a5f\u80fd\u3092\u7528\u3044\u3066\u7279\u5b9a\u306e\u30c6\u30fc\u30d6\u30eb\u3084\u7279\u5b9a\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u307f\u3092NVMe-SSD\u30dc\u30ea\u30e5\u30fc\u30e0\u306b\u914d\u7f6e\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4f8b\u3048\u3070 /opt/nvme \u306bNVMe-SSD\u30dc\u30ea\u30e5\u30fc\u30e0\u304c\u30de\u30a6\u30f3\u30c8\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 PostgreSQL\u306e\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u306e\u6a29\u9650\u3067\u5f53\u8a72\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u66f8\u304d\u3067\u304d\u308b\u3088\u3046\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 CREATE TABLESPACE my_nvme LOCATION '/opt/nvme'; \u3053\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u4e0a\u306b\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001 CREATE TABLE \u69cb\u6587\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002 CREATE TABLE my_table (...) TABLESPACE my_nvme; \u3042\u308b\u3044\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u3092\u5909\u66f4\u3059\u308b\u306b\u306f\u3001 ALTER DATABASE \u69cb\u6587\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u306e\u5834\u5408\u3001\u65e2\u5b58\u30c6\u30fc\u30d6\u30eb\u306e\u914d\u7f6e\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306f\u5909\u66f4\u3055\u308c\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 ALTER DATABASE my_database SET TABLESPACE my_nvme;","title":"\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306e\u8a2d\u8a08"},{"location":"ssd2gpu/#_5","text":"","title":"\u904b\u7528"},{"location":"ssd2gpu/#gpunvme-ssd","text":"\u30b5\u30fc\u30d0\u306e\u9078\u5b9a\u3068GPU\u304a\u3088\u3073NVME-SSD\u306e\u642d\u8f09\u306b\u3042\u305f\u308a\u3001\u30c7\u30d0\u30a4\u30b9\u306e\u6301\u3064\u6027\u80fd\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059\u306b\u306f\u3001\u30c7\u30d0\u30a4\u30b9\u9593\u306e\u8ddd\u96e2\u3092\u610f\u8b58\u3057\u305f\u30b3\u30f3\u30d5\u30a3\u30b0\u304c\u5fc5\u8981\u3067\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u304c\u305d\u306e\u57fa\u76e4\u3068\u3057\u3066\u4f7f\u7528\u3057\u3066\u3044\u308b NVIDIA GPUDirect RDMA \u306f\u3001P2P DMA\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u4e92\u3044\u306e\u30c7\u30d0\u30a4\u30b9\u304c\u540c\u3058PCIe root complex\u306e\u914d\u4e0b\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u8981\u6c42\u3057\u3066\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u30c7\u30e5\u30a2\u30ebCPU\u30b7\u30b9\u30c6\u30e0\u3067NVME-SSD\u304cCPU1\u306b\u3001GPU\u304cCPU2\u306b\u63a5\u7d9a\u3055\u308c\u3066\u304a\u308a\u3001P2P DMA\u304cCPU\u9593\u306eQPI\u3092\u6a2a\u5207\u308b\u3088\u3046\u69cb\u6210\u3059\u308b\u4e8b\u306f\u3067\u304d\u307e\u305b\u3093\u3002 \u307e\u305f\u3001\u6027\u80fd\u306e\u89b3\u70b9\u304b\u3089\u306fCPU\u5185\u8535\u306ePCIe\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3088\u308a\u3082\u3001\u5c02\u7528\u306ePCIe\u30b9\u30a4\u30c3\u30c1\u3092\u4ecb\u3057\u3066\u4e92\u3044\u306e\u30c7\u30d0\u30a4\u30b9\u3092\u63a5\u7d9a\u3059\u308b\u65b9\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u5199\u771f\u306fHPC\u5411\u3051\u30b5\u30fc\u30d0\u306e\u30de\u30b6\u30fc\u30dc\u30fc\u30c9\u3067\u30018\u672c\u306ePCIe x16\u30b9\u30ed\u30c3\u30c8\u304cPCIe\u30b9\u30a4\u30c3\u30c1\u3092\u4ecb\u3057\u3066\u4e92\u3044\u306b\u5bfe\u3068\u306a\u308b\u30b9\u30ed\u30c3\u30c8\u3068\u63a5\u7d9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u5199\u771f\u306e\u5de6\u5074\u306e\u30b9\u30ed\u30c3\u30c8\u306fCPU1\u306b\u3001\u53f3\u5074\u306e\u30b9\u30ed\u30c3\u30c8\u306fCPU2\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001SSD-2\u4e0a\u306b\u69cb\u7bc9\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3092\u7528\u3044\u3066\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u5834\u5408\u3001\u6700\u9069\u306aGPU\u306e\u9078\u629e\u306fGPU-2\u3067\u3057\u3087\u3046\u3002\u307e\u305fGPU-1\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001GPUDirect RDMA\u306e\u5236\u7d04\u304b\u3089\u3001GPU-3\u3068GPU-4\u306e\u4f7f\u7528\u306f\u907f\u3051\u306d\u3070\u306a\u308a\u307e\u305b\u3093\u3002 PG-Strom\u306f\u8d77\u52d5\u6642\u306b\u30b7\u30b9\u30c6\u30e0\u306ePCIe\u30d0\u30b9\u30c8\u30dd\u30ed\u30b8\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3001GPU\u3068NVME-SSD\u9593\u306e\u8ad6\u7406\u7684\u306a\u8ddd\u96e2\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8d77\u52d5\u6642\u306e\u30ed\u30b0\u306b\u8a18\u9332\u3055\u308c\u3066\u304a\u308a\u3001\u4f8b\u3048\u3070 /dev/nvme2 \u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u6642\u306fGPU1\u3068\u3044\u3063\u305f\u5177\u5408\u306b\u3001\u5404NVME-SSD\u3054\u3068\u306b\u6700\u3082\u8ddd\u96e2\u306e\u8fd1\u3044GPU\u3092\u512a\u5148\u3057\u3066\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 $ pg_ctl restart : LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78> LOG: [0000:81:00:0] nvme0 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] LOG: [0000:82:00:0] nvme2 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c2:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c6:00:0] nvme5 (Corsair MP600 CORE) --> GPU0 [dist=9] LOG: [0000:c3:00:0] nvme4 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c1:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c4:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] \u901a\u5e38\u306f\u81ea\u52d5\u8a2d\u5b9a\u3067\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002 \u305f\u3060\u3001NVME-over-Fabric(RDMA)\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306fPCIe\u30d0\u30b9\u4e0a\u306envme\u30c7\u30d0\u30a4\u30b9\u306e\u4f4d\u7f6e\u3092\u53d6\u5f97\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u624b\u52d5\u3067NVME-SSD\u3068GPU\u306e\u4f4d\u7f6e\u95a2\u4fc2\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u4f8b\u3048\u3070 nvme1 \u306b\u306f gpu2 \u3092\u3001 nvme2 \u3068 nvme3 \u306b\u306f gpu1 \u3092\u5272\u308a\u5f53\u3066\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092 postgresql.conf \u3078\u8a18\u8ff0\u3057\u307e\u3059\u3002\u3053\u306e\u624b\u52d5\u8a2d\u5b9a\u306f\u3001\u81ea\u52d5\u8a2d\u5b9a\u3088\u308a\u3082\u512a\u5148\u3059\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 pg_strom.nvme_distance_map = 'nvme1=gpu2,nvme2=gpu1,nvme3=gpu1' \u30ed\u30fc\u30ab\u30eb\u306eNVME-SSD\u30c7\u30d0\u30a4\u30b9\u4ee5\u5916\u3001\u4f8b\u3048\u3070100Gb\u30a4\u30fc\u30b5\u30cd\u30c3\u30c8\u3067\u63a5\u7d9a\u3055\u308c\u305f\u30b9\u30c8\u30ec\u30fc\u30b8\u30b5\u30fc\u30d0\u304b\u3089GPU-Direct SQL\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u306a\u3069\u3001PCI-E\u30d0\u30b9\u4e0a\u306e\u8ddd\u96e2\u306e\u6982\u5ff5\u304c\u5f53\u3066\u306f\u307e\u3089\u306a\u3044\u5834\u5408\u306f\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u304c\u30de\u30a6\u30f3\u30c8\u3055\u308c\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u3001\u305d\u3053\u306b\u95a2\u9023\u4ed8\u3051\u308bGPU\u3092\u6307\u5b9a\u3059\u308b\u4e8b\u3082\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306f\u8a2d\u5b9a\u4f8b\u3067\u3059\u3002 pg_strom.nvme_distance_map = '/mnt/0=gpu0,/mnt/1=gpu1'","title":"GPU\u3068NVME-SSD\u9593\u306e\u8ddd\u96e2"},{"location":"ssd2gpu/#guc","text":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306b\u95a2\u9023\u3059\u308bGUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306f2\u3064\u3042\u308a\u307e\u3059\u3002 \u4e00\u3064\u306f pg_strom.gpudirect_enabled \u3067\u3001GPU\u30c0\u30a4\u30ec\u30af\u30c8\u6a5f\u80fd\u306e\u6709\u52b9/\u7121\u52b9\u3092\u5358\u7d14\u306bon/off\u3057\u307e\u3059\u3002 \u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u304c off \u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b5\u30a4\u30ba\u3084\u7269\u7406\u914d\u7f6e\u3068\u306f\u7121\u95a2\u4fc2\u306bGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u4f7f\u7528\u3055\u308c\u307e\u305b\u3093\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f on \u3067\u3059\u3002 \u3082\u3046\u4e00\u3064\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f pg_strom.gpudirect_threshold \u3067\u3001GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u304c\u4f7f\u308f\u308c\u308b\u3079\u304d\u6700\u5c0f\u306e\u30c6\u30fc\u30d6\u30eb\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u306e\u7269\u7406\u914d\u7f6e\u304cNVME-SSD\u533a\u753b\uff08\u307e\u305f\u306f\u3001NVME-SSD\u306e\u307f\u3067\u69cb\u6210\u3055\u308c\u305fmd-raid0\u533a\u753b\uff09\u4e0a\u306b\u5b58\u5728\u3057\u3001\u304b\u3064\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b5\u30a4\u30ba\u304c\u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u6307\u5b9a\u5024\u3088\u308a\u3082\u5927\u304d\u306a\u5834\u5408\u3001PG-Strom\u306fGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3092\u9078\u629e\u3057\u307e\u3059\u3002 \u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f 2GB \u3067\u3059\u3002\u3064\u307e\u308a\u3001\u660e\u3089\u304b\u306b\u5c0f\u3055\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u306fGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3067\u306f\u306a\u304f\u3001PostgreSQL\u306e\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3059\u4e8b\u3092\u512a\u5148\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u3001\u4e00\u56de\u306e\u8aad\u307f\u51fa\u3057\u3067\u3042\u308c\u3070GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306b\u512a\u4f4d\u6027\u304c\u3042\u3063\u305f\u3068\u3057\u3066\u3082\u3001\u30aa\u30f3\u30e1\u30e2\u30ea\u51e6\u7406\u304c\u3067\u304d\u308b\u7a0b\u5ea6\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u306f\u3001\u4e8c\u56de\u76ee\u4ee5\u964d\u306e\u30c7\u30a3\u30b9\u30af\u30ad\u30e3\u30c3\u30b7\u30e5\u5229\u7528\u3092\u8003\u616e\u3059\u308b\u3068\u3001\u5fc5\u305a\u3057\u3082\u512a\u4f4d\u3068\u306f\u8a00\u3048\u306a\u3044\u3068\u3044\u3046\u4eee\u5b9a\u306b\u7acb\u3063\u3066\u3044\u308b\u3068\u3044\u3046\u4e8b\u3067\u3059\u3002 \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u7279\u6027\u306b\u3088\u3063\u3066\u306f\u5fc5\u305a\u3057\u3082\u3053\u306e\u8a2d\u5b9a\u304c\u6b63\u3057\u3044\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002","title":"GUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308b\u5236\u5fa1"},{"location":"ssd2gpu/#gpusql_1","text":"EXPLAIN \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u5f53\u8a72\u30af\u30a8\u30ea\u3067GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u304c\u5229\u7528\u3055\u308c\u308b\u306e\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u306e\u4f8b\u3067\u306f\u3001 Custom Scan (GpuJoin) \u306b\u3088\u308b lineorder \u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b\u30b9\u30ad\u30e3\u30f3\u306b NVMe-Strom: enabled \u3068\u306e\u8868\u793a\u304c\u51fa\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001 lineorder \u30c6\u30fc\u30d6\u30eb\u304b\u3089\u306e\u8aad\u51fa\u3057\u306b\u306fGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u304c\u5229\u7528\u3055\u308c\u307e\u3059\u3002 # explain (costs off) select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_category = 'MFGR#12' and s_region = 'AMERICA' group by d_year, p_brand1 order by d_year, p_brand1; QUERY PLAN ---------------------------------------------------------------------------------------------- GroupAggregate Group Key: date1.d_year, part.p_brand1 -> Sort Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuPreAgg) Reduction: Local GPU Projection: pgstrom.psum((lo_revenue)::double precision), d_year, p_brand1 Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on lineorder GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue Outer Scan: lineorder Depth 1: GpuHashJoin (nrows 2406009600...97764190) HashKeys: lineorder.lo_partkey JoinQuals: (lineorder.lo_partkey = part.p_partkey) KDS-Hash (size: 10.67MB) Depth 2: GpuHashJoin (nrows 97764190...18544060) HashKeys: lineorder.lo_suppkey JoinQuals: (lineorder.lo_suppkey = supplier.s_suppkey) KDS-Hash (size: 131.59MB) Depth 3: GpuHashJoin (nrows 18544060...18544060) HashKeys: lineorder.lo_orderdate JoinQuals: (lineorder.lo_orderdate = date1.d_datekey) KDS-Hash (size: 461.89KB) NVMe-Strom: enabled -> Custom Scan (GpuScan) on part GPU Projection: p_brand1, p_partkey GPU Filter: (p_category = 'MFGR#12'::bpchar) -> Custom Scan (GpuScan) on supplier GPU Projection: s_suppkey GPU Filter: (s_region = 'AMERICA'::bpchar) -> Seq Scan on date1 (31 rows)","title":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306e\u5229\u7528\u3092\u78ba\u8a8d\u3059\u308b"},{"location":"ssd2gpu/#visibility-map","text":"\u73fe\u5728\u306e\u3068\u3053\u308d\u3001PG-Strom\u306eGPU\u5074\u51e6\u7406\u3067\u306f\u884c\u5358\u4f4d\u306eMVCC\u53ef\u8996\u6027\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001\u53ef\u8996\u6027\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u305f\u3081\u306b\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u69cb\u9020\u304c\u30db\u30b9\u30c8\u5074\u3060\u3051\u306b\u5b58\u5728\u3059\u308b\u305f\u3081\u3067\u3059\u304c\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u4e0a\u306e\u30d6\u30ed\u30c3\u30af\u3092\u76f4\u63a5GPU\u306b\u8ee2\u9001\u3059\u308b\u5834\u5408\u3001\u5c11\u3005\u5384\u4ecb\u306a\u554f\u984c\u304c\u751f\u3058\u307e\u3059\u3002 NVMe-SSD\u306bP2P DMA\u3092\u8981\u6c42\u3059\u308b\u6642\u70b9\u3067\u306f\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u30d6\u30ed\u30c3\u30af\u306e\u5185\u5bb9\u306f\u307e\u3060CPU/RAM\u3078\u3068\u8aad\u307f\u51fa\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u5177\u4f53\u7684\u306b\u3069\u306e\u884c\u304c\u53ef\u8996\u3067\u3042\u308b\u306e\u304b\u3001\u3069\u306e\u884c\u304c\u4e0d\u53ef\u8996\u3067\u3042\u308b\u306e\u304b\u3092\u5224\u5225\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001PostgreSQL\u304c\u30ec\u30b3\u30fc\u30c9\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u3078\u66f8\u304d\u51fa\u3059\u969b\u306bMVCC\u95a2\u9023\u306e\u5c5e\u6027\u3068\u5171\u306b\u66f8\u304d\u8fbc\u3093\u3067\u3044\u308b\u305f\u3081\u3067\u3001\u4f3c\u305f\u3088\u3046\u306a\u554f\u984c\u304cIndexOnlyScan\u3092\u5b9f\u88c5\u3059\u308b\u969b\u306b\u8868\u9762\u5316\u3057\u307e\u3057\u305f\u3002 \u3053\u308c\u306b\u5bfe\u51e6\u3059\u308b\u305f\u3081\u3001PostgreSQL\u306fVisibility Map\u3068\u547c\u3070\u308c\u308b\u30a4\u30f3\u30d5\u30e9\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u3042\u308b\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u4e2d\u306b\u5b58\u5728\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u304c\u5168\u3066\u306e\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u304b\u3089\u53ef\u8996\u3067\u3042\u308b\u4e8b\u304c\u660e\u3089\u304b\u3067\u3042\u308c\u3070\u3001\u8a72\u5f53\u3059\u308b\u30d3\u30c3\u30c8\u3092\u7acb\u3066\u308b\u4e8b\u3067\u3001\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092\u8aad\u3080\u3053\u3068\u306a\u304f\u5f53\u8a72\u30d6\u30ed\u30c3\u30af\u306bMVCC\u4e0d\u53ef\u8996\u306a\u30ec\u30b3\u30fc\u30c9\u304c\u5b58\u5728\u3059\u308b\u304b\u5426\u304b\u3092\u5224\u5b9a\u3059\u308b\u4e8b\u3092\u53ef\u80fd\u3068\u3059\u308b\u3082\u306e\u3067\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u3053\u306e\u30a4\u30f3\u30d5\u30e9\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u3001Visibility Map\u304c\u30bb\u30c3\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\"all-visible\"\u3067\u3042\u308b\u30d6\u30ed\u30c3\u30af\u3060\u3051\u304cP2P DMA\u3067\u8aad\u307f\u51fa\u3059\u3088\u3046\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u9001\u51fa\u3055\u308c\u307e\u3059\u3002 Visibility Map\u306fVACUUM\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u4f5c\u6210\u3055\u308c\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u660e\u793a\u7684\u306bVACUUM\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u3067\u5f37\u5236\u7684\u306bVisibility Map\u3092\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 VACUUM ANALYZE linerorder;","title":"Visibility Map\u306b\u95a2\u3059\u308b\u6ce8\u610f\u4e8b\u9805"},{"location":"troubles/","text":"\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0 \u554f\u984c\u306e\u5207\u308a\u5206\u3051 \u7279\u5b9a\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u305f\u969b\u306b\u4f55\u304c\u3057\u304b\u306e\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u305d\u308c\u304c\u4f55\u306b\u8d77\u56e0\u3059\u308b\u3082\u306e\u3067\u3042\u308b\u306e\u304b\u3092\u7279\u5b9a\u3059\u308b\u306e\u306f\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u7b2c\u4e00\u6b69\u3067\u3059\u3002 \u6b8b\u5ff5\u306a\u304c\u3089\u3001PostgreSQL\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3068\u6bd4\u3079PG-Strom\u306e\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306f\u975e\u5e38\u306b\u5c11\u306a\u3044\u6570\u306e\u958b\u767a\u8005\u306b\u3088\u3063\u3066\u652f\u3048\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u54c1\u8cea\u3084\u5b9f\u7e3e\u3068\u3044\u3063\u305f\u89b3\u70b9\u304b\u3089\u3001\u307e\u305aPG-Strom\u304c\u60aa\u3055\u3092\u3057\u3066\u3044\u306a\u3044\u304b\u7591\u3046\u306e\u306f\u59a5\u5f53\u306a\u5224\u65ad\u3067\u3059\u3002 PG-Strom\u306e\u5168\u6a5f\u80fd\u3092\u4e00\u5ea6\u306b\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u306b\u306f pg_strom.enabled \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u4e8b\u3067PG-Strom\u306f\u7121\u52b9\u5316\u3055\u308c\u3001\u6a19\u6e96\u306ePostgreSQL\u3068\u5168\u304f\u540c\u4e00\u306e\u72b6\u614b\u3068\u306a\u308a\u307e\u3059\u3002 \u305d\u308c\u3067\u3082\u306a\u304a\u554f\u984c\u304c\u518d\u73fe\u3059\u308b\u304b\u3069\u3046\u304b\u306f\u4e00\u3064\u306e\u5224\u65ad\u6750\u6599\u3068\u306a\u308b\u3067\u3057\u3087\u3046\u3002 # SET pg_strom.enabled = off; \u3053\u306e\u4ed6\u306b\u3082\u3001GpuScan\u3001GpuJoin\u3001GpuPreAgg\u3068\u3044\u3063\u305f\u7279\u5b9a\u306e\u5b9f\u884c\u8a08\u753b\u306e\u307f\u3092\u7121\u52b9\u5316\u3059\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u8a73\u7d30\u306f \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9/GPU\u30d1\u30e9\u30e1\u30fc\u30bf \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u63a1\u53d6 \u30b7\u30b9\u30c6\u30e0\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3059\u3088\u3046\u306a\u91cd\u5927\u306a\u30c8\u30e9\u30d6\u30eb\u306e\u89e3\u6790\u306b\u306f\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u63a1\u53d6\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002 \u672c\u7bc0\u3067\u306f\u3001PostgreSQL\u3068PG-Strom\u30d7\u30ed\u30bb\u30b9\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(CPU\u5074)\u3001\u304a\u3088\u3073PG-Strom\u306eGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(GPU\u5074)\u3092\u53d6\u5f97\u3057\u3001\u969c\u5bb3\u767a\u751f\u6642\u306e\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u63a1\u53d6\u3059\u308b\u305f\u3081\u306e\u624b\u6bb5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002 PostgreSQL\u8d77\u52d5\u6642\u8a2d\u5b9a\u306e\u8ffd\u52a0 \u30d7\u30ed\u30bb\u30b9\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u6642\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(CPU\u5074)\u3092\u751f\u6210\u3059\u308b\u306b\u306f\u3001PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u304c\u751f\u6210\u3059\u308b\u4e8b\u306e\u3067\u304d\u308b core \u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u3092\u7121\u5236\u9650\u306b\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306fPostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u3092\u8d77\u52d5\u3059\u308b\u30b7\u30a7\u30eb\u4e0a\u3067 ulimit -c \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u5909\u66f4\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30a8\u30e9\u30fc\u6642\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(GPU\u5074)\u3092\u751f\u6210\u3059\u308b\u306b\u306f\u3001PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u304c\u74b0\u5883\u5909\u6570 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u306b 1 \u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 systemd\u304b\u3089PostgreSQL\u3092\u8d77\u52d5\u3059\u308b\u5834\u5408\u3001 /etc/systemd/system/postgresql-.service.d/ \u4ee5\u4e0b\u306b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u3053\u308c\u3089\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 RPM\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u5185\u5bb9\u306e pg_strom.conf \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002 [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1 CUDA9.1\u306b\u304a\u3044\u3066\u306f\u3001\u901a\u5e38\u3001GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u751f\u6210\u306b\u306f\u6570\u5206\u4ee5\u4e0a\u306e\u6642\u9593\u3092\u8981\u3057\u3001\u305d\u306e\u9593\u3001\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3057\u305fPostgreSQL\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u5fdc\u7b54\u306f\u5b8c\u5168\u306b\u505c\u6b62\u3057\u3066\u3057\u307e\u3057\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001\u306f\u7279\u5b9a\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u306b\u304a\u3044\u3066\u767a\u751f\u3059\u308bGPU\u30ab\u30fc\u30cd\u30eb\u306b\u8d77\u56e0\u3059\u308b\u30a8\u30e9\u30fc\u306e\u539f\u56e0\u8abf\u67fb\u3092\u884c\u3046\u5834\u5408\u306b\u3060\u3051\u3001 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u74b0\u5883\u5909\u6570\u3092\u8a2d\u5b9a\u3059\u308b\u4e8b\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002 RPM\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u304a\u3051\u308b\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u306f\u3001 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u74b0\u5883\u5909\u6570\u306e\u884c\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u3044\u307e\u3059\u3002 PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u3092\u518d\u8d77\u52d5\u3059\u308b\u3068\u3001 Max core file size \u304cunlimited\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 # cat /proc//limits Limit Soft Limit Hard Limit Units : : : : Max core file size unlimited unlimited bytes : : : : debuginfo\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u304b\u3089\u610f\u5473\u306e\u3042\u308b\u60c5\u5831\u3092\u8aad\u307f\u53d6\u308b\u306b\u306f\u30b7\u30f3\u30dc\u30eb\u60c5\u5831\u304c\u5fc5\u8981\u3067\u3059\u3002 \u3053\u308c\u3089\u306f -debuginfo \u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u683c\u7d0d\u3055\u308c\u3066\u304a\u308a\u3001\u30b7\u30b9\u30c6\u30e0\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308bPostgreSQL\u304a\u3088\u3073PG-Strom\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u5fdc\u3058\u3066\u305d\u308c\u305e\u308c\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002 # yum install postgresql10-debuginfo pg_strom-PG10-debuginfo : ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: pg_strom-PG10-debuginfo x86_64 1.9-180301.el7 heterodb-debuginfo 766 k postgresql10-debuginfo x86_64 10.3-1PGDG.rhel7 pgdg10 9.7 M Transaction Summary ================================================================================ Install 2 Packages : Installed: pg_strom-PG10-debuginfo.x86_64 0:1.9-180301.el7 postgresql10-debuginfo.x86_64 0:10.3-1PGDG.rhel7 Complete! CPU\u5074\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u306e\u78ba\u8a8d \u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u4f5c\u6210\u3055\u308c\u308b\u30d1\u30b9\u306f\u3001\u30ab\u30fc\u30cd\u30eb\u30d1\u30e9\u30e1\u30fc\u30bf kernel.core_pattern \u304a\u3088\u3073 kernel.core_uses_pid \u306e\u5024\u306b\u3088\u3063\u3066\u6c7a\u307e\u308a\u307e\u3059\u3002 \u901a\u5e38\u306f\u30d7\u30ed\u30bb\u30b9\u306e\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u4f5c\u6210\u3055\u308c\u307e\u3059\u306e\u3067\u3001systemd\u304b\u3089PostgreSQL\u3092\u8d77\u52d5\u3057\u305f\u5834\u5408\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u304c\u69cb\u7bc9\u3055\u308c\u308b /var/lib/pgdata \u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 core. \u30d5\u30a1\u30a4\u30eb\u304c\u751f\u6210\u3055\u308c\u3066\u3044\u308b\u306e\u3092\u78ba\u8a8d\u3057\u305f\u3089\u3001 gdb \u3092\u7528\u3044\u3066\u30af\u30e9\u30c3\u30b7\u30e5\u306b\u81f3\u308b\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002 gdb \u306e -c \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30b3\u30a2\u30d5\u30a1\u30a4\u30eb\u3092\u3001 -f \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 # gdb -c /var/lib/pgdata/core.134680 -f /usr/pgsql-10/bin/postgres GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7_4.1 : (gdb) bt #0 0x00007fb942af3903 in __epoll_wait_nocancel () from /lib64/libc.so.6 #1 0x00000000006f71ae in WaitEventSetWaitBlock (nevents=1, occurred_events=0x7ffee51e1d70, cur_timeout=-1, set=0x2833298) at latch.c:1048 #2 WaitEventSetWait (set=0x2833298, timeout=timeout@entry-1, occurred_events=occurred_events@entry0x7ffee51e1d70, nevents=nevents@entry1, wait_event_info=wait_event_info@entry100663296) at latch.c:1000 #3 0x00000000006210fb in secure_read (port=0x2876120, ptr=0xcaa7e0 , len=8192) at be-secure.c:166 #4 0x000000000062b6e8 in pq_recvbuf () at pqcomm.c:963 #5 0x000000000062c345 in pq_getbyte () at pqcomm.c:1006 #6 0x0000000000718682 in SocketBackend (inBuf=0x7ffee51e1ef0) at postgres.c:328 #7 ReadCommand (inBuf=0x7ffee51e1ef0) at postgres.c:501 #8 PostgresMain (argc=, argv=argv@entry0x287bb68, dbname=0x28333f8 \"postgres\", username=) at postgres.c:4030 #9 0x000000000047adbc in BackendRun (port=0x2876120) at postmaster.c:4405 #10 BackendStartup (port=0x2876120) at postmaster.c:4077 #11 ServerLoop () at postmaster.c:1755 #12 0x00000000006afb7f in PostmasterMain (argc=argc@entry3, argv=argv@entry0x2831280) at postmaster.c:1363 #13 0x000000000047bbef in main (argc=3, argv=0x2831280) at main.c:228 gdb\u306e bt \u30b3\u30de\u30f3\u30c9\u3067\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002 \u3053\u306e\u30b1\u30fc\u30b9\u3067\u306f\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u306e\u30af\u30a8\u30ea\u3092\u5f85\u3063\u3066\u3044\u308b\u72b6\u614b\u306ePostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306b SIGSEGV \u30b7\u30b0\u30ca\u30eb\u3092\u9001\u51fa\u3057\u3066\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3057\u305f\u305f\u3081\u3001 WaitEventSetWait \u5ef6\u9577\u4e0a\u306e __epoll_wait_nocancel \u3067\u30d7\u30ed\u30bb\u30b9\u304c\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u3066\u3044\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 GPU\u5074\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u306e\u78ba\u8a8d GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306f\u3001\uff08 CUDA_COREDUMP_FILE \u74b0\u5883\u5909\u6570\u3092\u7528\u3044\u3066\u660e\u793a\u7684\u306b\u6307\u5b9a\u3057\u306a\u3051\u308c\u3070\uff09PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u306e\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u751f\u6210\u3055\u308c\u307e\u3059\u3002 systemd\u304b\u3089PostgreSQL\u3092\u8d77\u52d5\u3057\u305f\u5834\u5408\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u304c\u69cb\u7bc9\u3055\u308c\u308b /var/lib/pgdata \u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ee5\u4e0b\u306e\u540d\u524d\u3067GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u304c\u751f\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002 core___.nvcudmp \u306a\u304a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u3067\u306fGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306b\u306f\u30b7\u30f3\u30dc\u30eb\u60c5\u5831\u306a\u3069\u306e\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u3053\u306e\u72b6\u614b\u3067\u306f\u969c\u5bb3\u89e3\u6790\u3092\u884c\u3046\u4e8b\u306f\u307b\u3068\u3093\u3069\u4e0d\u53ef\u80fd\u3067\u3059\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066PG-Strom\u304c\u751f\u6210\u3059\u308bGPU\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u3092\u542b\u3081\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u305f\u3060\u3057\u3001\u3053\u306e\u8a2d\u5b9a\u306f\u5b9f\u884c\u6642\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u4f4e\u4e0b\u3055\u305b\u308b\u305f\u3081\u3001\u6052\u5e38\u7684\u306a\u4f7f\u7528\u306f\u975e\u63a8\u5968\u3067\u3059\u3002 \u30c8\u30e9\u30d6\u30eb\u89e3\u6790\u6642\u306b\u3060\u3051\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 nvme=# set pg_strom.debug_jit_compile_options = on; SET \u751f\u6210\u3055\u308c\u305fGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f cuda-gdb \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 # /usr/local/cuda/bin/cuda-gdb NVIDIA (R) CUDA Debugger 9.1 release Portions Copyright (C) 2007-2017 NVIDIA Corporation : For help, type \"help\". Type \"apropos word\" to search for commands related to \"word\". (cuda-gdb) \u5f15\u6570\u306a\u3057\u3067 cuda-gdb \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001\u30d7\u30ed\u30f3\u30d7\u30c8\u4e0a\u3067 target \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u5148\u307b\u3069\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002 (cuda-gdb) target cudacore /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp Opening GPU coredump: /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp [New Thread 216240] CUDA Exception: Warp Illegal Address The exception was triggered at PC 0x7ff4dc82f930 (cuda_gpujoin.h:1159) [Current focus set to CUDA kernel 0, grid 1, block (0,0,0), thread (0,0,0), device 0, sm 0, warp 0, lane 0] #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 1159 while (khitem && khitem->hash != hash_value) \u3053\u306e\u72b6\u614b\u3067 bt \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3001\u554f\u984c\u767a\u751f\u500b\u6240\u3078\u306e\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u63a1\u53d6\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 (cuda-gdb) bt #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 #1 0x00007ff4dc9428f0 in gpujoin_main<<<(30,1,1),(256,1,1)>>> (kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, kds_dst=0x7fe9e8800030, kparams_gpreagg=0x0) at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1347 \u3088\u308a\u8a73\u7d30\u306a cuda-gdb \u30b3\u30de\u30f3\u30c9\u306e\u5229\u7528\u6cd5\u306f CUDA Toolkit Documentation - CUDA-GDB \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0"},{"location":"troubles/#_1","text":"","title":"\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0"},{"location":"troubles/#_2","text":"\u7279\u5b9a\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u305f\u969b\u306b\u4f55\u304c\u3057\u304b\u306e\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u305d\u308c\u304c\u4f55\u306b\u8d77\u56e0\u3059\u308b\u3082\u306e\u3067\u3042\u308b\u306e\u304b\u3092\u7279\u5b9a\u3059\u308b\u306e\u306f\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u7b2c\u4e00\u6b69\u3067\u3059\u3002 \u6b8b\u5ff5\u306a\u304c\u3089\u3001PostgreSQL\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3068\u6bd4\u3079PG-Strom\u306e\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306f\u975e\u5e38\u306b\u5c11\u306a\u3044\u6570\u306e\u958b\u767a\u8005\u306b\u3088\u3063\u3066\u652f\u3048\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u54c1\u8cea\u3084\u5b9f\u7e3e\u3068\u3044\u3063\u305f\u89b3\u70b9\u304b\u3089\u3001\u307e\u305aPG-Strom\u304c\u60aa\u3055\u3092\u3057\u3066\u3044\u306a\u3044\u304b\u7591\u3046\u306e\u306f\u59a5\u5f53\u306a\u5224\u65ad\u3067\u3059\u3002 PG-Strom\u306e\u5168\u6a5f\u80fd\u3092\u4e00\u5ea6\u306b\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u306b\u306f pg_strom.enabled \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u4e8b\u3067PG-Strom\u306f\u7121\u52b9\u5316\u3055\u308c\u3001\u6a19\u6e96\u306ePostgreSQL\u3068\u5168\u304f\u540c\u4e00\u306e\u72b6\u614b\u3068\u306a\u308a\u307e\u3059\u3002 \u305d\u308c\u3067\u3082\u306a\u304a\u554f\u984c\u304c\u518d\u73fe\u3059\u308b\u304b\u3069\u3046\u304b\u306f\u4e00\u3064\u306e\u5224\u65ad\u6750\u6599\u3068\u306a\u308b\u3067\u3057\u3087\u3046\u3002 # SET pg_strom.enabled = off; \u3053\u306e\u4ed6\u306b\u3082\u3001GpuScan\u3001GpuJoin\u3001GpuPreAgg\u3068\u3044\u3063\u305f\u7279\u5b9a\u306e\u5b9f\u884c\u8a08\u753b\u306e\u307f\u3092\u7121\u52b9\u5316\u3059\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u8a73\u7d30\u306f \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9/GPU\u30d1\u30e9\u30e1\u30fc\u30bf \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u554f\u984c\u306e\u5207\u308a\u5206\u3051"},{"location":"troubles/#_3","text":"\u30b7\u30b9\u30c6\u30e0\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3059\u3088\u3046\u306a\u91cd\u5927\u306a\u30c8\u30e9\u30d6\u30eb\u306e\u89e3\u6790\u306b\u306f\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u63a1\u53d6\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002 \u672c\u7bc0\u3067\u306f\u3001PostgreSQL\u3068PG-Strom\u30d7\u30ed\u30bb\u30b9\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(CPU\u5074)\u3001\u304a\u3088\u3073PG-Strom\u306eGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(GPU\u5074)\u3092\u53d6\u5f97\u3057\u3001\u969c\u5bb3\u767a\u751f\u6642\u306e\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u63a1\u53d6\u3059\u308b\u305f\u3081\u306e\u624b\u6bb5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002","title":"\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u63a1\u53d6"},{"location":"troubles/#postgresql","text":"\u30d7\u30ed\u30bb\u30b9\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u6642\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(CPU\u5074)\u3092\u751f\u6210\u3059\u308b\u306b\u306f\u3001PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u304c\u751f\u6210\u3059\u308b\u4e8b\u306e\u3067\u304d\u308b core \u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u3092\u7121\u5236\u9650\u306b\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306fPostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u3092\u8d77\u52d5\u3059\u308b\u30b7\u30a7\u30eb\u4e0a\u3067 ulimit -c \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u5909\u66f4\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30a8\u30e9\u30fc\u6642\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(GPU\u5074)\u3092\u751f\u6210\u3059\u308b\u306b\u306f\u3001PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u304c\u74b0\u5883\u5909\u6570 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u306b 1 \u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 systemd\u304b\u3089PostgreSQL\u3092\u8d77\u52d5\u3059\u308b\u5834\u5408\u3001 /etc/systemd/system/postgresql-.service.d/ \u4ee5\u4e0b\u306b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u3053\u308c\u3089\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 RPM\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u5185\u5bb9\u306e pg_strom.conf \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002 [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1 CUDA9.1\u306b\u304a\u3044\u3066\u306f\u3001\u901a\u5e38\u3001GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u751f\u6210\u306b\u306f\u6570\u5206\u4ee5\u4e0a\u306e\u6642\u9593\u3092\u8981\u3057\u3001\u305d\u306e\u9593\u3001\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3057\u305fPostgreSQL\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u5fdc\u7b54\u306f\u5b8c\u5168\u306b\u505c\u6b62\u3057\u3066\u3057\u307e\u3057\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001\u306f\u7279\u5b9a\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u306b\u304a\u3044\u3066\u767a\u751f\u3059\u308bGPU\u30ab\u30fc\u30cd\u30eb\u306b\u8d77\u56e0\u3059\u308b\u30a8\u30e9\u30fc\u306e\u539f\u56e0\u8abf\u67fb\u3092\u884c\u3046\u5834\u5408\u306b\u3060\u3051\u3001 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u74b0\u5883\u5909\u6570\u3092\u8a2d\u5b9a\u3059\u308b\u4e8b\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002 RPM\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u304a\u3051\u308b\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u306f\u3001 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u74b0\u5883\u5909\u6570\u306e\u884c\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u3044\u307e\u3059\u3002 PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u3092\u518d\u8d77\u52d5\u3059\u308b\u3068\u3001 Max core file size \u304cunlimited\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 # cat /proc//limits Limit Soft Limit Hard Limit Units : : : : Max core file size unlimited unlimited bytes : : : :","title":"PostgreSQL\u8d77\u52d5\u6642\u8a2d\u5b9a\u306e\u8ffd\u52a0"},{"location":"troubles/#debuginfo","text":"\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u304b\u3089\u610f\u5473\u306e\u3042\u308b\u60c5\u5831\u3092\u8aad\u307f\u53d6\u308b\u306b\u306f\u30b7\u30f3\u30dc\u30eb\u60c5\u5831\u304c\u5fc5\u8981\u3067\u3059\u3002 \u3053\u308c\u3089\u306f -debuginfo \u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u683c\u7d0d\u3055\u308c\u3066\u304a\u308a\u3001\u30b7\u30b9\u30c6\u30e0\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308bPostgreSQL\u304a\u3088\u3073PG-Strom\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u5fdc\u3058\u3066\u305d\u308c\u305e\u308c\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002 # yum install postgresql10-debuginfo pg_strom-PG10-debuginfo : ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: pg_strom-PG10-debuginfo x86_64 1.9-180301.el7 heterodb-debuginfo 766 k postgresql10-debuginfo x86_64 10.3-1PGDG.rhel7 pgdg10 9.7 M Transaction Summary ================================================================================ Install 2 Packages : Installed: pg_strom-PG10-debuginfo.x86_64 0:1.9-180301.el7 postgresql10-debuginfo.x86_64 0:10.3-1PGDG.rhel7 Complete!","title":"debuginfo\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"troubles/#cpu","text":"\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u4f5c\u6210\u3055\u308c\u308b\u30d1\u30b9\u306f\u3001\u30ab\u30fc\u30cd\u30eb\u30d1\u30e9\u30e1\u30fc\u30bf kernel.core_pattern \u304a\u3088\u3073 kernel.core_uses_pid \u306e\u5024\u306b\u3088\u3063\u3066\u6c7a\u307e\u308a\u307e\u3059\u3002 \u901a\u5e38\u306f\u30d7\u30ed\u30bb\u30b9\u306e\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u4f5c\u6210\u3055\u308c\u307e\u3059\u306e\u3067\u3001systemd\u304b\u3089PostgreSQL\u3092\u8d77\u52d5\u3057\u305f\u5834\u5408\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u304c\u69cb\u7bc9\u3055\u308c\u308b /var/lib/pgdata \u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 core. \u30d5\u30a1\u30a4\u30eb\u304c\u751f\u6210\u3055\u308c\u3066\u3044\u308b\u306e\u3092\u78ba\u8a8d\u3057\u305f\u3089\u3001 gdb \u3092\u7528\u3044\u3066\u30af\u30e9\u30c3\u30b7\u30e5\u306b\u81f3\u308b\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002 gdb \u306e -c \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30b3\u30a2\u30d5\u30a1\u30a4\u30eb\u3092\u3001 -f \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 # gdb -c /var/lib/pgdata/core.134680 -f /usr/pgsql-10/bin/postgres GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7_4.1 : (gdb) bt #0 0x00007fb942af3903 in __epoll_wait_nocancel () from /lib64/libc.so.6 #1 0x00000000006f71ae in WaitEventSetWaitBlock (nevents=1, occurred_events=0x7ffee51e1d70, cur_timeout=-1, set=0x2833298) at latch.c:1048 #2 WaitEventSetWait (set=0x2833298, timeout=timeout@entry-1, occurred_events=occurred_events@entry0x7ffee51e1d70, nevents=nevents@entry1, wait_event_info=wait_event_info@entry100663296) at latch.c:1000 #3 0x00000000006210fb in secure_read (port=0x2876120, ptr=0xcaa7e0 , len=8192) at be-secure.c:166 #4 0x000000000062b6e8 in pq_recvbuf () at pqcomm.c:963 #5 0x000000000062c345 in pq_getbyte () at pqcomm.c:1006 #6 0x0000000000718682 in SocketBackend (inBuf=0x7ffee51e1ef0) at postgres.c:328 #7 ReadCommand (inBuf=0x7ffee51e1ef0) at postgres.c:501 #8 PostgresMain (argc=, argv=argv@entry0x287bb68, dbname=0x28333f8 \"postgres\", username=) at postgres.c:4030 #9 0x000000000047adbc in BackendRun (port=0x2876120) at postmaster.c:4405 #10 BackendStartup (port=0x2876120) at postmaster.c:4077 #11 ServerLoop () at postmaster.c:1755 #12 0x00000000006afb7f in PostmasterMain (argc=argc@entry3, argv=argv@entry0x2831280) at postmaster.c:1363 #13 0x000000000047bbef in main (argc=3, argv=0x2831280) at main.c:228 gdb\u306e bt \u30b3\u30de\u30f3\u30c9\u3067\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002 \u3053\u306e\u30b1\u30fc\u30b9\u3067\u306f\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u306e\u30af\u30a8\u30ea\u3092\u5f85\u3063\u3066\u3044\u308b\u72b6\u614b\u306ePostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306b SIGSEGV \u30b7\u30b0\u30ca\u30eb\u3092\u9001\u51fa\u3057\u3066\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3057\u305f\u305f\u3081\u3001 WaitEventSetWait \u5ef6\u9577\u4e0a\u306e __epoll_wait_nocancel \u3067\u30d7\u30ed\u30bb\u30b9\u304c\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u3066\u3044\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002","title":"CPU\u5074\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u306e\u78ba\u8a8d"},{"location":"troubles/#gpu","text":"GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306f\u3001\uff08 CUDA_COREDUMP_FILE \u74b0\u5883\u5909\u6570\u3092\u7528\u3044\u3066\u660e\u793a\u7684\u306b\u6307\u5b9a\u3057\u306a\u3051\u308c\u3070\uff09PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u306e\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u751f\u6210\u3055\u308c\u307e\u3059\u3002 systemd\u304b\u3089PostgreSQL\u3092\u8d77\u52d5\u3057\u305f\u5834\u5408\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u304c\u69cb\u7bc9\u3055\u308c\u308b /var/lib/pgdata \u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ee5\u4e0b\u306e\u540d\u524d\u3067GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u304c\u751f\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002 core___.nvcudmp \u306a\u304a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u3067\u306fGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306b\u306f\u30b7\u30f3\u30dc\u30eb\u60c5\u5831\u306a\u3069\u306e\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u3053\u306e\u72b6\u614b\u3067\u306f\u969c\u5bb3\u89e3\u6790\u3092\u884c\u3046\u4e8b\u306f\u307b\u3068\u3093\u3069\u4e0d\u53ef\u80fd\u3067\u3059\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066PG-Strom\u304c\u751f\u6210\u3059\u308bGPU\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u3092\u542b\u3081\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u305f\u3060\u3057\u3001\u3053\u306e\u8a2d\u5b9a\u306f\u5b9f\u884c\u6642\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u4f4e\u4e0b\u3055\u305b\u308b\u305f\u3081\u3001\u6052\u5e38\u7684\u306a\u4f7f\u7528\u306f\u975e\u63a8\u5968\u3067\u3059\u3002 \u30c8\u30e9\u30d6\u30eb\u89e3\u6790\u6642\u306b\u3060\u3051\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 nvme=# set pg_strom.debug_jit_compile_options = on; SET \u751f\u6210\u3055\u308c\u305fGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f cuda-gdb \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 # /usr/local/cuda/bin/cuda-gdb NVIDIA (R) CUDA Debugger 9.1 release Portions Copyright (C) 2007-2017 NVIDIA Corporation : For help, type \"help\". Type \"apropos word\" to search for commands related to \"word\". (cuda-gdb) \u5f15\u6570\u306a\u3057\u3067 cuda-gdb \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001\u30d7\u30ed\u30f3\u30d7\u30c8\u4e0a\u3067 target \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u5148\u307b\u3069\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002 (cuda-gdb) target cudacore /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp Opening GPU coredump: /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp [New Thread 216240] CUDA Exception: Warp Illegal Address The exception was triggered at PC 0x7ff4dc82f930 (cuda_gpujoin.h:1159) [Current focus set to CUDA kernel 0, grid 1, block (0,0,0), thread (0,0,0), device 0, sm 0, warp 0, lane 0] #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 1159 while (khitem && khitem->hash != hash_value) \u3053\u306e\u72b6\u614b\u3067 bt \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3001\u554f\u984c\u767a\u751f\u500b\u6240\u3078\u306e\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u63a1\u53d6\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 (cuda-gdb) bt #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 #1 0x00007ff4dc9428f0 in gpujoin_main<<<(30,1,1),(256,1,1)>>> (kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, kds_dst=0x7fe9e8800030, kparams_gpreagg=0x0) at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1347 \u3088\u308a\u8a73\u7d30\u306a cuda-gdb \u30b3\u30de\u30f3\u30c9\u306e\u5229\u7528\u6cd5\u306f CUDA Toolkit Documentation - CUDA-GDB \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"GPU\u5074\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u306e\u78ba\u8a8d"}]} \ No newline at end of file +{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"\u306f\u3058\u3081\u306b \u672c\u7ae0\u3067\u306fPG-Strom\u306e\u6982\u8981\u3001\u304a\u3088\u3073\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 PG-Strom\u3068\u306f? PG-Strom\u306fPostgreSQL v15\u304a\u3088\u3073\u4ee5\u964d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u5411\u3051\u306b\u8a2d\u8a08\u3055\u308c\u305f\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3001\u30c1\u30c3\u30d7\u3042\u305f\u308a\u6570\u5343\u500b\u306e\u30b3\u30a2\u3092\u6301\u3064GPU(Graphic Processor Unit)\u30c7\u30d0\u30a4\u30b9\u3092\u5229\u7528\u3059\u308b\u4e8b\u3067\u3001\u5927\u898f\u6a21\u306a\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u5bfe\u3059\u308b\u96c6\u8a08\u30fb\u89e3\u6790\u51e6\u7406\u3084\u30d0\u30c3\u30c1\u51e6\u7406\u5411\u3051\u306eSQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002 PG-Strom\u306e\u4e2d\u6838\u3068\u306a\u308b\u6a5f\u80fd\u306f\u3001SQL\u547d\u4ee4\u304b\u3089\u81ea\u52d5\u7684\u306bGPU\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u751f\u6210\u3059\u308b\u30b3\u30fc\u30c9\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3068\u3001SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPU\u4e0a\u3067\u975e\u540c\u671f\u304b\u3064\u4e26\u5217\u306b\u5b9f\u884c\u3059\u308b\u5b9f\u884c\u30a8\u30f3\u30b8\u30f3\u3067\u3059\u3002\u73fe\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306fSCAN\uff08WHERE\u53e5\u306e\u8a55\u4fa1\uff09\u3001JOIN\u304a\u3088\u3073GROUP BY\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001GPU\u51e6\u7406\u306b\u30a2\u30c9\u30d0\u30f3\u30c6\u30fc\u30b8\u304c\u3042\u308b\u5834\u5408\u306b\u306fPostgreSQL\u6a19\u6e96\u306e\u5b9f\u88c5\u3092\u7f6e\u304d\u63db\u3048\u308b\u4e8b\u3067\u3001\u30e6\u30fc\u30b6\u3084\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u306f\u900f\u904e\u7684\u306b\u52d5\u4f5c\u3057\u307e\u3059\u3002 PG-Strom\u306f\uff12\u3064\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u4e00\u3064\u306f\u884c\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308bPostgreSQL\u306eheap\u30b9\u30c8\u30ec\u30fc\u30b8\u30b7\u30b9\u30c6\u30e0\u3067\u3001\u3053\u308c\u306f\u5fc5\u305a\u3057\u3082\u96c6\u8a08\u30fb\u89e3\u6790\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u6700\u9069\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u4e00\u65b9\u3067\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u7cfb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092\u79fb\u52d5\u3059\u308b\u4e8b\u306a\u304f\u96c6\u8a08\u51e6\u7406\u3092\u5b9f\u884c\u3067\u304d\u308b\u3068\u3044\u3046\u30a2\u30c9\u30d0\u30f3\u30c6\u30fc\u30b8\u304c\u3042\u308a\u307e\u3059\u3002\u3082\u3046\u4e00\u3064\u306f\u3001\u5217\u5f62\u5f0f\u306e\u69cb\u9020\u5316\u30c7\u30fc\u30bf\u5f62\u5f0f\u3067\u3042\u308b Apache Arrow \u30d5\u30a1\u30a4\u30eb\u3067\u3001\u884c\u5358\u4f4d\u306e\u30c7\u30fc\u30bf\u66f4\u65b0\u306b\u306f\u4e0d\u5411\u304d\u3067\u3042\u308b\u3082\u306e\u306e\u3001\u52b9\u7387\u7684\u306b\u5927\u91cf\u30c7\u30fc\u30bf\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u5916\u90e8\u30c7\u30fc\u30bf\u30e9\u30c3\u30d1(FDW)\u3092\u901a\u3057\u3066\u52b9\u7387\u7684\u306a\u30c7\u30fc\u30bf\u306e\u691c\u7d22\u30fb\u96c6\u8a08\u304c\u53ef\u80fd\u3067\u3059\u3002 PG-Strom\u306e\u7279\u5fb4\u7684\u306a\u6a5f\u80fd\u306e\u4e00\u3064\u304c\u3001NVME/NVME-oF\u30c7\u30d0\u30a4\u30b9\u304b\u3089CPU/RAM\u3092\u30d0\u30a4\u30d1\u30b9\u3057\u3066GPU\u306b\u76f4\u63a5\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3057\u3001GPU\u3067SQL\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u3067\u30c7\u30d0\u30a4\u30b9\u306e\u5e2f\u57df\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u3067\u3059\u3002v3.0\u3067\u306f\u65b0\u305f\u306bNVIDIA GPUDirect Storage\u306b\u3082\u5bfe\u5fdc\u3057\u3001\u30ed\u30fc\u30ab\u30ebNVME-SSD\u3060\u3051\u3067\u306a\u304f\u3001NVME-oF\u3092\u4ecb\u3057\u305fSDS(Software Defined Storage)\u30c7\u30d0\u30a4\u30b9\u3084\u3001\u5171\u6709\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u306e\u8aad\u307f\u51fa\u3057\u306b\u3082\u5bfe\u5fdc\u3057\u307e\u3059\u3002 v3.0\u3067\u306f\u4e00\u90e8\u306ePostGIS\u95a2\u6570\u3068\u3001\u30b8\u30aa\u30e1\u30c8\u30ea\u30c7\u30fc\u30bf\u306eGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u63a2\u7d22\u3092GPU\u5074\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u66f4\u65b0\u306e\u591a\u3044\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092\u4e88\u3081GPU\u306b\u8907\u88fd\u3057\u3066\u304a\u304fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u6a5f\u80fd\u3068\u4f75\u305b\u3066\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306a\u4f4d\u7f6e\u60c5\u5831\u306b\u57fa\u3065\u304f\u691c\u7d22\u3001\u5206\u6790\u51e6\u7406\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002 v5.0\u3067\u306f\u30d7\u30ed\u30bb\u30b9\u30e2\u30c7\u30eb\u306e\u66f4\u65b0\uff08\u30de\u30eb\u30c1\u30d7\u30ed\u30bb\u30b9\u21d2\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\uff09\u3084\u3001\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u304b\u3089\u7591\u4f3c\u30b3\u30fc\u30c9\u3078\u306e\u5207\u308a\u66ff\u3048\u306a\u3069\u3001\u6839\u672c\u7684\u306a\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u8a2d\u8a08\u306e\u5909\u66f4\u304c\u884c\u308f\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5168\u822c\u7684\u306a\u51e6\u7406\u901f\u5ea6\u3084\u5b89\u5b9a\u6027\u306e\u6539\u5584\u304c\u56f3\u3089\u308c\u307e\u3057\u305f\u3002 \u30e9\u30a4\u30bb\u30f3\u30b9\u3068\u8457\u4f5c\u6a29 PG-Strom\u306fPostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u306b\u57fa\u3065\u3044\u3066\u516c\u958b\u30fb\u914d\u5e03\u3055\u308c\u3066\u3044\u308b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3059\u3002 \u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u8a73\u7d30\u306f LICENSE \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30b3\u30df\u30e5\u30cb\u30c6\u30a3 PG-Strom\u306b\u95a2\u3059\u308b\u8cea\u554f\u3084\u8981\u671b\u3001\u969c\u5bb3\u5831\u544a\u306a\u3069\u306f\u3001 GitHub\u306eDiscussion \u30da\u30fc\u30b8\u306b\u6295\u7a3f\u3059\u308b\u3088\u3046\u304a\u9858\u3044\u3057\u307e\u3059\u3002 \u672c\u63b2\u793a\u677f\u306f\u3001\u4e16\u754c\u4e2d\u306b\u516c\u958b\u3055\u308c\u305f\u30d1\u30d6\u30ea\u30c3\u30af\u306e\u63b2\u793a\u677f\u3067\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3064\u307e\u308a\u3001\u81ea\u5df1\u8cac\u4efb\u306e\u4e0b\u3001\u79d8\u5bc6\u60c5\u5831\u304c\u8aa4\u3063\u3066\u6295\u7a3f\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u672c\u63b2\u793a\u677f\u306e\u512a\u5148\u8a00\u8a9e\u306f\u82f1\u8a9e\u3067\u3059\u3002\u305f\u3060\u4e00\u65b9\u3067\u3001\u6b74\u53f2\u7684\u7d4c\u7def\u306b\u3088\u308aPG-Strom\u30e6\u30fc\u30b6\u306e\u591a\u304f\u306e\u5272\u5408\u304c\u65e5\u672c\u4eba\u3067\u3042\u308b\u4e8b\u306f\u627f\u77e5\u3057\u3066\u304a\u308a\u3001Discussion\u4e0a\u3067\u65e5\u672c\u8a9e\u3092\u5229\u7528\u3057\u305f\u8b70\u8ad6\u304c\u884c\u308f\u308c\u308b\u3053\u3068\u3082\u53ef\u80fd\u3068\u3057\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u3001Subject(\u4ef6\u540d)\u306b (JP) \u3068\u3044\u3046\u63a5\u982d\u53e5\u3092\u4ed8\u3051\u308b\u4e8b\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u975e\u65e5\u672c\u8a9e\u8a71\u8005\u304c\u4e0d\u8981\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8aad\u307f\u98db\u3070\u3059\u305f\u3081\u306b\u6709\u7528\u3067\u3059\u3002 \u30d0\u30b0\u3084\u969c\u5bb3\u306e\u5831\u544a \u7d50\u679c\u4e0d\u6b63\u3084\u30b7\u30b9\u30c6\u30e0\u30af\u30e9\u30c3\u30b7\u30e5/\u30ed\u30c3\u30af\u30a2\u30c3\u30d7\u3001\u305d\u306e\u4ed6\u306e\u7591\u308f\u3057\u3044\u52d5\u4f5c\u3092\u767a\u898b\u3057\u305f\u5834\u5408\u306f\u3001 PG-Strom Issue Tracker \u3067\u65b0\u3057\u3044\u30a4\u30b7\u30e5\u30fc\u3092\u30aa\u30fc\u30d7\u30f3\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30d0\u30b0\u30ec\u30dd\u30fc\u30c8\u306e\u4f5c\u6210\u306b\u969b\u3057\u3066\u306f\u3001\u4e0b\u8a18\u306e\u70b9\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 - \u540c\u3058\u554f\u984c\u3092\u6700\u65b0\u7248\u3067\u518d\u73fe\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u304b\u3069\u3046\u304b? - PG-Strom\u306e\u6700\u65b0\u7248\u3060\u3051\u3067\u306a\u304f\u3001OS\u3001CUDA\u3001PostgreSQL\u304a\u3088\u3073\u95a2\u9023\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u6700\u65b0\u7248\u3067\u30c6\u30b9\u30c8\u3059\u308b\u4e8b\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002 - PG-Strom\u304c\u7121\u52b9\u5316\u3055\u308c\u305f\u72b6\u614b\u3067\u3082\u540c\u3058\u554f\u984c\u3092\u518d\u73fe\u3067\u304d\u308b\u304b\u3069\u3046\u304b? - GUC\u30d1\u30e9\u30e1\u30fc\u30bf pg_strom.enabled \u306b\u3088\u3063\u3066PG-Strom\u306e\u6709\u52b9/\u7121\u52b9\u3092\u5207\u308a\u66ff\u3048\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 - \u540c\u3058\u65e2\u77e5\u554f\u984c\u304c\u65e2\u306bGitHub\u306e\u30a4\u30b7\u30e5\u30fc\u30c8\u30e9\u30c3\u30ab\u30fc\u306b\u5b58\u5728\u3059\u308b\u304b\u3069\u3046\u304b\uff1f - close \u72b6\u614b\u306e\u30a4\u30b7\u30e5\u30fc\u3092\u691c\u7d22\u3059\u308b\u306e\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306a\u60c5\u5831\u306f\u30d0\u30b0\u5831\u544a\u306b\u304a\u3044\u3066\u6709\u7528\u3067\u3059\u3002 \u554f\u984c\u3092\u518d\u73fe\u3059\u308b\u624b\u9806\uff08\u30c7\u30fc\u30bf\u304a\u3088\u3073\u30af\u30a8\u30ea\uff09 \u554f\u984c\u30af\u30a8\u30ea\u306e EXPLAIN VERBOSE \u51fa\u529b \u95a2\u9023\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u69cb\u9020\uff08 psql \u4e0a\u3067 \\d+
\u3092\u5b9f\u884c\u3057\u3066\u5f97\u3089\u308c\u308b\uff09 \u51fa\u529b\u3055\u308c\u305f\u30ed\u30b0\u30e1\u30c3\u30bb\u30fc\u30b8\uff08verbose\u51fa\u529b\u304c\u671b\u307e\u3057\u3044\uff09 \u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u304b\u3089\u5909\u66f4\u3057\u3066\u3044\u308bGUC\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u5024 \u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u8a2d\u5b9a\uff08\u7279\u306bGPU\u306e\u578b\u756a\u3068RAM\u5bb9\u91cf\uff09 \u3042\u306a\u305f\u306e\u74b0\u5883\u3067\u767a\u751f\u3057\u305f\u7591\u308f\u3057\u3044\u52d5\u4f5c\u304c\u30d0\u30b0\u304b\u3069\u3046\u304b\u5b9a\u304b\u3067\u306f\u306a\u3044\u5834\u5408\u3001\u65b0\u3057\u3044\u30a4\u30b7\u30e5\u30fc\u306e\u30c1\u30b1\u30c3\u30c8\u3092\u30aa\u30fc\u30d7\u30f3\u3059\u308b\u524d\u306bDiscussion\u63b2\u793a\u677f\u3078\u5831\u544a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u8ffd\u52a0\u7684\u306a\u60c5\u5831\u63a1\u53d6\u306e\u4f9d\u983c\u306a\u3069\u3001\u958b\u767a\u8005\u306f\u6b21\u306b\u53d6\u308b\u3079\u304d\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u63d0\u6848\u3057\u3066\u304f\u308c\u308b\u3067\u3057\u3087\u3046\u3002 \u65b0\u6a5f\u80fd\u306e\u63d0\u6848 \u4f55\u304b\u65b0\u6a5f\u80fd\u306e\u30a2\u30a4\u30c7\u30a2\u304c\u3042\u308b\u5834\u5408\u3001 PG-Strom Issue Tracker \u3067\u65b0\u3057\u3044\u30a4\u30b7\u30e5\u30fc\u3092\u30aa\u30fc\u30d7\u30f3\u3057 feature \u30bf\u30b0\u3092\u4ed8\u3051\u3066\u304f\u3060\u3055\u3044\u3002\u7d9a\u3044\u3066\u3001\u4ed6\u306e\u958b\u767a\u8005\u3068\u8b70\u8ad6\u3092\u884c\u3044\u307e\u3057\u3087\u3046\u3002 \u671b\u307e\u3057\u3044\u65b0\u6a5f\u80fd\u63d0\u6848\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8981\u7d20\u3092\u542b\u3093\u3067\u3044\u307e\u3059\u3002 \u3042\u306a\u305f\u306f\u3069\u306e\u3088\u3046\u306a\u554f\u984c\u3092\u89e3\u6c7a/\u6539\u5584\u3057\u305f\u3044\u306e\u304b\uff1f \u3042\u306a\u305f\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9/\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306b\u3068\u3063\u3066\u3069\u306e\u7a0b\u5ea6\u6df1\u523b\u306a\u306e\u304b\uff1f \u3069\u306e\u3088\u3046\u306b\u305d\u308c\u3092\u5b9f\u88c5\u3059\u308b\u306e\u304b\uff1f \uff08\u3082\u3057\u3042\u308c\u3070\uff09\u4e88\u60f3\u3055\u308c\u308b\u6b20\u70b9\u30fb\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5 \u958b\u767a\u8005\u306e\u9593\u3067\u305d\u306e\u5fc5\u8981\u6027\u306b\u95a2\u3057\u3066\u30b3\u30f3\u30bb\u30f3\u30b5\u30b9\u304c\u5f97\u3089\u308c\u308b\u3068\u3001\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u30fc\u306f\u30a4\u30b7\u30e5\u30fc\u30c1\u30b1\u30c3\u30c8\u306b accepted \u30bf\u30b0\u3092\u4ed8\u3051\u3001\u305d\u306e\u30c1\u30b1\u30c3\u30c8\u306f\u305d\u306e\u5f8c\u306e\u958b\u767a\u4f5c\u696d\u306e\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u306e\u305f\u3081\u306b\u5229\u7528\u3055\u308c\u307e\u3059\u3002\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u3001\u30a4\u30b7\u30e5\u30fc\u30c1\u30b1\u30c3\u30c8\u306b\u306f rejected \u30bf\u30b0\u3092\u4ed8\u3051\u3066\u30af\u30ed\u30fc\u30ba\u3055\u308c\u307e\u3059\u3002 \u4e00\u5ea6\u30d7\u30ed\u30dd\u30fc\u30b6\u30eb\u304c\u5374\u4e0b\u3055\u308c\u305f\u3068\u3057\u3066\u3082\u3001\u5c06\u6765\u306b\u304a\u3044\u3066\u307e\u305f\u7570\u306a\u3063\u305f\u6c7a\u5b9a\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u5468\u8fba\u72b6\u6cc1\u304c\u5909\u308f\u3063\u305f\u5834\u5408\u3001\u65b0\u6a5f\u80fd\u306e\u518d\u63d0\u6848\u3092\u8e8a\u8e87\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u958b\u767a\u6bb5\u968e\u3067\u306f\u3001\u30d1\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30b7\u30e5\u30fc\u30c1\u30b1\u30c3\u30c8\u306b\u6dfb\u4ed8\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002pull-request\u306f\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002 \u30b5\u30dd\u30fc\u30c8\u30dd\u30ea\u30b7\u30fc PG-Strom development team\u306fHeteroDB Software Distribution Center\u304b\u3089\u914d\u5e03\u3055\u308c\u305f\u6700\u65b0\u7248\u306e\u307f\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002 \u30c8\u30e9\u30d6\u30eb\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u3001\u307e\u305a\u305d\u306e\u554f\u984c\u306f\u6700\u65b0\u7248\u306e\u30ea\u30ea\u30fc\u30b9\u3067\u518d\u73fe\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u304b\u3081\u3066\u304f\u3060\u3055\u3044\u3002 \u307e\u305f\u3001\u3053\u308c\u306f\u30dc\u30e9\u30f3\u30c6\u30a3\u30a2\u30d9\u30fc\u30b9\u306e\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u30b5\u30dd\u30fc\u30c8\u306e\u30dd\u30ea\u30b7\u30fc\u3067\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3064\u307e\u308a\u3001\u30b5\u30dd\u30fc\u30c8\u306f\u30d9\u30b9\u30c8\u30a8\u30d5\u30a9\u30fc\u30c8\u3067\u304b\u3064\u3001SLA\u306e\u5b9a\u7fa9\u3082\u3042\u308a\u307e\u305b\u3093\u3002 \u3082\u3057\u5546\u7528\u306e\u30b5\u30dd\u30fc\u30c8\u304c\u5fc5\u8981\u3067\u3042\u308b\u5834\u5408\u3001HeteroDB\u793e\uff08contact@heterodbcom\uff09\u306b\u30b3\u30f3\u30bf\u30af\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u306f\u3058\u3081\u306b"},{"location":"#_1","text":"\u672c\u7ae0\u3067\u306fPG-Strom\u306e\u6982\u8981\u3001\u304a\u3088\u3073\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"\u306f\u3058\u3081\u306b"},{"location":"#pg-strom","text":"PG-Strom\u306fPostgreSQL v15\u304a\u3088\u3073\u4ee5\u964d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u5411\u3051\u306b\u8a2d\u8a08\u3055\u308c\u305f\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3001\u30c1\u30c3\u30d7\u3042\u305f\u308a\u6570\u5343\u500b\u306e\u30b3\u30a2\u3092\u6301\u3064GPU(Graphic Processor Unit)\u30c7\u30d0\u30a4\u30b9\u3092\u5229\u7528\u3059\u308b\u4e8b\u3067\u3001\u5927\u898f\u6a21\u306a\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u5bfe\u3059\u308b\u96c6\u8a08\u30fb\u89e3\u6790\u51e6\u7406\u3084\u30d0\u30c3\u30c1\u51e6\u7406\u5411\u3051\u306eSQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002 PG-Strom\u306e\u4e2d\u6838\u3068\u306a\u308b\u6a5f\u80fd\u306f\u3001SQL\u547d\u4ee4\u304b\u3089\u81ea\u52d5\u7684\u306bGPU\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u751f\u6210\u3059\u308b\u30b3\u30fc\u30c9\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3068\u3001SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPU\u4e0a\u3067\u975e\u540c\u671f\u304b\u3064\u4e26\u5217\u306b\u5b9f\u884c\u3059\u308b\u5b9f\u884c\u30a8\u30f3\u30b8\u30f3\u3067\u3059\u3002\u73fe\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306fSCAN\uff08WHERE\u53e5\u306e\u8a55\u4fa1\uff09\u3001JOIN\u304a\u3088\u3073GROUP BY\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001GPU\u51e6\u7406\u306b\u30a2\u30c9\u30d0\u30f3\u30c6\u30fc\u30b8\u304c\u3042\u308b\u5834\u5408\u306b\u306fPostgreSQL\u6a19\u6e96\u306e\u5b9f\u88c5\u3092\u7f6e\u304d\u63db\u3048\u308b\u4e8b\u3067\u3001\u30e6\u30fc\u30b6\u3084\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u306f\u900f\u904e\u7684\u306b\u52d5\u4f5c\u3057\u307e\u3059\u3002 PG-Strom\u306f\uff12\u3064\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u4e00\u3064\u306f\u884c\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308bPostgreSQL\u306eheap\u30b9\u30c8\u30ec\u30fc\u30b8\u30b7\u30b9\u30c6\u30e0\u3067\u3001\u3053\u308c\u306f\u5fc5\u305a\u3057\u3082\u96c6\u8a08\u30fb\u89e3\u6790\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u6700\u9069\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u4e00\u65b9\u3067\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u7cfb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092\u79fb\u52d5\u3059\u308b\u4e8b\u306a\u304f\u96c6\u8a08\u51e6\u7406\u3092\u5b9f\u884c\u3067\u304d\u308b\u3068\u3044\u3046\u30a2\u30c9\u30d0\u30f3\u30c6\u30fc\u30b8\u304c\u3042\u308a\u307e\u3059\u3002\u3082\u3046\u4e00\u3064\u306f\u3001\u5217\u5f62\u5f0f\u306e\u69cb\u9020\u5316\u30c7\u30fc\u30bf\u5f62\u5f0f\u3067\u3042\u308b Apache Arrow \u30d5\u30a1\u30a4\u30eb\u3067\u3001\u884c\u5358\u4f4d\u306e\u30c7\u30fc\u30bf\u66f4\u65b0\u306b\u306f\u4e0d\u5411\u304d\u3067\u3042\u308b\u3082\u306e\u306e\u3001\u52b9\u7387\u7684\u306b\u5927\u91cf\u30c7\u30fc\u30bf\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u5916\u90e8\u30c7\u30fc\u30bf\u30e9\u30c3\u30d1(FDW)\u3092\u901a\u3057\u3066\u52b9\u7387\u7684\u306a\u30c7\u30fc\u30bf\u306e\u691c\u7d22\u30fb\u96c6\u8a08\u304c\u53ef\u80fd\u3067\u3059\u3002 PG-Strom\u306e\u7279\u5fb4\u7684\u306a\u6a5f\u80fd\u306e\u4e00\u3064\u304c\u3001NVME/NVME-oF\u30c7\u30d0\u30a4\u30b9\u304b\u3089CPU/RAM\u3092\u30d0\u30a4\u30d1\u30b9\u3057\u3066GPU\u306b\u76f4\u63a5\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3057\u3001GPU\u3067SQL\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u3067\u30c7\u30d0\u30a4\u30b9\u306e\u5e2f\u57df\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u3067\u3059\u3002v3.0\u3067\u306f\u65b0\u305f\u306bNVIDIA GPUDirect Storage\u306b\u3082\u5bfe\u5fdc\u3057\u3001\u30ed\u30fc\u30ab\u30ebNVME-SSD\u3060\u3051\u3067\u306a\u304f\u3001NVME-oF\u3092\u4ecb\u3057\u305fSDS(Software Defined Storage)\u30c7\u30d0\u30a4\u30b9\u3084\u3001\u5171\u6709\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u306e\u8aad\u307f\u51fa\u3057\u306b\u3082\u5bfe\u5fdc\u3057\u307e\u3059\u3002 v3.0\u3067\u306f\u4e00\u90e8\u306ePostGIS\u95a2\u6570\u3068\u3001\u30b8\u30aa\u30e1\u30c8\u30ea\u30c7\u30fc\u30bf\u306eGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u63a2\u7d22\u3092GPU\u5074\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u66f4\u65b0\u306e\u591a\u3044\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092\u4e88\u3081GPU\u306b\u8907\u88fd\u3057\u3066\u304a\u304fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u6a5f\u80fd\u3068\u4f75\u305b\u3066\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306a\u4f4d\u7f6e\u60c5\u5831\u306b\u57fa\u3065\u304f\u691c\u7d22\u3001\u5206\u6790\u51e6\u7406\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002 v5.0\u3067\u306f\u30d7\u30ed\u30bb\u30b9\u30e2\u30c7\u30eb\u306e\u66f4\u65b0\uff08\u30de\u30eb\u30c1\u30d7\u30ed\u30bb\u30b9\u21d2\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\uff09\u3084\u3001\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u304b\u3089\u7591\u4f3c\u30b3\u30fc\u30c9\u3078\u306e\u5207\u308a\u66ff\u3048\u306a\u3069\u3001\u6839\u672c\u7684\u306a\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u8a2d\u8a08\u306e\u5909\u66f4\u304c\u884c\u308f\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5168\u822c\u7684\u306a\u51e6\u7406\u901f\u5ea6\u3084\u5b89\u5b9a\u6027\u306e\u6539\u5584\u304c\u56f3\u3089\u308c\u307e\u3057\u305f\u3002","title":"PG-Strom\u3068\u306f?"},{"location":"#_2","text":"PG-Strom\u306fPostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u306b\u57fa\u3065\u3044\u3066\u516c\u958b\u30fb\u914d\u5e03\u3055\u308c\u3066\u3044\u308b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3059\u3002 \u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u8a73\u7d30\u306f LICENSE \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u30e9\u30a4\u30bb\u30f3\u30b9\u3068\u8457\u4f5c\u6a29"},{"location":"#_3","text":"PG-Strom\u306b\u95a2\u3059\u308b\u8cea\u554f\u3084\u8981\u671b\u3001\u969c\u5bb3\u5831\u544a\u306a\u3069\u306f\u3001 GitHub\u306eDiscussion \u30da\u30fc\u30b8\u306b\u6295\u7a3f\u3059\u308b\u3088\u3046\u304a\u9858\u3044\u3057\u307e\u3059\u3002 \u672c\u63b2\u793a\u677f\u306f\u3001\u4e16\u754c\u4e2d\u306b\u516c\u958b\u3055\u308c\u305f\u30d1\u30d6\u30ea\u30c3\u30af\u306e\u63b2\u793a\u677f\u3067\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3064\u307e\u308a\u3001\u81ea\u5df1\u8cac\u4efb\u306e\u4e0b\u3001\u79d8\u5bc6\u60c5\u5831\u304c\u8aa4\u3063\u3066\u6295\u7a3f\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u672c\u63b2\u793a\u677f\u306e\u512a\u5148\u8a00\u8a9e\u306f\u82f1\u8a9e\u3067\u3059\u3002\u305f\u3060\u4e00\u65b9\u3067\u3001\u6b74\u53f2\u7684\u7d4c\u7def\u306b\u3088\u308aPG-Strom\u30e6\u30fc\u30b6\u306e\u591a\u304f\u306e\u5272\u5408\u304c\u65e5\u672c\u4eba\u3067\u3042\u308b\u4e8b\u306f\u627f\u77e5\u3057\u3066\u304a\u308a\u3001Discussion\u4e0a\u3067\u65e5\u672c\u8a9e\u3092\u5229\u7528\u3057\u305f\u8b70\u8ad6\u304c\u884c\u308f\u308c\u308b\u3053\u3068\u3082\u53ef\u80fd\u3068\u3057\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u3001Subject(\u4ef6\u540d)\u306b (JP) \u3068\u3044\u3046\u63a5\u982d\u53e5\u3092\u4ed8\u3051\u308b\u4e8b\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u975e\u65e5\u672c\u8a9e\u8a71\u8005\u304c\u4e0d\u8981\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8aad\u307f\u98db\u3070\u3059\u305f\u3081\u306b\u6709\u7528\u3067\u3059\u3002","title":"\u30b3\u30df\u30e5\u30cb\u30c6\u30a3"},{"location":"#_4","text":"\u7d50\u679c\u4e0d\u6b63\u3084\u30b7\u30b9\u30c6\u30e0\u30af\u30e9\u30c3\u30b7\u30e5/\u30ed\u30c3\u30af\u30a2\u30c3\u30d7\u3001\u305d\u306e\u4ed6\u306e\u7591\u308f\u3057\u3044\u52d5\u4f5c\u3092\u767a\u898b\u3057\u305f\u5834\u5408\u306f\u3001 PG-Strom Issue Tracker \u3067\u65b0\u3057\u3044\u30a4\u30b7\u30e5\u30fc\u3092\u30aa\u30fc\u30d7\u30f3\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30d0\u30b0\u30ec\u30dd\u30fc\u30c8\u306e\u4f5c\u6210\u306b\u969b\u3057\u3066\u306f\u3001\u4e0b\u8a18\u306e\u70b9\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 - \u540c\u3058\u554f\u984c\u3092\u6700\u65b0\u7248\u3067\u518d\u73fe\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u304b\u3069\u3046\u304b? - PG-Strom\u306e\u6700\u65b0\u7248\u3060\u3051\u3067\u306a\u304f\u3001OS\u3001CUDA\u3001PostgreSQL\u304a\u3088\u3073\u95a2\u9023\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u6700\u65b0\u7248\u3067\u30c6\u30b9\u30c8\u3059\u308b\u4e8b\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002 - PG-Strom\u304c\u7121\u52b9\u5316\u3055\u308c\u305f\u72b6\u614b\u3067\u3082\u540c\u3058\u554f\u984c\u3092\u518d\u73fe\u3067\u304d\u308b\u304b\u3069\u3046\u304b? - GUC\u30d1\u30e9\u30e1\u30fc\u30bf pg_strom.enabled \u306b\u3088\u3063\u3066PG-Strom\u306e\u6709\u52b9/\u7121\u52b9\u3092\u5207\u308a\u66ff\u3048\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 - \u540c\u3058\u65e2\u77e5\u554f\u984c\u304c\u65e2\u306bGitHub\u306e\u30a4\u30b7\u30e5\u30fc\u30c8\u30e9\u30c3\u30ab\u30fc\u306b\u5b58\u5728\u3059\u308b\u304b\u3069\u3046\u304b\uff1f - close \u72b6\u614b\u306e\u30a4\u30b7\u30e5\u30fc\u3092\u691c\u7d22\u3059\u308b\u306e\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306a\u60c5\u5831\u306f\u30d0\u30b0\u5831\u544a\u306b\u304a\u3044\u3066\u6709\u7528\u3067\u3059\u3002 \u554f\u984c\u3092\u518d\u73fe\u3059\u308b\u624b\u9806\uff08\u30c7\u30fc\u30bf\u304a\u3088\u3073\u30af\u30a8\u30ea\uff09 \u554f\u984c\u30af\u30a8\u30ea\u306e EXPLAIN VERBOSE \u51fa\u529b \u95a2\u9023\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u69cb\u9020\uff08 psql \u4e0a\u3067 \\d+
\u3092\u5b9f\u884c\u3057\u3066\u5f97\u3089\u308c\u308b\uff09 \u51fa\u529b\u3055\u308c\u305f\u30ed\u30b0\u30e1\u30c3\u30bb\u30fc\u30b8\uff08verbose\u51fa\u529b\u304c\u671b\u307e\u3057\u3044\uff09 \u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u304b\u3089\u5909\u66f4\u3057\u3066\u3044\u308bGUC\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u5024 \u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u8a2d\u5b9a\uff08\u7279\u306bGPU\u306e\u578b\u756a\u3068RAM\u5bb9\u91cf\uff09 \u3042\u306a\u305f\u306e\u74b0\u5883\u3067\u767a\u751f\u3057\u305f\u7591\u308f\u3057\u3044\u52d5\u4f5c\u304c\u30d0\u30b0\u304b\u3069\u3046\u304b\u5b9a\u304b\u3067\u306f\u306a\u3044\u5834\u5408\u3001\u65b0\u3057\u3044\u30a4\u30b7\u30e5\u30fc\u306e\u30c1\u30b1\u30c3\u30c8\u3092\u30aa\u30fc\u30d7\u30f3\u3059\u308b\u524d\u306bDiscussion\u63b2\u793a\u677f\u3078\u5831\u544a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u8ffd\u52a0\u7684\u306a\u60c5\u5831\u63a1\u53d6\u306e\u4f9d\u983c\u306a\u3069\u3001\u958b\u767a\u8005\u306f\u6b21\u306b\u53d6\u308b\u3079\u304d\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u63d0\u6848\u3057\u3066\u304f\u308c\u308b\u3067\u3057\u3087\u3046\u3002","title":"\u30d0\u30b0\u3084\u969c\u5bb3\u306e\u5831\u544a"},{"location":"#_5","text":"\u4f55\u304b\u65b0\u6a5f\u80fd\u306e\u30a2\u30a4\u30c7\u30a2\u304c\u3042\u308b\u5834\u5408\u3001 PG-Strom Issue Tracker \u3067\u65b0\u3057\u3044\u30a4\u30b7\u30e5\u30fc\u3092\u30aa\u30fc\u30d7\u30f3\u3057 feature \u30bf\u30b0\u3092\u4ed8\u3051\u3066\u304f\u3060\u3055\u3044\u3002\u7d9a\u3044\u3066\u3001\u4ed6\u306e\u958b\u767a\u8005\u3068\u8b70\u8ad6\u3092\u884c\u3044\u307e\u3057\u3087\u3046\u3002 \u671b\u307e\u3057\u3044\u65b0\u6a5f\u80fd\u63d0\u6848\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8981\u7d20\u3092\u542b\u3093\u3067\u3044\u307e\u3059\u3002 \u3042\u306a\u305f\u306f\u3069\u306e\u3088\u3046\u306a\u554f\u984c\u3092\u89e3\u6c7a/\u6539\u5584\u3057\u305f\u3044\u306e\u304b\uff1f \u3042\u306a\u305f\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9/\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306b\u3068\u3063\u3066\u3069\u306e\u7a0b\u5ea6\u6df1\u523b\u306a\u306e\u304b\uff1f \u3069\u306e\u3088\u3046\u306b\u305d\u308c\u3092\u5b9f\u88c5\u3059\u308b\u306e\u304b\uff1f \uff08\u3082\u3057\u3042\u308c\u3070\uff09\u4e88\u60f3\u3055\u308c\u308b\u6b20\u70b9\u30fb\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5 \u958b\u767a\u8005\u306e\u9593\u3067\u305d\u306e\u5fc5\u8981\u6027\u306b\u95a2\u3057\u3066\u30b3\u30f3\u30bb\u30f3\u30b5\u30b9\u304c\u5f97\u3089\u308c\u308b\u3068\u3001\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u30fc\u306f\u30a4\u30b7\u30e5\u30fc\u30c1\u30b1\u30c3\u30c8\u306b accepted \u30bf\u30b0\u3092\u4ed8\u3051\u3001\u305d\u306e\u30c1\u30b1\u30c3\u30c8\u306f\u305d\u306e\u5f8c\u306e\u958b\u767a\u4f5c\u696d\u306e\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u306e\u305f\u3081\u306b\u5229\u7528\u3055\u308c\u307e\u3059\u3002\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u3001\u30a4\u30b7\u30e5\u30fc\u30c1\u30b1\u30c3\u30c8\u306b\u306f rejected \u30bf\u30b0\u3092\u4ed8\u3051\u3066\u30af\u30ed\u30fc\u30ba\u3055\u308c\u307e\u3059\u3002 \u4e00\u5ea6\u30d7\u30ed\u30dd\u30fc\u30b6\u30eb\u304c\u5374\u4e0b\u3055\u308c\u305f\u3068\u3057\u3066\u3082\u3001\u5c06\u6765\u306b\u304a\u3044\u3066\u307e\u305f\u7570\u306a\u3063\u305f\u6c7a\u5b9a\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u5468\u8fba\u72b6\u6cc1\u304c\u5909\u308f\u3063\u305f\u5834\u5408\u3001\u65b0\u6a5f\u80fd\u306e\u518d\u63d0\u6848\u3092\u8e8a\u8e87\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u958b\u767a\u6bb5\u968e\u3067\u306f\u3001\u30d1\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30b7\u30e5\u30fc\u30c1\u30b1\u30c3\u30c8\u306b\u6dfb\u4ed8\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002pull-request\u306f\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002","title":"\u65b0\u6a5f\u80fd\u306e\u63d0\u6848"},{"location":"#_6","text":"PG-Strom development team\u306fHeteroDB Software Distribution Center\u304b\u3089\u914d\u5e03\u3055\u308c\u305f\u6700\u65b0\u7248\u306e\u307f\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002 \u30c8\u30e9\u30d6\u30eb\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u3001\u307e\u305a\u305d\u306e\u554f\u984c\u306f\u6700\u65b0\u7248\u306e\u30ea\u30ea\u30fc\u30b9\u3067\u518d\u73fe\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u304b\u3081\u3066\u304f\u3060\u3055\u3044\u3002 \u307e\u305f\u3001\u3053\u308c\u306f\u30dc\u30e9\u30f3\u30c6\u30a3\u30a2\u30d9\u30fc\u30b9\u306e\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u30b5\u30dd\u30fc\u30c8\u306e\u30dd\u30ea\u30b7\u30fc\u3067\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3064\u307e\u308a\u3001\u30b5\u30dd\u30fc\u30c8\u306f\u30d9\u30b9\u30c8\u30a8\u30d5\u30a9\u30fc\u30c8\u3067\u304b\u3064\u3001SLA\u306e\u5b9a\u7fa9\u3082\u3042\u308a\u307e\u305b\u3093\u3002 \u3082\u3057\u5546\u7528\u306e\u30b5\u30dd\u30fc\u30c8\u304c\u5fc5\u8981\u3067\u3042\u308b\u5834\u5408\u3001HeteroDB\u793e\uff08contact@heterodbcom\uff09\u306b\u30b3\u30f3\u30bf\u30af\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u30b5\u30dd\u30fc\u30c8\u30dd\u30ea\u30b7\u30fc"},{"location":"arrow_fdw/","text":"Apache Arrow (\u5217\u6307\u5411\u30c7\u30fc\u30bf\u30b9\u30c8\u30a2) \u6982\u8981 PostgreSQL\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u5185\u90e8\u7684\u306b8KB\u306e\u30d6\u30ed\u30c3\u30af 1 \u3068\u547c\u3070\u308c\u308b\u5358\u4f4d\u3067\u7de8\u6210\u3055\u308c\u3001\u30d6\u30ed\u30c3\u30af\u306f\u5168\u3066\u306e\u5c5e\u6027\u53ca\u3073\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u542b\u3080\u30bf\u30d7\u30eb\u3068\u547c\u3070\u308c\u308b\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u884c\u5358\u4f4d\u3067\u683c\u7d0d\u3057\u307e\u3059\u3002\u884c\u3092\u69cb\u6210\u3059\u308b\u30c7\u30fc\u30bf\u304c\u8fd1\u508d\u306b\u5b58\u5728\u3059\u308b\u305f\u3081\u3001\u3053\u308c\u306fINSERT\u3084UPDATE\u306e\u591a\u3044\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u6709\u52b9\u3067\u3059\u304c\u3001\u4e00\u65b9\u3067\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u30fb\u89e3\u6790\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u306f\u4e0d\u5411\u304d\u3067\u3042\u308b\u3068\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u901a\u5e38\u3001\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u306b\u304a\u3044\u3066\u306f\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u5168\u3066\u306e\u5217\u3092\u53c2\u7167\u3059\u308b\u4e8b\u306f\u73cd\u3057\u304f\u3001\u591a\u304f\u306e\u5834\u5408\u306b\u306f\u4e00\u90e8\u306e\u5217\u3060\u3051\u3092\u53c2\u7167\u3059\u308b\u3068\u3044\u3063\u305f\u51e6\u7406\u306b\u306a\u308a\u304c\u3061\u3067\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u5b9f\u969b\u306b\u306f\u53c2\u7167\u3055\u308c\u306a\u3044\u5217\u306e\u30c7\u30fc\u30bf\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u6d88\u8cbb\u3055\u308c\u308bI/O\u306e\u5e2f\u57df\u306f\u5168\u304f\u7121\u99c4\u3067\u3059\u304c\u3001\u884c\u5358\u4f4d\u3067\u7de8\u6210\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u7279\u5b9a\u306e\u5217\u3060\u3051\u3092\u53d6\u308a\u51fa\u3059\u3068\u3044\u3046\u64cd\u4f5c\u306f\u56f0\u96e3\u3067\u3059\u3002 \u9006\u306b\u5217\u5358\u4f4d\u3067\u30c7\u30fc\u30bf\u3092\u7de8\u6210\u3057\u305f\u5834\u5408\u3001INSERT\u3084UPDATE\u306e\u591a\u3044\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u3057\u3066\u306f\u6975\u7aef\u306b\u4e0d\u5229\u3067\u3059\u304c\u3001\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u30fb\u89e3\u6790\u3092\u884c\u3046\u969b\u306b\u306f\u88ab\u53c2\u7167\u5217\u3060\u3051\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089\u30ed\u30fc\u30c9\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308b\u305f\u3081\u3001I/O\u306e\u5e2f\u57df\u3092\u6700\u5927\u9650\u306b\u6d3b\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u307e\u305f\u30d7\u30ed\u30bb\u30c3\u30b5\u306e\u51e6\u7406\u52b9\u7387\u306e\u89b3\u70b9\u304b\u3089\u3082\u3001\u5217\u5358\u4f4d\u306b\u7de8\u6210\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306f\u5358\u7d14\u306a\u914d\u5217\u3067\u3042\u308b\u304b\u306e\u3088\u3046\u306b\u898b\u3048\u308b\u305f\u3081\u3001GPU\u306b\u3068\u3063\u3066\u306fCoalesced Memory Access\u3068\u3044\u3046\u30e1\u30e2\u30ea\u30d0\u30b9\u306e\u6027\u80fd\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059\u30a2\u30af\u30bb\u30b9\u30d1\u30bf\u30fc\u30f3\u3068\u306a\u308b\u4e8b\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 Apache Arrow\u3068\u306f Apache Arrow\u3068\u306f\u3001\u69cb\u9020\u5316\u30c7\u30fc\u30bf\u3092\u5217\u5f62\u5f0f\u3067\u8a18\u9332\u3001\u4ea4\u63db\u3059\u308b\u305f\u3081\u306e\u30c7\u30fc\u30bf\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u3059\u3002 \u4e3b\u306b\u30d3\u30c3\u30b0\u30c7\u30fc\u30bf\u51e6\u7406\u306e\u305f\u3081\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u307b\u304b\u3001C\u3084C++\u3001Python\u306a\u3069\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u5411\u3051\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u6574\u5099\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u81ea\u4f5c\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089Apache Arrow\u5f62\u5f0f\u3092\u6271\u3046\u3088\u3046\u8a2d\u8a08\u3059\u308b\u4e8b\u3082\u5bb9\u6613\u3067\u3059\u3002 Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u90e8\u306b\u306f\u3001\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u5b9a\u7fa9\u3059\u308b\u30b9\u30ad\u30fc\u30de\uff08Schema\uff09\u90e8\u5206\u3068\u3001\u30b9\u30ad\u30fc\u30de\u306b\u57fa\u3065\u3044\u3066\u5217\u30c7\u30fc\u30bf\u3092\u8a18\u9332\u3059\u308b1\u500b\u4ee5\u4e0a\u306e\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\uff08RecordBatch\uff09\u90e8\u5206\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u578b\u3068\u3057\u3066\u306f\u3001\u6574\u6570\u3084\u6587\u5b57\u5217\uff08\u53ef\u5909\u9577\uff09\u3001\u65e5\u4ed8\u6642\u523b\u578b\u306a\u3069\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u500b\u3005\u306e\u5217\u30c7\u30fc\u30bf\u306f\u3053\u308c\u3089\u30c7\u30fc\u30bf\u578b\u306b\u5fdc\u3058\u305f\u5185\u90e8\u8868\u73fe\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 Apache Arrow\u5f62\u5f0f\u306b\u304a\u3051\u308b\u30c7\u30fc\u30bf\u8868\u73fe\u306f\u3001\u5fc5\u305a\u3057\u3082\u5168\u3066\u306e\u5834\u5408\u3067PostgreSQL\u306e\u30c7\u30fc\u30bf\u8868\u73fe\u3068\u4e00\u81f4\u3057\u3066\u3044\u308b\u8a33\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070\u3001Arrow\u5f62\u5f0f\u3067\u306f\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b\u306e\u30a8\u30dd\u30c3\u30af\u306f 1970-01-01 \u3067\u8907\u6570\u306e\u7cbe\u5ea6\u3092\u6301\u3064\u4e8b\u304c\u3067\u304d\u307e\u3059\u304c\u3001PostgreSQL\u306e\u30a8\u30dd\u30c3\u30af\u306f 2001-01-01 \u3067\u30de\u30a4\u30af\u30ed\u79d2\u306e\u7cbe\u5ea6\u3092\u6301\u3061\u307e\u3059\u3002 Arrow_Fdw\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u7528\u3044\u3066Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092PostgreSQL\u4e0a\u3067\u8aad\u307f\u51fa\u3059\u4e8b\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u5217\u3054\u3068\u306b100\u4e07\u4ef6\u306e\u5217\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\u30928\u500b\u5185\u5305\u3059\u308bArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092Arrow_Fdw\u3092\u7528\u3044\u3066\u30de\u30c3\u30d7\u3057\u305f\u5834\u5408\u3001\u3053\u306e\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u4ecb\u3057\u3066Arrow\u30d5\u30a1\u30a4\u30eb\u4e0a\u306e800\u4e07\u4ef6\u306e\u30c7\u30fc\u30bf\u3078\u30a2\u30af\u30bb\u30b9\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u904b\u7528 \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u5b9a\u7fa9 \u901a\u5e38\u3001\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e3\u30b9\u30c6\u30c3\u30d7\u304c\u5fc5\u8981\u3067\u3059\u3002 CREATE FOREIGN DATA WRAPPER \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u5916\u90e8\u30c7\u30fc\u30bf\u30e9\u30c3\u30d1\u3092\u5b9a\u7fa9\u3059\u308b CREATE SERVER \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u5916\u90e8\u30b5\u30fc\u30d0\u3092\u5b9a\u7fa9\u3059\u308b CREATE FOREIGN TABLE \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u5b9a\u7fa9\u3059\u308b \u3053\u306e\u3046\u3061\u3001\u6700\u521d\u306e2\u30b9\u30c6\u30c3\u30d7\u306f CREATE EXTENSION pg_strom \u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u306b\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u500b\u5225\u306b\u5b9f\u884c\u304c\u5fc5\u8981\u306a\u306e\u306f\u6700\u5f8c\u306e CREATE FOREIGN TABLE \u306e\u307f\u3067\u3059\u3002 CREATE FOREIGN TABLE flogdata ( ts timestamp, sensor_id int, signal1 smallint, signal2 smallint, signal3 smallint, signal4 smallint, ) SERVER arrow_fdw OPTIONS (file '/path/to/logdata.arrow'); CREATE FOREIGN TABLE \u69cb\u6587\u3067\u6307\u5b9a\u3057\u305f\u5217\u306e\u30c7\u30fc\u30bf\u578b\u306f\u3001\u30de\u30c3\u30d7\u3059\u308bArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3068\u53b3\u5bc6\u306b\u4e00\u81f4\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u308c\u4ee5\u5916\u306b\u3082\u3001Arrow_Fdw\u306f IMPORT FOREIGN SCHEMA \u69cb\u6587\u3092\u7528\u3044\u305f\u4fbf\u5229\u306a\u65b9\u6cd5\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u6301\u3064\u30b9\u30ad\u30fc\u30de\u60c5\u5831\u3092\u5229\u7528\u3057\u3066\u3001\u81ea\u52d5\u7684\u306b\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9\u3092\u751f\u6210\u3059\u308b\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u540d\u3068\u30a4\u30f3\u30dd\u30fc\u30c8\u5148\u306e\u30b9\u30ad\u30fc\u30de\u3001\u304a\u3088\u3073OPTION\u53e5\u3067Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u306b\u306f\u3001\u5217\u3054\u3068\u306e\u30c7\u30fc\u30bf\u578b\u3068\u5217\u540d\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\uff09\u304c\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u3053\u308c\u3092\u7528\u3044\u3066\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u5b9a\u7fa9\u3092\u884c\u3044\u307e\u3059\u3002 IMPORT FOREIGN SCHEMA flogdata FROM SERVER arrow_fdw INTO public OPTIONS (file '/path/to/logdata.arrow'); \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u30aa\u30d7\u30b7\u30e7\u30f3 Arrow_Fdw\u306f\u4ee5\u4e0b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002\u73fe\u72b6\u3001\u5168\u3066\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u6307\u5b9a\u3059\u308b\u3082\u306e\u3067\u3059\u3002 file=PATHNAME \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3059\u308bArrow\u30d5\u30a1\u30a4\u30eb\u30921\u500b\u6307\u5b9a\u3057\u307e\u3059\u3002 files=PATHNAME1[,PATHNAME2...] \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3059\u308bArrow\u30d5\u30a1\u30a4\u30eb\u3092\u30ab\u30f3\u30de(,\uff09\u533a\u5207\u308a\u3067\u8907\u6570\u6307\u5b9a\u3057\u307e\u3059\u3002 dir=DIRNAME \u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u5168\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3057\u307e\u3059\u3002 suffix=SUFFIX dir \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u6307\u5b9a\u6642\u3001\u4f8b\u3048\u3070 .arrow \u306a\u3069\u3001\u7279\u5b9a\u306e\u63a5\u5c3e\u53e5\u3092\u6301\u3064\u30d5\u30a1\u30a4\u30eb\u3060\u3051\u3092\u30de\u30c3\u30d7\u3057\u307e\u3059\u3002 parallel_workers=N_WORKERS \u3053\u306e\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u4e26\u5217\u30b9\u30ad\u30e3\u30f3\u306b\u4f7f\u7528\u3059\u308b\u4e26\u5217\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306e\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u4e00\u822c\u7684\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u304a\u3051\u308b parallel_workers \u30b9\u30c8\u30ec\u30fc\u30b8\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u540c\u7b49\u306e\u610f\u5473\u3092\u6301\u3061\u307e\u3059\u3002 writable=(true|false) \u3053\u306e\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b INSERT \u6587\u306e\u5b9f\u884c\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002\u8a73\u7d30\u306f\u300e\u66f8\u304d\u8fbc\u307f\u53ef\u80fdArrow_Fdw\u300f\u306e\u7bc0\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc Arrow\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u578b\u3068\u3001PostgreSQL\u306e\u30c7\u30fc\u30bf\u578b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 Int bitWidth \u5c5e\u6027\u306e\u5024\u306b\u5fdc\u3058\u3066\u3001\u305d\u308c\u305e\u308c int1 \u3001 int2 \u3001 int4 \u3001 int8 \u306e\u3044\u305a\u308c\u304b\u306b\u5bfe\u5fdc\u3002 is_signed \u5c5e\u6027\u306e\u5024\u306f\u7121\u8996\u3055\u308c\u307e\u3059\u3002 int1 \u306fPG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 FloatingPoint precision \u5c5e\u6027\u306e\u5024\u306b\u5fdc\u3058\u3066\u3001\u305d\u308c\u305e\u308c float2 \u3001 float4 \u3001 float8 \u306e\u3044\u305a\u308c\u304b\u306b\u5bfe\u5fdc\u3002 float2 \u306fPG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 Binary bytea \u578b\u306b\u5bfe\u5fdc Decimal numeric \u578b\u306b\u5bfe\u5fdc Date date \u578b\u306b\u5bfe\u5fdc\u3002 unit=Day \u76f8\u5f53\u3068\u306a\u308b\u3088\u3046\u306b\u88dc\u6b63\u3055\u308c\u308b\u3002 Time time \u578b\u306b\u5bfe\u5fdc\u3002 unit=MicroSecond \u76f8\u5f53\u306b\u306a\u308b\u3088\u3046\u306b\u88dc\u6b63\u3055\u308c\u308b\u3002 Timestamp timestamp \u578b\u306b\u5bfe\u5fdc\u3002 unit=MicroSecond \u76f8\u5f53\u306b\u306a\u308b\u3088\u3046\u306b\u88dc\u6b63\u3055\u308c\u308b\u3002 Interval interval \u578b\u306b\u5bfe\u5fdc List \u8981\u7d20\u578b\u306e1\u6b21\u5143\u914d\u5217\u578b\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u308b\u3002 Struct \u8907\u5408\u578b\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u308b\u3002\u5bfe\u5fdc\u3059\u308b\u8907\u5408\u578b\u306f\u4e88\u3081\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002 FixedSizeBinary byteWidth \u5c5e\u6027\u306e\u5024\u306b\u5fdc\u3058\u3066 char(n) \u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u308b\u3002 \u30e1\u30bf\u30c7\u30fc\u30bf pg_type=TYPENAME \u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u8a72\u5f53\u3059\u308b\u30c7\u30fc\u30bf\u578b\u3092\u5272\u308a\u5f53\u3066\u308b\u5834\u5408\u304c\u3042\u308b\u3002\u73fe\u6642\u70b9\u3067\u306f\u3001 inet \u304a\u3088\u3073 macaddr \u578b\u3002 Union \u3001 Map \u3001 Duration \u3001 LargeBinary \u3001 LargeUtf8 \u3001 LargeList \u73fe\u6642\u70b9\u3067\u306fPostgreSQL\u30c7\u30fc\u30bf\u578b\u3078\u306e\u5bfe\u5fdc\u306f\u306a\u3057\u3002 EXPLAIN\u51fa\u529b\u306e\u8aad\u307f\u65b9 EXPLAIN \u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u3066\u3001Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u51fa\u3057\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u7d04503GB\u306e\u5927\u304d\u3055\u3092\u6301\u3064Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u30de\u30c3\u30d7\u3057\u305ff_lineorder\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u542b\u3080\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u306e\u51fa\u529b\u3067\u3059\u3002 =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) -> Custom Scan (GpuPreAgg) on f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..78.95 rows=365 width=4) Filter: (d_year = 1993) (12 rows) \u3053\u308c\u3092\u898b\u308b\u3068Custom Scan (GpuPreAgg)\u304c f_lineorder \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3066\u3044\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 file0 \u306b\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u80cc\u5f8c\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u540d /opt/nvme/f_lineorder_s999.arrow \u3068\u305d\u306e\u30b5\u30a4\u30ba\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u30de\u30c3\u30d7\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306b\u306f\u3001 file1 \u3001 file2 \u3001... \u3068\u5404\u30d5\u30a1\u30a4\u30eb\u6bce\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002 referenced \u306b\u306f\u5b9f\u969b\u306b\u53c2\u7167\u3055\u308c\u3066\u3044\u308b\u5217\u306e\u4e00\u89a7\u304c\u5217\u6319\u3055\u308c\u3066\u304a\u308a\u3001\u3053\u306e\u30af\u30a8\u30ea\u306b\u304a\u3044\u3066\u306f lo_orderdate \u3001 lo_quantity \u3001 lo_extendedprice \u304a\u3088\u3073 lo_discount \u5217\u304c\u53c2\u7167\u3055\u308c\u3066\u3044\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 \u307e\u305f\u3001 GPU-Direct SQL: enabled (GPU-0) \u306e\u8868\u793a\u304c\u3042\u308b\u4e8b\u304b\u3089\u3001 f_lineorder \u306e\u30b9\u30ad\u30e3\u30f3\u306b\u306fGPU-Direct SQL\u6a5f\u69cb\u304c\u7528\u3044\u3089\u308c\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002 VERBOSE\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u4e0e\u3059\u308b\u4e8b\u3067\u3001\u3088\u308a\u8a73\u7d30\u306a\u60c5\u5831\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002 =# EXPLAIN VERBOSE SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) Output: pgstrom.sum_int((pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint))) -> Custom Scan (GpuPreAgg) on public.f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) Output: (pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint)) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) lo_orderdate: 22.35GB lo_quantity: 22.35GB lo_extendedprice: 22.35GB lo_discount: 22.35GB GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , , , KVecs-Buffer: nbytes: 51200, ndims: 3, items=[kvec0=<0x0000-27ff, type='int4', expr='lo_discount'>, kvec1=<0x2800-4fff, type='int4', expr='lo_quantity'>, kvec2=<0x5000-77ff, type='int4', expr='lo_extendedprice'>, kvec3=<0x7800-9fff, type='int4', expr='lo_orderdate'>, kvec4=<0xa000-c7ff, type='int4', expr='d_datekey'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, , , ]}, items[1]={LoadVars(depth=1): kvars=[]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, , ]}}, items[1]={MoveVars(depth=1): items=[, ]}}} Scan Quals OpCode: {Bool::AND args=[{Func(bool)::int4ge args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='1'}]}, {Func(bool)::int4le args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='3'}]}, {Func(bool)::int4lt args=[{Var(int4): slot=1, expr='lo_quantity'}, {Const(int4): value='25'}]}]} Join Quals OpCode: {Packed items[1]={JoinQuals: {Func(bool)::int4eq args=[{Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}, {Var(int4): slot=5, expr='d_datekey'}]}}} Join HashValue OpCode: {Packed items[1]={HashValue arg={Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}}} Partial Aggregation OpCode: {AggFuncs arg={SaveExpr: arg={Func(int8)::int8 arg={Func(int4)::int4mul args=[{Var(int4): kvec=0x5000-7800, expr='lo_extendedprice'}, {Var(int4): kvec=0x0000-2800, expr='lo_discount'}]}}}} Partial Function BufSz: 16 -> Seq Scan on public.date1 (cost=0.00..78.95 rows=365 width=4) Output: date1.d_datekey Filter: (date1.d_year = 1993) (28 rows) \u88ab\u53c2\u7167\u5217\u3092\u30ed\u30fc\u30c9\u3059\u308b\u969b\u306b\u8aad\u307f\u51fa\u3059\u3079\u304d\u5217\u30c7\u30fc\u30bf\u306e\u5927\u304d\u3055\u3092\u3001\u5217\u3054\u3068\u306b\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002 lo_orderdate \u3001 lo_quantity \u3001 lo_extendedprice \u304a\u3088\u3073 lo_discount \u5217\u306e\u30ed\u30fc\u30c9\u306b\u306f\u5408\u8a08\u306789.41GB\u306e\u8aad\u307f\u51fa\u3057\u304c\u5fc5\u8981\u3067\u3001\u3053\u308c\u306f\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba502.93GB\u306e17.8%\u306b\u76f8\u5f53\u3057\u307e\u3059\u3002 Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u65b9\u6cd5 \u672c\u7bc0\u3067\u306f\u3001\u65e2\u306bPostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u3092Apache Arrow\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002 PyArrow+Pandas Arrow\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u304c\u958b\u767a\u3092\u884c\u3063\u3066\u3044\u308b PyArrow \u30e2\u30b8\u30e5\u30fc\u30eb\u3068Pandas\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306e\u7d44\u5408\u305b\u3092\u7528\u3044\u3066\u3001PostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5185\u5bb9\u3092Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u3068\u66f8\u304d\u51fa\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u30c6\u30fc\u30d6\u30ebt0\u306b\u683c\u7d0d\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u5168\u3066\u8aad\u8fbc\u307f\u3001\u30d5\u30a1\u30a4\u30eb/tmp/t0.arrow\u3078\u3068\u66f8\u304d\u51fa\u3059\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002 import pyarrow as pa import pandas as pd X = pd.read_sql(sql=\"SELECT * FROM t0\", con=\"postgresql://localhost/postgres\") Y = pa.Table.from_pandas(X) f = pa.RecordBatchFileWriter('/tmp/t0.arrow', Y.schema) f.write_table(Y,1000000) # RecordBatch for each million rows f.close() \u305f\u3060\u3057\u4e0a\u8a18\u306e\u65b9\u6cd5\u306f\u3001SQL\u3092\u4ecb\u3057\u3066PostgreSQL\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5185\u5bb9\u3092\u4e00\u5ea6\u30e1\u30e2\u30ea\u306b\u4fdd\u6301\u3059\u308b\u305f\u3081\u3001\u5927\u91cf\u306e\u884c\u3092\u4e00\u5ea6\u306b\u5909\u63db\u3059\u308b\u5834\u5408\u306b\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002 Pg2Arrow \u4e00\u65b9\u3001PG-Strom Development Team\u304c\u958b\u767a\u3092\u884c\u3063\u3066\u3044\u308b pg2arrow \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001PostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5185\u5bb9\u3092Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u3068\u66f8\u304d\u51fa\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u3053\u306e\u30c4\u30fc\u30eb\u306f\u6bd4\u8f03\u7684\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092NVME-SSD\u306a\u3069\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u66f8\u304d\u51fa\u3059\u4e8b\u3092\u5ff5\u982d\u306b\u8a2d\u8a08\u3055\u308c\u3066\u304a\u308a\u3001PostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089 -s|--segment-size \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u305f\u30b5\u30a4\u30ba\u306e\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3059\u305f\u3073\u306b\u3001Arrow\u5f62\u5f0f\u306e\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\uff08Record Batch\uff09\u3068\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30e1\u30e2\u30ea\u6d88\u8cbb\u91cf\u306f\u6bd4\u8f03\u7684\u30ea\u30fc\u30ba\u30ca\u30d6\u30eb\u306a\u5024\u3068\u306a\u308a\u307e\u3059\u3002 pg2arrow \u30b3\u30de\u30f3\u30c9\u306fPG-Strom\u306b\u540c\u68b1\u3055\u308c\u3066\u304a\u308a\u3001PostgreSQL\u95a2\u9023\u30b3\u30de\u30f3\u30c9\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002 $ pg2arrow --help Usage: pg2arrow [OPTION] [database] [username] General options: -d, --dbname=DBNAME Database name to connect to -c, --command=COMMAND SQL command to run -t, --table=TABLENAME Equivalent to '-c SELECT * FROM TABLENAME' (-c and -t are exclusive, either of them must be given) --inner-join=SUB_COMMAND --outer-join=SUB_COMMAND -o, --output=FILENAME result file in Apache Arrow format --append=FILENAME result Apache Arrow file to be appended (--output and --append are exclusive. If neither of them are given, it creates a temporary file.) -S, --stat[=COLUMNS] embeds min/max statistics for each record batch COLUMNS is a comma-separated list of the target columns if partially enabled. Arrow format options: -s, --segment-size=SIZE size of record batch for each Connection options: -h, --host=HOSTNAME database server host -p, --port=PORT database server port -u, --user=USERNAME database user name -w, --no-password never prompt for password -W, --password force password prompt Other options: --dump=FILENAME dump information of arrow file --progress shows progress of the job --set=NAME:VALUE config option to set before SQL execution --help shows this message Report bugs to . PostgreSQL\u3078\u306e\u63a5\u7d9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306fpsql\u3084pg_dump\u3068\u540c\u69d8\u306b\u3001 -h \u3084 -U \u306a\u3069\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002 \u57fa\u672c\u7684\u306a\u30b3\u30de\u30f3\u30c9\u306e\u4f7f\u7528\u65b9\u6cd5\u306f\u3001 -c|--command \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u305fSQL\u3092PostgreSQL\u4e0a\u3067\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092 -o|--output \u3067\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3078Arrow\u5f62\u5f0f\u3067\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002 -o|--output \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u4ee3\u308f\u308a\u306b --append \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u3053\u308c\u306f\u65e2\u5b58\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u8ffd\u8a18\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u8ffd\u8a18\u3055\u308c\u308bApache Arrow\u30d5\u30a1\u30a4\u30eb\u306f\u6307\u5b9a\u3057\u305fSQL\u306e\u5b9f\u884c\u7d50\u679c\u3068\u5b8c\u5168\u306b\u4e00\u81f4\u3059\u308b\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u6301\u305f\u306d\u3070\u306a\u308a\u307e\u305b\u3093\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u30c6\u30fc\u30d6\u30eb t0 \u306b\u683c\u7d0d\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u5168\u3066\u8aad\u8fbc\u307f\u3001\u30d5\u30a1\u30a4\u30eb /tmp/t0.arrow \u3078\u3068\u66f8\u304d\u51fa\u3059\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002 $ pg2arrow -U kaigai -d postgres -c \"SELECT * FROM t0\" -o /tmp/t0.arrow \u958b\u767a\u8005\u5411\u3051\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u304c\u3001 --dump \u3067Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3084\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\u306e\u4f4d\u7f6e\u3068\u30b5\u30a4\u30ba\u3092\u53ef\u8aad\u306a\u5f62\u5f0f\u3067\u51fa\u529b\u3059\u308b\u4e8b\u3082\u3067\u304d\u307e\u3059\u3002 --progress \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u51e6\u7406\u306e\u9014\u4e2d\u7d4c\u904e\u3092\u8868\u793a\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002\u3053\u308c\u306f\u5de8\u5927\u306a\u30c6\u30fc\u30d6\u30eb\u3092Apache Arrow\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u969b\u306b\u6709\u7528\u3067\u3059\u3002 \u5148\u9032\u7684\u306a\u4f7f\u3044\u65b9 SSDtoGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3055\u308c\u305f\u5168\u3066\u306eArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u304c\u4ee5\u4e0b\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u5834\u5408\u306b\u306f\u3001\u5217\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u51fa\u3057\u306bSSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u304cNVME-SSD\u533a\u753b\u4e0a\u306b\u7f6e\u304b\u308c\u3066\u3044\u308b\u3002 NVME-SSD\u533a\u753b\u306fExt4\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3067\u69cb\u7bc9\u3055\u308c\u3066\u3044\u308b\u3002 Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u7dcf\u8a08\u304c pg_strom.nvme_strom_threshold \u8a2d\u5b9a\u3092\u4e0a\u56de\u3063\u3066\u3044\u308b\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u8a2d\u5b9a Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u4e00\u90e8\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u901a\u5e38\u306ePostgreSQL\u30c6\u30fc\u30d6\u30eb\u3068\u6df7\u5728\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306f\u66f8\u304d\u8fbc\u307f\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u4e8b\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u307e\u305f\u3001\u30de\u30c3\u30d7\u3055\u308c\u305fArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306b\u542b\u307e\u308c\u308b\u30c7\u30fc\u30bf\u306f\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5883\u754c\u6761\u4ef6\u3068\u77db\u76fe\u3057\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u8005\u306e\u8cac\u4efb\u3067\u3059\u3002 \u5178\u578b\u7684\u306a\u5229\u7528\u30b7\u30fc\u30f3\u306f\u3001\u9577\u671f\u9593\u306b\u308f\u305f\u308a\u84c4\u7a4d\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u51e6\u7406\u3067\u3059\u3002 \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u3068\u7570\u306a\u308a\u3001\u4e00\u822c\u7684\u306b\u30ed\u30b0\u30c7\u30fc\u30bf\u306f\u4e00\u5ea6\u8a18\u9332\u3055\u308c\u305f\u3089\u305d\u306e\u5f8c\u66f4\u65b0\u524a\u9664\u3055\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u3057\u305f\u304c\u3063\u3066\u3001\u4e00\u5b9a\u671f\u9593\u304c\u7d4c\u904e\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306f\u3001\u8aad\u307f\u51fa\u3057\u5c02\u7528\u3067\u306f\u3042\u308b\u3082\u306e\u306e\u96c6\u8a08\u51e6\u7406\u304c\u9ad8\u901f\u306aArrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u79fb\u3057\u66ff\u3048\u308b\u3053\u3068\u3067\u3001\u96c6\u8a08\u30fb\u89e3\u6790\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u51e6\u7406\u52b9\u7387\u3092\u5f15\u304d\u4e0a\u3052\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u30ed\u30b0\u30c7\u30fc\u30bf\u306b\u306f\u307b\u307c\u9593\u9055\u3044\u306a\u304f\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u304c\u4ed8\u4e0e\u3055\u308c\u3066\u3044\u308b\u4e8b\u304b\u3089\u3001\u6708\u5358\u4f4d\u3001\u9031\u5358\u4f4d\u306a\u3069\u3001\u4e00\u5b9a\u671f\u9593\u3054\u3068\u306b\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u8ffd\u52a0\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001PostgreSQL\u30c6\u30fc\u30d6\u30eb\u3068Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u6df7\u5728\u3055\u305b\u305f\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3092\u5b9a\u7fa9\u3057\u305f\u3082\u306e\u3067\u3059\u3002 \u66f8\u304d\u8fbc\u307f\u304c\u53ef\u80fd\u306aPostgreSQL\u30c6\u30fc\u30d6\u30eb\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3068\u3057\u3066\u6307\u5b9a\u3057\u3066\u304a\u304f\u4e8b\u3067\u3001\u4e00\u5b9a\u671f\u9593\u306e\u7d4c\u904e\u5f8c\u3001DB\u904b\u7528\u3092\u7d99\u7d9a\u3057\u306a\u304c\u3089\u904e\u53bb\u306e\u30ed\u30b0\u30c7\u30fc\u30bf\u3060\u3051\u3092Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3078\u79fb\u3059\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 CREATE TABLE lineorder ( lo_orderkey numeric, lo_linenumber integer, lo_custkey numeric, lo_partkey integer, lo_suppkey numeric, lo_orderdate integer, lo_orderpriority character(15), lo_shippriority character(1), lo_quantity numeric, lo_extendedprice numeric, lo_ordertotalprice numeric, lo_discount numeric, lo_revenue numeric, lo_supplycost numeric, lo_tax numeric, lo_commit_date character(8), lo_shipmode character(10) ) PARTITION BY RANGE (lo_orderdate); CREATE TABLE lineorder__now PARTITION OF lineorder default; CREATE FOREIGN TABLE lineorder__1993 PARTITION OF lineorder FOR VALUES FROM (19930101) TO (19940101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1993.arrow'); CREATE FOREIGN TABLE lineorder__1994 PARTITION OF lineorder FOR VALUES FROM (19940101) TO (19950101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1994.arrow'); CREATE FOREIGN TABLE lineorder__1995 PARTITION OF lineorder FOR VALUES FROM (19950101) TO (19960101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1995.arrow'); CREATE FOREIGN TABLE lineorder__1996 PARTITION OF lineorder FOR VALUES FROM (19960101) TO (19970101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1996.arrow'); \u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b\u554f\u3044\u5408\u308f\u305b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u691c\u7d22\u6761\u4ef6 lo_orderdate between 19950701 and 19960630 \u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5883\u754c\u6761\u4ef6\u3092\u542b\u3093\u3067\u3044\u308b\u4e8b\u304b\u3089\u3001\u5b50\u30c6\u30fc\u30d6\u30eb lineorder__1993 \u3068 lineorder__1994 \u306f\u691c\u7d22\u5bfe\u8c61\u304b\u3089\u6392\u9664\u3055\u308c\u3001\u4ed6\u306e\u30c6\u30fc\u30d6\u30eb\u3060\u3051\u3092\u8aad\u307f\u51fa\u3059\u3088\u3046\u5b9f\u884c\u8a08\u753b\u304c\u4f5c\u3089\u308c\u3066\u3044\u307e\u3059\u3002 =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM lineorder,date1 WHERE lo_orderdate = d_datekey AND lo_orderdate between 19950701 and 19960630 AND lo_discount between 1 and 3 ABD lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=172088.90..172088.91 rows=1 width=32) -> Hash Join (cost=10548.86..172088.51 rows=77 width=64) Hash Cond: (lineorder__1995.lo_orderdate = date1.d_datekey) -> Append (cost=10444.35..171983.80 rows=77 width=67) -> Custom Scan (GpuScan) on lineorder__1995 (cost=10444.35..33671.87 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1995.arrow (size: 892.57MB) -> Custom Scan (GpuScan) on lineorder__1996 (cost=10444.62..33849.21 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1996.arrow (size: 897.87MB) -> Custom Scan (GpuScan) on lineorder__now (cost=11561.33..104462.33 rows=1 width=18) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash (cost=72.56..72.56 rows=2556 width=4) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=4) (16 rows) \u3053\u306e\u5f8c\u3001 lineorder__now \u30c6\u30fc\u30d6\u30eb\u304b\u30891997\u5e74\u306e\u30c7\u30fc\u30bf\u3092\u629c\u304d\u51fa\u3057\u3001\u3053\u308c\u3092Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u5074\u306b\u79fb\u3059\u306b\u306f\u4ee5\u4e0b\u306e\u64cd\u4f5c\u3092\u884c\u3044\u307e\u3059 $ pg2arrow -d sample -o /opt/tmp/lineorder_1997.arrow \\ -c \"SELECT * FROM lineorder WHERE lo_orderdate between 19970101 and 19971231\" pg2arrow \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u3001 lineorder \u30c6\u30fc\u30d6\u30eb\u304b\u30891997\u5e74\u306e\u30c7\u30fc\u30bf\u3060\u3051\u3092\u629c\u304d\u51fa\u3057\u3066\u3001\u65b0\u3057\u3044Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002 BEGIN; -- -- remove rows in 1997 from the read-writable table -- DELETE FROM lineorder WHERE lo_orderdate BETWEEN 19970101 AND 19971231; -- -- define a new partition leaf which maps log-data in 1997 -- CREATE FOREIGN TABLE lineorder__1997 PARTITION OF lineorder FOR VALUES FROM (19970101) TO (19980101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1997.arrow'); COMMIT; \u3053\u306e\u64cd\u4f5c\u306b\u3088\u308a\u3001PostgreSQL\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b lineorder__now \u304b\u30891997\u5e74\u306e\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3057\u3001\u4ee3\u308f\u308a\u306b\u540c\u4e00\u5185\u5bb9\u306eArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb /opt/tmp/lineorder_1997.arrow \u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb lineorder__1997 \u3068\u3057\u3066\u30de\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002 \u6b63\u78ba\u306b\u306f\u30014KB\uff5e32KB\u306e\u7bc4\u56f2\u3067\u30d3\u30eb\u30c9\u6642\u306b\u6307\u5b9a\u3067\u304d\u307e\u3059 \u21a9","title":"Apache Arrow"},{"location":"arrow_fdw/#apache-arrow","text":"","title":"Apache Arrow (\u5217\u6307\u5411\u30c7\u30fc\u30bf\u30b9\u30c8\u30a2)"},{"location":"arrow_fdw/#_1","text":"PostgreSQL\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u5185\u90e8\u7684\u306b8KB\u306e\u30d6\u30ed\u30c3\u30af 1 \u3068\u547c\u3070\u308c\u308b\u5358\u4f4d\u3067\u7de8\u6210\u3055\u308c\u3001\u30d6\u30ed\u30c3\u30af\u306f\u5168\u3066\u306e\u5c5e\u6027\u53ca\u3073\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u542b\u3080\u30bf\u30d7\u30eb\u3068\u547c\u3070\u308c\u308b\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u884c\u5358\u4f4d\u3067\u683c\u7d0d\u3057\u307e\u3059\u3002\u884c\u3092\u69cb\u6210\u3059\u308b\u30c7\u30fc\u30bf\u304c\u8fd1\u508d\u306b\u5b58\u5728\u3059\u308b\u305f\u3081\u3001\u3053\u308c\u306fINSERT\u3084UPDATE\u306e\u591a\u3044\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u6709\u52b9\u3067\u3059\u304c\u3001\u4e00\u65b9\u3067\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u30fb\u89e3\u6790\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u306f\u4e0d\u5411\u304d\u3067\u3042\u308b\u3068\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u901a\u5e38\u3001\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u306b\u304a\u3044\u3066\u306f\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u5168\u3066\u306e\u5217\u3092\u53c2\u7167\u3059\u308b\u4e8b\u306f\u73cd\u3057\u304f\u3001\u591a\u304f\u306e\u5834\u5408\u306b\u306f\u4e00\u90e8\u306e\u5217\u3060\u3051\u3092\u53c2\u7167\u3059\u308b\u3068\u3044\u3063\u305f\u51e6\u7406\u306b\u306a\u308a\u304c\u3061\u3067\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u5b9f\u969b\u306b\u306f\u53c2\u7167\u3055\u308c\u306a\u3044\u5217\u306e\u30c7\u30fc\u30bf\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u6d88\u8cbb\u3055\u308c\u308bI/O\u306e\u5e2f\u57df\u306f\u5168\u304f\u7121\u99c4\u3067\u3059\u304c\u3001\u884c\u5358\u4f4d\u3067\u7de8\u6210\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u7279\u5b9a\u306e\u5217\u3060\u3051\u3092\u53d6\u308a\u51fa\u3059\u3068\u3044\u3046\u64cd\u4f5c\u306f\u56f0\u96e3\u3067\u3059\u3002 \u9006\u306b\u5217\u5358\u4f4d\u3067\u30c7\u30fc\u30bf\u3092\u7de8\u6210\u3057\u305f\u5834\u5408\u3001INSERT\u3084UPDATE\u306e\u591a\u3044\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u3057\u3066\u306f\u6975\u7aef\u306b\u4e0d\u5229\u3067\u3059\u304c\u3001\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\u30fb\u89e3\u6790\u3092\u884c\u3046\u969b\u306b\u306f\u88ab\u53c2\u7167\u5217\u3060\u3051\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089\u30ed\u30fc\u30c9\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308b\u305f\u3081\u3001I/O\u306e\u5e2f\u57df\u3092\u6700\u5927\u9650\u306b\u6d3b\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u307e\u305f\u30d7\u30ed\u30bb\u30c3\u30b5\u306e\u51e6\u7406\u52b9\u7387\u306e\u89b3\u70b9\u304b\u3089\u3082\u3001\u5217\u5358\u4f4d\u306b\u7de8\u6210\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306f\u5358\u7d14\u306a\u914d\u5217\u3067\u3042\u308b\u304b\u306e\u3088\u3046\u306b\u898b\u3048\u308b\u305f\u3081\u3001GPU\u306b\u3068\u3063\u3066\u306fCoalesced Memory Access\u3068\u3044\u3046\u30e1\u30e2\u30ea\u30d0\u30b9\u306e\u6027\u80fd\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059\u30a2\u30af\u30bb\u30b9\u30d1\u30bf\u30fc\u30f3\u3068\u306a\u308b\u4e8b\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002","title":"\u6982\u8981"},{"location":"arrow_fdw/#apache-arrow_1","text":"Apache Arrow\u3068\u306f\u3001\u69cb\u9020\u5316\u30c7\u30fc\u30bf\u3092\u5217\u5f62\u5f0f\u3067\u8a18\u9332\u3001\u4ea4\u63db\u3059\u308b\u305f\u3081\u306e\u30c7\u30fc\u30bf\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u3059\u3002 \u4e3b\u306b\u30d3\u30c3\u30b0\u30c7\u30fc\u30bf\u51e6\u7406\u306e\u305f\u3081\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u307b\u304b\u3001C\u3084C++\u3001Python\u306a\u3069\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u5411\u3051\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u6574\u5099\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u81ea\u4f5c\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089Apache Arrow\u5f62\u5f0f\u3092\u6271\u3046\u3088\u3046\u8a2d\u8a08\u3059\u308b\u4e8b\u3082\u5bb9\u6613\u3067\u3059\u3002 Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u90e8\u306b\u306f\u3001\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u5b9a\u7fa9\u3059\u308b\u30b9\u30ad\u30fc\u30de\uff08Schema\uff09\u90e8\u5206\u3068\u3001\u30b9\u30ad\u30fc\u30de\u306b\u57fa\u3065\u3044\u3066\u5217\u30c7\u30fc\u30bf\u3092\u8a18\u9332\u3059\u308b1\u500b\u4ee5\u4e0a\u306e\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\uff08RecordBatch\uff09\u90e8\u5206\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u578b\u3068\u3057\u3066\u306f\u3001\u6574\u6570\u3084\u6587\u5b57\u5217\uff08\u53ef\u5909\u9577\uff09\u3001\u65e5\u4ed8\u6642\u523b\u578b\u306a\u3069\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u500b\u3005\u306e\u5217\u30c7\u30fc\u30bf\u306f\u3053\u308c\u3089\u30c7\u30fc\u30bf\u578b\u306b\u5fdc\u3058\u305f\u5185\u90e8\u8868\u73fe\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 Apache Arrow\u5f62\u5f0f\u306b\u304a\u3051\u308b\u30c7\u30fc\u30bf\u8868\u73fe\u306f\u3001\u5fc5\u305a\u3057\u3082\u5168\u3066\u306e\u5834\u5408\u3067PostgreSQL\u306e\u30c7\u30fc\u30bf\u8868\u73fe\u3068\u4e00\u81f4\u3057\u3066\u3044\u308b\u8a33\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070\u3001Arrow\u5f62\u5f0f\u3067\u306f\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b\u306e\u30a8\u30dd\u30c3\u30af\u306f 1970-01-01 \u3067\u8907\u6570\u306e\u7cbe\u5ea6\u3092\u6301\u3064\u4e8b\u304c\u3067\u304d\u307e\u3059\u304c\u3001PostgreSQL\u306e\u30a8\u30dd\u30c3\u30af\u306f 2001-01-01 \u3067\u30de\u30a4\u30af\u30ed\u79d2\u306e\u7cbe\u5ea6\u3092\u6301\u3061\u307e\u3059\u3002 Arrow_Fdw\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u7528\u3044\u3066Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092PostgreSQL\u4e0a\u3067\u8aad\u307f\u51fa\u3059\u4e8b\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u5217\u3054\u3068\u306b100\u4e07\u4ef6\u306e\u5217\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\u30928\u500b\u5185\u5305\u3059\u308bArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092Arrow_Fdw\u3092\u7528\u3044\u3066\u30de\u30c3\u30d7\u3057\u305f\u5834\u5408\u3001\u3053\u306e\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u4ecb\u3057\u3066Arrow\u30d5\u30a1\u30a4\u30eb\u4e0a\u306e800\u4e07\u4ef6\u306e\u30c7\u30fc\u30bf\u3078\u30a2\u30af\u30bb\u30b9\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002","title":"Apache Arrow\u3068\u306f"},{"location":"arrow_fdw/#_2","text":"","title":"\u904b\u7528"},{"location":"arrow_fdw/#_3","text":"\u901a\u5e38\u3001\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e3\u30b9\u30c6\u30c3\u30d7\u304c\u5fc5\u8981\u3067\u3059\u3002 CREATE FOREIGN DATA WRAPPER \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u5916\u90e8\u30c7\u30fc\u30bf\u30e9\u30c3\u30d1\u3092\u5b9a\u7fa9\u3059\u308b CREATE SERVER \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u5916\u90e8\u30b5\u30fc\u30d0\u3092\u5b9a\u7fa9\u3059\u308b CREATE FOREIGN TABLE \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u5b9a\u7fa9\u3059\u308b \u3053\u306e\u3046\u3061\u3001\u6700\u521d\u306e2\u30b9\u30c6\u30c3\u30d7\u306f CREATE EXTENSION pg_strom \u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u306b\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u500b\u5225\u306b\u5b9f\u884c\u304c\u5fc5\u8981\u306a\u306e\u306f\u6700\u5f8c\u306e CREATE FOREIGN TABLE \u306e\u307f\u3067\u3059\u3002 CREATE FOREIGN TABLE flogdata ( ts timestamp, sensor_id int, signal1 smallint, signal2 smallint, signal3 smallint, signal4 smallint, ) SERVER arrow_fdw OPTIONS (file '/path/to/logdata.arrow'); CREATE FOREIGN TABLE \u69cb\u6587\u3067\u6307\u5b9a\u3057\u305f\u5217\u306e\u30c7\u30fc\u30bf\u578b\u306f\u3001\u30de\u30c3\u30d7\u3059\u308bArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3068\u53b3\u5bc6\u306b\u4e00\u81f4\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u308c\u4ee5\u5916\u306b\u3082\u3001Arrow_Fdw\u306f IMPORT FOREIGN SCHEMA \u69cb\u6587\u3092\u7528\u3044\u305f\u4fbf\u5229\u306a\u65b9\u6cd5\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u6301\u3064\u30b9\u30ad\u30fc\u30de\u60c5\u5831\u3092\u5229\u7528\u3057\u3066\u3001\u81ea\u52d5\u7684\u306b\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9\u3092\u751f\u6210\u3059\u308b\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u540d\u3068\u30a4\u30f3\u30dd\u30fc\u30c8\u5148\u306e\u30b9\u30ad\u30fc\u30de\u3001\u304a\u3088\u3073OPTION\u53e5\u3067Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u306b\u306f\u3001\u5217\u3054\u3068\u306e\u30c7\u30fc\u30bf\u578b\u3068\u5217\u540d\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\uff09\u304c\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u3053\u308c\u3092\u7528\u3044\u3066\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u5b9a\u7fa9\u3092\u884c\u3044\u307e\u3059\u3002 IMPORT FOREIGN SCHEMA flogdata FROM SERVER arrow_fdw INTO public OPTIONS (file '/path/to/logdata.arrow');","title":"\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u5b9a\u7fa9"},{"location":"arrow_fdw/#_4","text":"Arrow_Fdw\u306f\u4ee5\u4e0b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002\u73fe\u72b6\u3001\u5168\u3066\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u6307\u5b9a\u3059\u308b\u3082\u306e\u3067\u3059\u3002 file=PATHNAME \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3059\u308bArrow\u30d5\u30a1\u30a4\u30eb\u30921\u500b\u6307\u5b9a\u3057\u307e\u3059\u3002 files=PATHNAME1[,PATHNAME2...] \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3059\u308bArrow\u30d5\u30a1\u30a4\u30eb\u3092\u30ab\u30f3\u30de(,\uff09\u533a\u5207\u308a\u3067\u8907\u6570\u6307\u5b9a\u3057\u307e\u3059\u3002 dir=DIRNAME \u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u5168\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3057\u307e\u3059\u3002 suffix=SUFFIX dir \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u6307\u5b9a\u6642\u3001\u4f8b\u3048\u3070 .arrow \u306a\u3069\u3001\u7279\u5b9a\u306e\u63a5\u5c3e\u53e5\u3092\u6301\u3064\u30d5\u30a1\u30a4\u30eb\u3060\u3051\u3092\u30de\u30c3\u30d7\u3057\u307e\u3059\u3002 parallel_workers=N_WORKERS \u3053\u306e\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u4e26\u5217\u30b9\u30ad\u30e3\u30f3\u306b\u4f7f\u7528\u3059\u308b\u4e26\u5217\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306e\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u4e00\u822c\u7684\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u304a\u3051\u308b parallel_workers \u30b9\u30c8\u30ec\u30fc\u30b8\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u540c\u7b49\u306e\u610f\u5473\u3092\u6301\u3061\u307e\u3059\u3002 writable=(true|false) \u3053\u306e\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b INSERT \u6587\u306e\u5b9f\u884c\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002\u8a73\u7d30\u306f\u300e\u66f8\u304d\u8fbc\u307f\u53ef\u80fdArrow_Fdw\u300f\u306e\u7bc0\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u30aa\u30d7\u30b7\u30e7\u30f3"},{"location":"arrow_fdw/#_5","text":"Arrow\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u578b\u3068\u3001PostgreSQL\u306e\u30c7\u30fc\u30bf\u578b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 Int bitWidth \u5c5e\u6027\u306e\u5024\u306b\u5fdc\u3058\u3066\u3001\u305d\u308c\u305e\u308c int1 \u3001 int2 \u3001 int4 \u3001 int8 \u306e\u3044\u305a\u308c\u304b\u306b\u5bfe\u5fdc\u3002 is_signed \u5c5e\u6027\u306e\u5024\u306f\u7121\u8996\u3055\u308c\u307e\u3059\u3002 int1 \u306fPG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 FloatingPoint precision \u5c5e\u6027\u306e\u5024\u306b\u5fdc\u3058\u3066\u3001\u305d\u308c\u305e\u308c float2 \u3001 float4 \u3001 float8 \u306e\u3044\u305a\u308c\u304b\u306b\u5bfe\u5fdc\u3002 float2 \u306fPG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 Binary bytea \u578b\u306b\u5bfe\u5fdc Decimal numeric \u578b\u306b\u5bfe\u5fdc Date date \u578b\u306b\u5bfe\u5fdc\u3002 unit=Day \u76f8\u5f53\u3068\u306a\u308b\u3088\u3046\u306b\u88dc\u6b63\u3055\u308c\u308b\u3002 Time time \u578b\u306b\u5bfe\u5fdc\u3002 unit=MicroSecond \u76f8\u5f53\u306b\u306a\u308b\u3088\u3046\u306b\u88dc\u6b63\u3055\u308c\u308b\u3002 Timestamp timestamp \u578b\u306b\u5bfe\u5fdc\u3002 unit=MicroSecond \u76f8\u5f53\u306b\u306a\u308b\u3088\u3046\u306b\u88dc\u6b63\u3055\u308c\u308b\u3002 Interval interval \u578b\u306b\u5bfe\u5fdc List \u8981\u7d20\u578b\u306e1\u6b21\u5143\u914d\u5217\u578b\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u308b\u3002 Struct \u8907\u5408\u578b\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u308b\u3002\u5bfe\u5fdc\u3059\u308b\u8907\u5408\u578b\u306f\u4e88\u3081\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002 FixedSizeBinary byteWidth \u5c5e\u6027\u306e\u5024\u306b\u5fdc\u3058\u3066 char(n) \u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u308b\u3002 \u30e1\u30bf\u30c7\u30fc\u30bf pg_type=TYPENAME \u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u8a72\u5f53\u3059\u308b\u30c7\u30fc\u30bf\u578b\u3092\u5272\u308a\u5f53\u3066\u308b\u5834\u5408\u304c\u3042\u308b\u3002\u73fe\u6642\u70b9\u3067\u306f\u3001 inet \u304a\u3088\u3073 macaddr \u578b\u3002 Union \u3001 Map \u3001 Duration \u3001 LargeBinary \u3001 LargeUtf8 \u3001 LargeList \u73fe\u6642\u70b9\u3067\u306fPostgreSQL\u30c7\u30fc\u30bf\u578b\u3078\u306e\u5bfe\u5fdc\u306f\u306a\u3057\u3002","title":"\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc"},{"location":"arrow_fdw/#explain","text":"EXPLAIN \u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u3066\u3001Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u51fa\u3057\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u7d04503GB\u306e\u5927\u304d\u3055\u3092\u6301\u3064Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u30de\u30c3\u30d7\u3057\u305ff_lineorder\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u542b\u3080\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u306e\u51fa\u529b\u3067\u3059\u3002 =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) -> Custom Scan (GpuPreAgg) on f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..78.95 rows=365 width=4) Filter: (d_year = 1993) (12 rows) \u3053\u308c\u3092\u898b\u308b\u3068Custom Scan (GpuPreAgg)\u304c f_lineorder \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3066\u3044\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 file0 \u306b\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u80cc\u5f8c\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u540d /opt/nvme/f_lineorder_s999.arrow \u3068\u305d\u306e\u30b5\u30a4\u30ba\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u30de\u30c3\u30d7\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306b\u306f\u3001 file1 \u3001 file2 \u3001... \u3068\u5404\u30d5\u30a1\u30a4\u30eb\u6bce\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002 referenced \u306b\u306f\u5b9f\u969b\u306b\u53c2\u7167\u3055\u308c\u3066\u3044\u308b\u5217\u306e\u4e00\u89a7\u304c\u5217\u6319\u3055\u308c\u3066\u304a\u308a\u3001\u3053\u306e\u30af\u30a8\u30ea\u306b\u304a\u3044\u3066\u306f lo_orderdate \u3001 lo_quantity \u3001 lo_extendedprice \u304a\u3088\u3073 lo_discount \u5217\u304c\u53c2\u7167\u3055\u308c\u3066\u3044\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 \u307e\u305f\u3001 GPU-Direct SQL: enabled (GPU-0) \u306e\u8868\u793a\u304c\u3042\u308b\u4e8b\u304b\u3089\u3001 f_lineorder \u306e\u30b9\u30ad\u30e3\u30f3\u306b\u306fGPU-Direct SQL\u6a5f\u69cb\u304c\u7528\u3044\u3089\u308c\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002 VERBOSE\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u4e0e\u3059\u308b\u4e8b\u3067\u3001\u3088\u308a\u8a73\u7d30\u306a\u60c5\u5831\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002 =# EXPLAIN VERBOSE SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) Output: pgstrom.sum_int((pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint))) -> Custom Scan (GpuPreAgg) on public.f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) Output: (pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint)) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) lo_orderdate: 22.35GB lo_quantity: 22.35GB lo_extendedprice: 22.35GB lo_discount: 22.35GB GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , , , KVecs-Buffer: nbytes: 51200, ndims: 3, items=[kvec0=<0x0000-27ff, type='int4', expr='lo_discount'>, kvec1=<0x2800-4fff, type='int4', expr='lo_quantity'>, kvec2=<0x5000-77ff, type='int4', expr='lo_extendedprice'>, kvec3=<0x7800-9fff, type='int4', expr='lo_orderdate'>, kvec4=<0xa000-c7ff, type='int4', expr='d_datekey'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, , , ]}, items[1]={LoadVars(depth=1): kvars=[]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, , ]}}, items[1]={MoveVars(depth=1): items=[, ]}}} Scan Quals OpCode: {Bool::AND args=[{Func(bool)::int4ge args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='1'}]}, {Func(bool)::int4le args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='3'}]}, {Func(bool)::int4lt args=[{Var(int4): slot=1, expr='lo_quantity'}, {Const(int4): value='25'}]}]} Join Quals OpCode: {Packed items[1]={JoinQuals: {Func(bool)::int4eq args=[{Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}, {Var(int4): slot=5, expr='d_datekey'}]}}} Join HashValue OpCode: {Packed items[1]={HashValue arg={Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}}} Partial Aggregation OpCode: {AggFuncs arg={SaveExpr: arg={Func(int8)::int8 arg={Func(int4)::int4mul args=[{Var(int4): kvec=0x5000-7800, expr='lo_extendedprice'}, {Var(int4): kvec=0x0000-2800, expr='lo_discount'}]}}}} Partial Function BufSz: 16 -> Seq Scan on public.date1 (cost=0.00..78.95 rows=365 width=4) Output: date1.d_datekey Filter: (date1.d_year = 1993) (28 rows) \u88ab\u53c2\u7167\u5217\u3092\u30ed\u30fc\u30c9\u3059\u308b\u969b\u306b\u8aad\u307f\u51fa\u3059\u3079\u304d\u5217\u30c7\u30fc\u30bf\u306e\u5927\u304d\u3055\u3092\u3001\u5217\u3054\u3068\u306b\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002 lo_orderdate \u3001 lo_quantity \u3001 lo_extendedprice \u304a\u3088\u3073 lo_discount \u5217\u306e\u30ed\u30fc\u30c9\u306b\u306f\u5408\u8a08\u306789.41GB\u306e\u8aad\u307f\u51fa\u3057\u304c\u5fc5\u8981\u3067\u3001\u3053\u308c\u306f\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba502.93GB\u306e17.8%\u306b\u76f8\u5f53\u3057\u307e\u3059\u3002","title":"EXPLAIN\u51fa\u529b\u306e\u8aad\u307f\u65b9"},{"location":"arrow_fdw/#arrow","text":"\u672c\u7bc0\u3067\u306f\u3001\u65e2\u306bPostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u3092Apache Arrow\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002","title":"Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u65b9\u6cd5"},{"location":"arrow_fdw/#pyarrowpandas","text":"Arrow\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u304c\u958b\u767a\u3092\u884c\u3063\u3066\u3044\u308b PyArrow \u30e2\u30b8\u30e5\u30fc\u30eb\u3068Pandas\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306e\u7d44\u5408\u305b\u3092\u7528\u3044\u3066\u3001PostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5185\u5bb9\u3092Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u3068\u66f8\u304d\u51fa\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u30c6\u30fc\u30d6\u30ebt0\u306b\u683c\u7d0d\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u5168\u3066\u8aad\u8fbc\u307f\u3001\u30d5\u30a1\u30a4\u30eb/tmp/t0.arrow\u3078\u3068\u66f8\u304d\u51fa\u3059\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002 import pyarrow as pa import pandas as pd X = pd.read_sql(sql=\"SELECT * FROM t0\", con=\"postgresql://localhost/postgres\") Y = pa.Table.from_pandas(X) f = pa.RecordBatchFileWriter('/tmp/t0.arrow', Y.schema) f.write_table(Y,1000000) # RecordBatch for each million rows f.close() \u305f\u3060\u3057\u4e0a\u8a18\u306e\u65b9\u6cd5\u306f\u3001SQL\u3092\u4ecb\u3057\u3066PostgreSQL\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5185\u5bb9\u3092\u4e00\u5ea6\u30e1\u30e2\u30ea\u306b\u4fdd\u6301\u3059\u308b\u305f\u3081\u3001\u5927\u91cf\u306e\u884c\u3092\u4e00\u5ea6\u306b\u5909\u63db\u3059\u308b\u5834\u5408\u306b\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002","title":"PyArrow+Pandas"},{"location":"arrow_fdw/#pg2arrow","text":"\u4e00\u65b9\u3001PG-Strom Development Team\u304c\u958b\u767a\u3092\u884c\u3063\u3066\u3044\u308b pg2arrow \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001PostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5185\u5bb9\u3092Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u3068\u66f8\u304d\u51fa\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u3053\u306e\u30c4\u30fc\u30eb\u306f\u6bd4\u8f03\u7684\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092NVME-SSD\u306a\u3069\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u66f8\u304d\u51fa\u3059\u4e8b\u3092\u5ff5\u982d\u306b\u8a2d\u8a08\u3055\u308c\u3066\u304a\u308a\u3001PostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089 -s|--segment-size \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u305f\u30b5\u30a4\u30ba\u306e\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3059\u305f\u3073\u306b\u3001Arrow\u5f62\u5f0f\u306e\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\uff08Record Batch\uff09\u3068\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30e1\u30e2\u30ea\u6d88\u8cbb\u91cf\u306f\u6bd4\u8f03\u7684\u30ea\u30fc\u30ba\u30ca\u30d6\u30eb\u306a\u5024\u3068\u306a\u308a\u307e\u3059\u3002 pg2arrow \u30b3\u30de\u30f3\u30c9\u306fPG-Strom\u306b\u540c\u68b1\u3055\u308c\u3066\u304a\u308a\u3001PostgreSQL\u95a2\u9023\u30b3\u30de\u30f3\u30c9\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002 $ pg2arrow --help Usage: pg2arrow [OPTION] [database] [username] General options: -d, --dbname=DBNAME Database name to connect to -c, --command=COMMAND SQL command to run -t, --table=TABLENAME Equivalent to '-c SELECT * FROM TABLENAME' (-c and -t are exclusive, either of them must be given) --inner-join=SUB_COMMAND --outer-join=SUB_COMMAND -o, --output=FILENAME result file in Apache Arrow format --append=FILENAME result Apache Arrow file to be appended (--output and --append are exclusive. If neither of them are given, it creates a temporary file.) -S, --stat[=COLUMNS] embeds min/max statistics for each record batch COLUMNS is a comma-separated list of the target columns if partially enabled. Arrow format options: -s, --segment-size=SIZE size of record batch for each Connection options: -h, --host=HOSTNAME database server host -p, --port=PORT database server port -u, --user=USERNAME database user name -w, --no-password never prompt for password -W, --password force password prompt Other options: --dump=FILENAME dump information of arrow file --progress shows progress of the job --set=NAME:VALUE config option to set before SQL execution --help shows this message Report bugs to . PostgreSQL\u3078\u306e\u63a5\u7d9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306fpsql\u3084pg_dump\u3068\u540c\u69d8\u306b\u3001 -h \u3084 -U \u306a\u3069\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002 \u57fa\u672c\u7684\u306a\u30b3\u30de\u30f3\u30c9\u306e\u4f7f\u7528\u65b9\u6cd5\u306f\u3001 -c|--command \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u305fSQL\u3092PostgreSQL\u4e0a\u3067\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092 -o|--output \u3067\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3078Arrow\u5f62\u5f0f\u3067\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002 -o|--output \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u4ee3\u308f\u308a\u306b --append \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u3053\u308c\u306f\u65e2\u5b58\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u8ffd\u8a18\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u8ffd\u8a18\u3055\u308c\u308bApache Arrow\u30d5\u30a1\u30a4\u30eb\u306f\u6307\u5b9a\u3057\u305fSQL\u306e\u5b9f\u884c\u7d50\u679c\u3068\u5b8c\u5168\u306b\u4e00\u81f4\u3059\u308b\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u6301\u305f\u306d\u3070\u306a\u308a\u307e\u305b\u3093\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u30c6\u30fc\u30d6\u30eb t0 \u306b\u683c\u7d0d\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u5168\u3066\u8aad\u8fbc\u307f\u3001\u30d5\u30a1\u30a4\u30eb /tmp/t0.arrow \u3078\u3068\u66f8\u304d\u51fa\u3059\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002 $ pg2arrow -U kaigai -d postgres -c \"SELECT * FROM t0\" -o /tmp/t0.arrow \u958b\u767a\u8005\u5411\u3051\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u304c\u3001 --dump \u3067Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3084\u30ec\u30b3\u30fc\u30c9\u30d0\u30c3\u30c1\u306e\u4f4d\u7f6e\u3068\u30b5\u30a4\u30ba\u3092\u53ef\u8aad\u306a\u5f62\u5f0f\u3067\u51fa\u529b\u3059\u308b\u4e8b\u3082\u3067\u304d\u307e\u3059\u3002 --progress \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u51e6\u7406\u306e\u9014\u4e2d\u7d4c\u904e\u3092\u8868\u793a\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002\u3053\u308c\u306f\u5de8\u5927\u306a\u30c6\u30fc\u30d6\u30eb\u3092Apache Arrow\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u969b\u306b\u6709\u7528\u3067\u3059\u3002","title":"Pg2Arrow"},{"location":"arrow_fdw/#_6","text":"","title":"\u5148\u9032\u7684\u306a\u4f7f\u3044\u65b9"},{"location":"arrow_fdw/#ssdtogpusql","text":"Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d7\u3055\u308c\u305f\u5168\u3066\u306eArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u304c\u4ee5\u4e0b\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u5834\u5408\u306b\u306f\u3001\u5217\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u51fa\u3057\u306bSSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u304cNVME-SSD\u533a\u753b\u4e0a\u306b\u7f6e\u304b\u308c\u3066\u3044\u308b\u3002 NVME-SSD\u533a\u753b\u306fExt4\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3067\u69cb\u7bc9\u3055\u308c\u3066\u3044\u308b\u3002 Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u7dcf\u8a08\u304c pg_strom.nvme_strom_threshold \u8a2d\u5b9a\u3092\u4e0a\u56de\u3063\u3066\u3044\u308b\u3002","title":"SSDtoGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL"},{"location":"arrow_fdw/#_7","text":"Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u4e00\u90e8\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u901a\u5e38\u306ePostgreSQL\u30c6\u30fc\u30d6\u30eb\u3068\u6df7\u5728\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306f\u66f8\u304d\u8fbc\u307f\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u4e8b\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u307e\u305f\u3001\u30de\u30c3\u30d7\u3055\u308c\u305fArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306b\u542b\u307e\u308c\u308b\u30c7\u30fc\u30bf\u306f\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5883\u754c\u6761\u4ef6\u3068\u77db\u76fe\u3057\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u8005\u306e\u8cac\u4efb\u3067\u3059\u3002 \u5178\u578b\u7684\u306a\u5229\u7528\u30b7\u30fc\u30f3\u306f\u3001\u9577\u671f\u9593\u306b\u308f\u305f\u308a\u84c4\u7a4d\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u51e6\u7406\u3067\u3059\u3002 \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u3068\u7570\u306a\u308a\u3001\u4e00\u822c\u7684\u306b\u30ed\u30b0\u30c7\u30fc\u30bf\u306f\u4e00\u5ea6\u8a18\u9332\u3055\u308c\u305f\u3089\u305d\u306e\u5f8c\u66f4\u65b0\u524a\u9664\u3055\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u3057\u305f\u304c\u3063\u3066\u3001\u4e00\u5b9a\u671f\u9593\u304c\u7d4c\u904e\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306f\u3001\u8aad\u307f\u51fa\u3057\u5c02\u7528\u3067\u306f\u3042\u308b\u3082\u306e\u306e\u96c6\u8a08\u51e6\u7406\u304c\u9ad8\u901f\u306aArrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u79fb\u3057\u66ff\u3048\u308b\u3053\u3068\u3067\u3001\u96c6\u8a08\u30fb\u89e3\u6790\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u51e6\u7406\u52b9\u7387\u3092\u5f15\u304d\u4e0a\u3052\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u30ed\u30b0\u30c7\u30fc\u30bf\u306b\u306f\u307b\u307c\u9593\u9055\u3044\u306a\u304f\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u304c\u4ed8\u4e0e\u3055\u308c\u3066\u3044\u308b\u4e8b\u304b\u3089\u3001\u6708\u5358\u4f4d\u3001\u9031\u5358\u4f4d\u306a\u3069\u3001\u4e00\u5b9a\u671f\u9593\u3054\u3068\u306b\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u8ffd\u52a0\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001PostgreSQL\u30c6\u30fc\u30d6\u30eb\u3068Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3092\u6df7\u5728\u3055\u305b\u305f\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3092\u5b9a\u7fa9\u3057\u305f\u3082\u306e\u3067\u3059\u3002 \u66f8\u304d\u8fbc\u307f\u304c\u53ef\u80fd\u306aPostgreSQL\u30c6\u30fc\u30d6\u30eb\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3068\u3057\u3066\u6307\u5b9a\u3057\u3066\u304a\u304f\u4e8b\u3067\u3001\u4e00\u5b9a\u671f\u9593\u306e\u7d4c\u904e\u5f8c\u3001DB\u904b\u7528\u3092\u7d99\u7d9a\u3057\u306a\u304c\u3089\u904e\u53bb\u306e\u30ed\u30b0\u30c7\u30fc\u30bf\u3060\u3051\u3092Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3078\u79fb\u3059\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 CREATE TABLE lineorder ( lo_orderkey numeric, lo_linenumber integer, lo_custkey numeric, lo_partkey integer, lo_suppkey numeric, lo_orderdate integer, lo_orderpriority character(15), lo_shippriority character(1), lo_quantity numeric, lo_extendedprice numeric, lo_ordertotalprice numeric, lo_discount numeric, lo_revenue numeric, lo_supplycost numeric, lo_tax numeric, lo_commit_date character(8), lo_shipmode character(10) ) PARTITION BY RANGE (lo_orderdate); CREATE TABLE lineorder__now PARTITION OF lineorder default; CREATE FOREIGN TABLE lineorder__1993 PARTITION OF lineorder FOR VALUES FROM (19930101) TO (19940101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1993.arrow'); CREATE FOREIGN TABLE lineorder__1994 PARTITION OF lineorder FOR VALUES FROM (19940101) TO (19950101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1994.arrow'); CREATE FOREIGN TABLE lineorder__1995 PARTITION OF lineorder FOR VALUES FROM (19950101) TO (19960101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1995.arrow'); CREATE FOREIGN TABLE lineorder__1996 PARTITION OF lineorder FOR VALUES FROM (19960101) TO (19970101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1996.arrow'); \u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b\u554f\u3044\u5408\u308f\u305b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u691c\u7d22\u6761\u4ef6 lo_orderdate between 19950701 and 19960630 \u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5883\u754c\u6761\u4ef6\u3092\u542b\u3093\u3067\u3044\u308b\u4e8b\u304b\u3089\u3001\u5b50\u30c6\u30fc\u30d6\u30eb lineorder__1993 \u3068 lineorder__1994 \u306f\u691c\u7d22\u5bfe\u8c61\u304b\u3089\u6392\u9664\u3055\u308c\u3001\u4ed6\u306e\u30c6\u30fc\u30d6\u30eb\u3060\u3051\u3092\u8aad\u307f\u51fa\u3059\u3088\u3046\u5b9f\u884c\u8a08\u753b\u304c\u4f5c\u3089\u308c\u3066\u3044\u307e\u3059\u3002 =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM lineorder,date1 WHERE lo_orderdate = d_datekey AND lo_orderdate between 19950701 and 19960630 AND lo_discount between 1 and 3 ABD lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=172088.90..172088.91 rows=1 width=32) -> Hash Join (cost=10548.86..172088.51 rows=77 width=64) Hash Cond: (lineorder__1995.lo_orderdate = date1.d_datekey) -> Append (cost=10444.35..171983.80 rows=77 width=67) -> Custom Scan (GpuScan) on lineorder__1995 (cost=10444.35..33671.87 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1995.arrow (size: 892.57MB) -> Custom Scan (GpuScan) on lineorder__1996 (cost=10444.62..33849.21 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1996.arrow (size: 897.87MB) -> Custom Scan (GpuScan) on lineorder__now (cost=11561.33..104462.33 rows=1 width=18) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash (cost=72.56..72.56 rows=2556 width=4) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=4) (16 rows) \u3053\u306e\u5f8c\u3001 lineorder__now \u30c6\u30fc\u30d6\u30eb\u304b\u30891997\u5e74\u306e\u30c7\u30fc\u30bf\u3092\u629c\u304d\u51fa\u3057\u3001\u3053\u308c\u3092Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u5074\u306b\u79fb\u3059\u306b\u306f\u4ee5\u4e0b\u306e\u64cd\u4f5c\u3092\u884c\u3044\u307e\u3059 $ pg2arrow -d sample -o /opt/tmp/lineorder_1997.arrow \\ -c \"SELECT * FROM lineorder WHERE lo_orderdate between 19970101 and 19971231\" pg2arrow \u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u3001 lineorder \u30c6\u30fc\u30d6\u30eb\u304b\u30891997\u5e74\u306e\u30c7\u30fc\u30bf\u3060\u3051\u3092\u629c\u304d\u51fa\u3057\u3066\u3001\u65b0\u3057\u3044Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002 BEGIN; -- -- remove rows in 1997 from the read-writable table -- DELETE FROM lineorder WHERE lo_orderdate BETWEEN 19970101 AND 19971231; -- -- define a new partition leaf which maps log-data in 1997 -- CREATE FOREIGN TABLE lineorder__1997 PARTITION OF lineorder FOR VALUES FROM (19970101) TO (19980101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1997.arrow'); COMMIT; \u3053\u306e\u64cd\u4f5c\u306b\u3088\u308a\u3001PostgreSQL\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b lineorder__now \u304b\u30891997\u5e74\u306e\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3057\u3001\u4ee3\u308f\u308a\u306b\u540c\u4e00\u5185\u5bb9\u306eArrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb /opt/tmp/lineorder_1997.arrow \u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb lineorder__1997 \u3068\u3057\u3066\u30de\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002 \u6b63\u78ba\u306b\u306f\u30014KB\uff5e32KB\u306e\u7bc4\u56f2\u3067\u30d3\u30eb\u30c9\u6642\u306b\u6307\u5b9a\u3067\u304d\u307e\u3059 \u21a9","title":"\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u8a2d\u5b9a"},{"location":"brin/","text":"\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5bfe\u5fdc \u6982\u8981 PostgreSQL\u306f\u4f55\u7a2e\u985e\u304b\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5f62\u5f0f\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u9078\u629e\u3055\u308c\u308bB-tree\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u7279\u5b9a\u306e\u5024\u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u3092\u9ad8\u901f\u306b\u691c\u7d22\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002\u3053\u308c\u4ee5\u5916\u306b\u3082\u3001Hash\u3001BRIN\u3001GiST\u3001GIN\u306a\u3069\u7279\u6027\u306e\u7570\u306a\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5f62\u5f0f\u304c\u63d0\u4f9b\u3055\u308c\u3066\u304a\u308a\u3001\u73fe\u5728\u306e\u3068\u3053\u308dPG-Strom\u306fBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u306e\u307f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306b\u304a\u3051\u308b\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u5024\u306a\u3069\u3001\u7269\u7406\u7684\u306b\u8fd1\u508d\u306b\u4f4d\u7f6e\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u540c\u58eb\u304c\u8fd1\u3057\u3044\u5024\u3092\u6301\u3063\u3066\u3044\u308b\u4e8b\u304c\u671f\u5f85\u3067\u304d\u308b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u5bfe\u3057\u3066\u6709\u52b9\u306b\u4f5c\u7528\u3057\u307e\u3059\u3002\u672c\u6765\u306f\u5168\u4ef6\u30b9\u30ad\u30e3\u30f3\u304c\u5fc5\u8981\u306a\u64cd\u4f5c\u3067\u3042\u3063\u3066\u3082\u3001\u660e\u3089\u304b\u306b\u6761\u4ef6\u53e5\u306b\u30de\u30c3\u30c1\u3057\u306a\u3044\u9818\u57df\u3092\u8aad\u307f\u98db\u3070\u3057\u3001\u5168\u4ef6\u30b9\u30ad\u30e3\u30f3\u306b\u4f34\u3046I/O\u91cf\u3092\u524a\u6e1b\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 PG-Strom\u306b\u304a\u3044\u3066\u3082BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u7279\u6027\u3092\u6d3b\u7528\u3057\u3001GPU\u306b\u30ed\u30fc\u30c9\u3059\u3079\u304d\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u306e\u3046\u3061\u660e\u3089\u304b\u306b\u4e0d\u8981\u3067\u3042\u308b\u3082\u306e\u3092\u8aad\u307f\u98db\u3070\u3059\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 \u8a2d\u5b9a BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u7279\u5225\u306a\u8a2d\u5b9a\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002 CREATE INDEX\u69cb\u6587\u3092\u7528\u3044\u3066\u5bfe\u8c61\u5217\u306b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001\u304b\u3064\u3001\u691c\u7d22\u6761\u4ef6\u304cBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u9069\u5408\u3059\u308b\u3082\u306e\u3067\u3042\u308c\u3070\u81ea\u52d5\u7684\u306b\u9069\u7528\u3055\u308c\u307e\u3059\u3002 BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u81ea\u4f53\u306e\u8aac\u660e\u306f\u3001 PostgreSQL\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u4ee5\u4e0b\u306eGUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308a\u3001PG-Strom\u304cBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u30c7\u30d0\u30c3\u30b0\u3084\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u5834\u5408\u3092\u9664\u304d\u3001\u901a\u5e38\u306f\u521d\u671f\u8a2d\u5b9a\u306e\u307e\u307e\u3067\u69cb\u3044\u307e\u305b\u3093\u3002 \u30d1\u30e9\u30e1\u30fc\u30bf\u540d \u578b \u521d\u671f\u5024 \u8aac\u660e pg_strom.enable_brin bool on BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 \u64cd\u4f5c EXPLAIN \u69cb\u6587\u306b\u3088\u308aBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 postgres=# EXPLAIN ANALYZE SELECT * FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' AND cat LIKE '%aaa%'; QUERY PLAN -------------------------------------------------------------------------------- Custom Scan (GpuScan) on dt (cost=94810.93..176275.00 rows=169992 width=44) (actual time=1777.819..1901.537 rows=175277 loops=1) GPU Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date) AND (cat ~~ '%aaa%'::text)) Rows Removed by GPU Filter: 4385491 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 0.529 ms Execution time: 2323.063 ms (7 rows) \u4e0a\u8a18\u306e\u4f8b\u3067\u306f ymd \u5217\u306bBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001 BRIN cond \u306e\u8868\u793a\u306fBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308b\u7d5e\u308a\u8fbc\u307f\u6761\u4ef6\u3092\u3001 BRIN skipped \u306e\u8868\u793a\u306fBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308a\u5b9f\u969b\u306b\u8aad\u307f\u98db\u3070\u3055\u308c\u305f\u30d6\u30ed\u30c3\u30af\u306e\u6570\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002 \u3053\u306e\u4f8b\u3067\u306f424704\u30d6\u30ed\u30c3\u30af\u304c\u8aad\u307f\u98db\u3070\u3055\u308c\u3001\u3055\u3089\u306b\u3001\u8aad\u307f\u8fbc\u3093\u3060\u30d6\u30ed\u30c3\u30af\u306b\u542b\u307e\u308c\u3066\u3044\u308b\u30ec\u30b3\u30fc\u30c9\u306e\u3046\u30614385491\u884c\u304c\u6761\u4ef6\u53e5\u306b\u3088\u3063\u3066\u30d5\u30a3\u30eb\u30bf\u3055\u308c\u305f\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u8ee2\u9001\u306e\u30ed\u30b9\u3092\u6e1b\u3089\u3059\u305f\u3081\u3001GpuJoin\u3084GpuPreAgg\u304c\u76f4\u4e0b\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u3092\u5f15\u304d\u4e0a\u3052\u3001\u81ea\u3089\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u51e6\u7406\u3092\u884c\u3046\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3067\u3082\u3001BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u5229\u7528\u53ef\u80fd\u3067\u3042\u308c\u3070\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308b\u7d5e\u308a\u8fbc\u307f\u3092\u884c\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001GROUP BY\u3092\u542b\u3080\u51e6\u7406\u3067BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u30b1\u30fc\u30b9\u3067\u3059\u3002 postgres=# EXPLAIN ANALYZE SELECT cat,count(*) FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=6149.78..6151.86 rows=26 width=12) (actual time=427.482..427.499 rows=26 loops=1) Group Key: cat -> Sort (cost=6149.78..6150.24 rows=182 width=12) (actual time=427.465..427.467 rows=26 loops=1) Sort Key: cat Sort Method: quicksort Memory: 26kB -> Custom Scan (GpuPreAgg) on dt (cost=6140.68..6142.95 rows=182 width=12) (actual time=427.331..427.339 rows=26 loops=1) Reduction: Local Outer Scan: dt (cost=4000.00..4011.99 rows=4541187 width=4) (actual time=78.573..415.961 rows=4560768 loops=1) Outer Scan Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) Rows Removed by Outer Scan Filter: 15564 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 30.992 ms Execution time: 818.994 ms (14 rows)","title":"BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9"},{"location":"brin/#_1","text":"","title":"\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5bfe\u5fdc"},{"location":"brin/#_2","text":"PostgreSQL\u306f\u4f55\u7a2e\u985e\u304b\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5f62\u5f0f\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u9078\u629e\u3055\u308c\u308bB-tree\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u7279\u5b9a\u306e\u5024\u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u3092\u9ad8\u901f\u306b\u691c\u7d22\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002\u3053\u308c\u4ee5\u5916\u306b\u3082\u3001Hash\u3001BRIN\u3001GiST\u3001GIN\u306a\u3069\u7279\u6027\u306e\u7570\u306a\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5f62\u5f0f\u304c\u63d0\u4f9b\u3055\u308c\u3066\u304a\u308a\u3001\u73fe\u5728\u306e\u3068\u3053\u308dPG-Strom\u306fBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u306e\u307f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306b\u304a\u3051\u308b\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u5024\u306a\u3069\u3001\u7269\u7406\u7684\u306b\u8fd1\u508d\u306b\u4f4d\u7f6e\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u540c\u58eb\u304c\u8fd1\u3057\u3044\u5024\u3092\u6301\u3063\u3066\u3044\u308b\u4e8b\u304c\u671f\u5f85\u3067\u304d\u308b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u5bfe\u3057\u3066\u6709\u52b9\u306b\u4f5c\u7528\u3057\u307e\u3059\u3002\u672c\u6765\u306f\u5168\u4ef6\u30b9\u30ad\u30e3\u30f3\u304c\u5fc5\u8981\u306a\u64cd\u4f5c\u3067\u3042\u3063\u3066\u3082\u3001\u660e\u3089\u304b\u306b\u6761\u4ef6\u53e5\u306b\u30de\u30c3\u30c1\u3057\u306a\u3044\u9818\u57df\u3092\u8aad\u307f\u98db\u3070\u3057\u3001\u5168\u4ef6\u30b9\u30ad\u30e3\u30f3\u306b\u4f34\u3046I/O\u91cf\u3092\u524a\u6e1b\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 PG-Strom\u306b\u304a\u3044\u3066\u3082BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u7279\u6027\u3092\u6d3b\u7528\u3057\u3001GPU\u306b\u30ed\u30fc\u30c9\u3059\u3079\u304d\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u306e\u3046\u3061\u660e\u3089\u304b\u306b\u4e0d\u8981\u3067\u3042\u308b\u3082\u306e\u3092\u8aad\u307f\u98db\u3070\u3059\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002","title":"\u6982\u8981"},{"location":"brin/#_3","text":"BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u7279\u5225\u306a\u8a2d\u5b9a\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002 CREATE INDEX\u69cb\u6587\u3092\u7528\u3044\u3066\u5bfe\u8c61\u5217\u306b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001\u304b\u3064\u3001\u691c\u7d22\u6761\u4ef6\u304cBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u9069\u5408\u3059\u308b\u3082\u306e\u3067\u3042\u308c\u3070\u81ea\u52d5\u7684\u306b\u9069\u7528\u3055\u308c\u307e\u3059\u3002 BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u81ea\u4f53\u306e\u8aac\u660e\u306f\u3001 PostgreSQL\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u4ee5\u4e0b\u306eGUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308a\u3001PG-Strom\u304cBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u30c7\u30d0\u30c3\u30b0\u3084\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u5834\u5408\u3092\u9664\u304d\u3001\u901a\u5e38\u306f\u521d\u671f\u8a2d\u5b9a\u306e\u307e\u307e\u3067\u69cb\u3044\u307e\u305b\u3093\u3002 \u30d1\u30e9\u30e1\u30fc\u30bf\u540d \u578b \u521d\u671f\u5024 \u8aac\u660e pg_strom.enable_brin bool on BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002","title":"\u8a2d\u5b9a"},{"location":"brin/#_4","text":"EXPLAIN \u69cb\u6587\u306b\u3088\u308aBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 postgres=# EXPLAIN ANALYZE SELECT * FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' AND cat LIKE '%aaa%'; QUERY PLAN -------------------------------------------------------------------------------- Custom Scan (GpuScan) on dt (cost=94810.93..176275.00 rows=169992 width=44) (actual time=1777.819..1901.537 rows=175277 loops=1) GPU Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date) AND (cat ~~ '%aaa%'::text)) Rows Removed by GPU Filter: 4385491 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 0.529 ms Execution time: 2323.063 ms (7 rows) \u4e0a\u8a18\u306e\u4f8b\u3067\u306f ymd \u5217\u306bBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001 BRIN cond \u306e\u8868\u793a\u306fBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308b\u7d5e\u308a\u8fbc\u307f\u6761\u4ef6\u3092\u3001 BRIN skipped \u306e\u8868\u793a\u306fBRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308a\u5b9f\u969b\u306b\u8aad\u307f\u98db\u3070\u3055\u308c\u305f\u30d6\u30ed\u30c3\u30af\u306e\u6570\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002 \u3053\u306e\u4f8b\u3067\u306f424704\u30d6\u30ed\u30c3\u30af\u304c\u8aad\u307f\u98db\u3070\u3055\u308c\u3001\u3055\u3089\u306b\u3001\u8aad\u307f\u8fbc\u3093\u3060\u30d6\u30ed\u30c3\u30af\u306b\u542b\u307e\u308c\u3066\u3044\u308b\u30ec\u30b3\u30fc\u30c9\u306e\u3046\u30614385491\u884c\u304c\u6761\u4ef6\u53e5\u306b\u3088\u3063\u3066\u30d5\u30a3\u30eb\u30bf\u3055\u308c\u305f\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u8ee2\u9001\u306e\u30ed\u30b9\u3092\u6e1b\u3089\u3059\u305f\u3081\u3001GpuJoin\u3084GpuPreAgg\u304c\u76f4\u4e0b\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u3092\u5f15\u304d\u4e0a\u3052\u3001\u81ea\u3089\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u51e6\u7406\u3092\u884c\u3046\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3067\u3082\u3001BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u5229\u7528\u53ef\u80fd\u3067\u3042\u308c\u3070\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308b\u7d5e\u308a\u8fbc\u307f\u3092\u884c\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001GROUP BY\u3092\u542b\u3080\u51e6\u7406\u3067BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u30b1\u30fc\u30b9\u3067\u3059\u3002 postgres=# EXPLAIN ANALYZE SELECT cat,count(*) FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=6149.78..6151.86 rows=26 width=12) (actual time=427.482..427.499 rows=26 loops=1) Group Key: cat -> Sort (cost=6149.78..6150.24 rows=182 width=12) (actual time=427.465..427.467 rows=26 loops=1) Sort Key: cat Sort Method: quicksort Memory: 26kB -> Custom Scan (GpuPreAgg) on dt (cost=6140.68..6142.95 rows=182 width=12) (actual time=427.331..427.339 rows=26 loops=1) Reduction: Local Outer Scan: dt (cost=4000.00..4011.99 rows=4541187 width=4) (actual time=78.573..415.961 rows=4560768 loops=1) Outer Scan Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) Rows Removed by Outer Scan Filter: 15564 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 30.992 ms Execution time: 818.994 ms (14 rows)","title":"\u64cd\u4f5c"},{"location":"fluentd/","text":"Fluentd\u9023\u643a \u672c\u7ae0\u3067\u306f\u3001Apache Arrow\u30c7\u30fc\u30bf\u5f62\u5f0f\u3092\u4ecb\u3057\u305fFluentd\u3068\u306e\u9023\u643a\u3068\u3001IoT/M2M\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u52b9\u7387\u7684\u306a\u53d6\u308a\u8fbc\u307f\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u6982\u8981 IoT/M2M\u3068\u3088\u3070\u308c\u308b\u6280\u8853\u9818\u57df\u306b\u304a\u3044\u3066\u306f\u3001PC\u3084\u30b5\u30fc\u30d0\u3060\u3051\u3067\u306a\u304f\u3001\u643a\u5e2f\u96fb\u8a71\u3084\u81ea\u52d5\u8eca\u3001\u5404\u7a2e\u30bb\u30f3\u30b5\u30fc\u306a\u3069\u306e\u30c7\u30d0\u30a4\u30b9\u304c\u751f\u6210\u3057\u305f\u5927\u91cf\u306e\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u84c4\u7a4d\u3057\u3001\u3053\u308c\u3092\u5206\u6790\u3059\u308b\u305f\u3081\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c\u6570\u591a\u304f\u958b\u767a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5927\u91cf\u306e\u30c7\u30d0\u30a4\u30b9\u304c\u6642\u3005\u523b\u3005\u3068\u751f\u6210\u3059\u308b\u30c7\u30fc\u30bf\u306f\u975e\u5e38\u306b\u5927\u304d\u306a\u30b5\u30a4\u30ba\u306b\u306a\u308a\u304c\u3061\u3067\u3001\u3053\u308c\u3092\u5b9f\u7528\u7684\u306a\u6642\u9593\u5185\u306b\u51e6\u7406\u3059\u308b\u306b\u306f\u3001\u7279\u5225\u306a\u5de5\u592b\u304c\u5fc5\u8981\u3068\u306a\u308b\u304b\u3089\u3067\u3059\u3002 PG-Strom\u306e\u5404\u7a2e\u6a5f\u80fd\u306f\u3001\u3053\u3046\u3044\u3063\u305f\u898f\u6a21\u306e\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u9ad8\u901f\u306b\u51e6\u7406\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u30fb\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3057\u304b\u3057\u4e00\u65b9\u3067\u3001\u3053\u3046\u3057\u305f\u898f\u6a21\u306e\u30c7\u30fc\u30bf\u306e\u691c\u7d22\u30fb\u96c6\u8a08\u304c\u53ef\u80fd\u306a\u72b6\u614b\u306b\u3059\u308b\u305f\u3081\u306b\u30c7\u30fc\u30bf\u3092\u79fb\u9001\u3057\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u53d6\u308a\u8fbc\u3080\u306b\u306f\u6642\u9593\u304c\u304b\u304b\u308a\u304c\u3061\u3067\u3059\u3002 \u305d\u3053\u3067\u3001PG-Strom\u306b\u306fFluentd\u5411\u3051\u306bApache Arrow\u5f62\u5f0f\u3067\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u51fa\u529b\u3059\u308b fluent-plugin-arrow-file \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u540c\u68b1\u3057\u3001\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u3068\u3044\u3046\u554f\u984c\u306b\u5bfe\u51e6\u3092\u8a66\u307f\u3066\u3044\u307e\u3059\u3002 Fluentd\u306f\u53e4\u6a4b\u8c9e\u4e4b\u6c0f\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u305f\u30ed\u30b0\u53ce\u96c6\u30c4\u30fc\u30eb\u3067\u3001Syslog\u306e\u3088\u3046\u306a\u30b5\u30fc\u30d0\u30ed\u30b0\u304b\u3089IoT/M2M\u6a5f\u5668\u306e\u30c7\u30d0\u30a4\u30b9\u30ed\u30b0\u306b\u81f3\u308b\u307e\u3067\u3001\u591a\u7a2e\u591a\u69d8\u306a\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u96c6\u7a4d\u30fb\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306b\u4e8b\u5b9f\u4e0a\u306e\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u3068\u3057\u3066\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3059\u3002 Ruby\u3067\u8a18\u8ff0\u3055\u308c\u305f\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u8ffd\u52a0\u306b\u3088\u308a\u3001\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u5165\u51fa\u529b\u3084\u52a0\u5de5\u3092\u81ea\u5728\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u30012022\u5e74\u73fe\u5728\u3001800\u7a2e\u985e\u3092\u8d8a\u3048\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u516c\u5f0fWeb\u30b5\u30a4\u30c8\u3067\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002 PG-Strom\u304c\u53d6\u308a\u6271\u3046\u3053\u3068\u306e\u3067\u304d\u308b\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f\u3001PostgreSQL Heap\u5f62\u5f0f\uff08\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30ca\u30eb\u884c\u30c7\u30fc\u30bf\uff09\u3068Apache Arrow\u5f62\u5f0f\uff08\u69cb\u9020\u5316\u5217\u30c7\u30fc\u30bf\uff09\u306e\uff12\u7a2e\u985e\u3067\u3059\u304c\u3001IoT/M2M\u9818\u57df\u3067\u60f3\u5b9a\u3055\u308c\u308b\u3088\u3046\u306a\u3001\u6642\u3005\u523b\u3005\u3068\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u304c\u767a\u751f\u3059\u308b\u3088\u3046\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u3057\u3066\u306f\u3001Apache Arrow\u5f62\u5f0f\u3092\u7528\u3044\u305f\u65b9\u304c\u5408\u7406\u7684\u3067\u3059\u3002 arrow-file \u30d7\u30e9\u30b0\u30a4\u30f3 \u4ee5\u4e0b\u3067\u306f\u3001Fluentd\u304c\u53ce\u96c6\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u3092Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u51fa\u529b\u3057\u3001\u3053\u308c\u3092PG-Strom\u3067\u53c2\u7167\u3059\u308b\u3068\u3044\u3046\u30a2\u30d7\u30ed\u30fc\u30c1\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u307e\u305f\u3001Fluentd\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u306f\u3001Treasure Data\u793e\u306e\u63d0\u4f9b\u3059\u308b\u5b89\u5b9a\u7248 td-agent \u3092\u4f7f\u7528\u3059\u308b\u3082\u306e\u3068\u3057\u307e\u3059\u3002 PG-Strom\u306b\u540c\u68b1\u306eFluentd\u5411\u3051Output\u30d7\u30e9\u30b0\u30a4\u30f3\u306e fluent-plugin-arrow-file \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u5229\u7528\u3059\u308b\u3068\u3001Fluentd\u304c\u53ce\u96c6\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u3001\u6307\u5b9a\u3057\u305f\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u6301\u3064Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u66f8\u304d\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002PG-Strom\u306eArrow_Fdw\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308c\u3070\u3053\u306eApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u53c2\u7167\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u307e\u305f\u4fdd\u5b58\u5148\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u304c\u9069\u5207\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308c\u3070\u3001GPU-Direct SQL\u3092\u7528\u3044\u305f\u9ad8\u901f\u306a\u8aad\u307f\u51fa\u3057\u3082\u53ef\u80fd\u3067\u3059\u3002 \u3053\u306e\u65b9\u6cd5\u306b\u306f\u4ee5\u4e0b\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002 - Fluentd \u304c\u51fa\u529b\u3057\u305f\u30c7\u30fc\u30bf\u3092\u305d\u306e\u307e\u307ePG-Strom\u3067\u8aad\u307f\u51fa\u305b\u308b\u305f\u3081\u3001\u6539\u3081\u3066DB\u3078\u30c7\u30fc\u30bf\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u3002 - \u5217\u30c7\u30fc\u30bf\u5f62\u5f0f\u3067\u3042\u308b\u305f\u3081\u3001\u691c\u7d22\u30fb\u96c6\u8a08\u51e6\u7406\u306b\u4f34\u3046\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u51fa\u3057\uff08I/O\u8ca0\u8377\uff09\u3092\u5fc5\u8981\u6700\u5c0f\u9650\u306b\u6291\u3048\u308b\u4e8b\u304c\u3067\u304d\u308b\u3002 - \u53e4\u304f\u306a\u3063\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u3082\u3001OS\u4e0a\u306e\u30d5\u30a1\u30a4\u30eb\u79fb\u52d5\u306e\u307f\u3067\u5b8c\u4e86\u3067\u304d\u308b\u3002 \u4e00\u65b9\u3067\u3001Apache Arrow\u5f62\u5f0f\u3067\u6027\u80fd\u4e0a\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u5f97\u308b\u306b\u306f\u3001Record Batch\u306e\u30b5\u30a4\u30ba\u3092\u3042\u308b\u7a0b\u5ea6\u5927\u304d\u304f\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u305f\u3081\u3001\u30ed\u30b0\u306e\u767a\u751f\u983b\u5ea6\u304c\u5c0f\u3055\u304f\u3001\u4e00\u5b9a\u30b5\u30a4\u30ba\u306e\u30ed\u30b0\u304c\u6e9c\u307e\u308b\u307e\u3067\u306b\u6642\u9593\u306e\u304b\u304b\u308b\u5834\u5408\u306b\u306f\u3001PostgreSQL\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u51fa\u529b\u3055\u305b\u308b\u306a\u3069\u3001\u5225\u306e\u65b9\u6cd5\u3092\u8a66\u3057\u305f\u65b9\u304c\u3088\u308a\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306b\u8fd1\u3044\u30ed\u30b0\u5206\u6790\u304c\u53ef\u80fd\u3067\u3057\u3087\u3046\u3002 \u5185\u90e8\u69cb\u9020 Fluentd\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u306f\u3044\u304f\u3064\u304b\u30ab\u30c6\u30b4\u30ea\u304c\u3042\u308a\u3001\u5916\u90e8\u304b\u3089\u30ed\u30b0\u3092\u53d7\u3051\u53d6\u308bInput\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u30ed\u30b0\u3092\u6210\u5f62\u3059\u308bParser\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u53d7\u4fe1\u3057\u305f\u30ed\u30b0\u3092\u4e00\u6642\u7684\u306b\u84c4\u7a4d\u3059\u308bBuffer\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u30ed\u30b0\u3092\u51fa\u529b\u3059\u308bOutput\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u306a\u3069\u306e\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u3002 arrow-file\u306fOutput\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4e00\u3064\u3067\u3059\u304c\u3001\u3053\u308c\u306fBuffer\u30d7\u30e9\u30b0\u30a4\u30f3\u304b\u3089\u6e21\u3055\u308c\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u56fa\u307e\u308a(chunk)\u3092\u3001\u30b3\u30f3\u30d5\u30a3\u30b0\u3067\u6307\u5b9a\u3055\u308c\u305f\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u6301\u3064Apache Arrow\u5f62\u5f0f\u3067\u66f8\u304d\u51fa\u3059\u5f79\u5272\u3092\u62c5\u3063\u3066\u3044\u307e\u3059\u3002 Input/Parser\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u5f79\u5272\u306f\u3001\u5916\u90e8\u304b\u3089\u53d7\u3051\u53d6\u3063\u305f\u30ed\u30b0\u3092\u5171\u901a\u306e\u5f62\u5f0f\u306b\u5909\u63db\u3057\u3001Buffer\u30d7\u30e9\u30b0\u30a4\u30f3\u3084Output\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u5165\u529b\u30c7\u30fc\u30bf\u306e\u5f62\u5f0f\u3092\u610f\u8b58\u3059\u308b\u3053\u3068\u306a\u304f\u6271\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u3059\u3002 \u3053\u308c\u306f\u5185\u90e8\u7684\u306b\u306f\u3001\u30ed\u30b0\u306e\u632f\u308a\u5206\u3051\u306b\u5229\u7528\u3059\u308b\u3053\u3068\u306e\u3067\u304d\u308b\u8b58\u5225\u5b50\u306e tag \u3001\u30ed\u30b0\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7 time \u3001\u304a\u3088\u3073\u751f\u30ed\u30b0\u3092\u6210\u5f62\u3057\u305f\u9023\u60f3\u914d\u5217\u3067\u3042\u308b record \u306e\u7d44\u3067\u3059\u3002 arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001 tag \u3001 time \u306e\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u3068\u3001 record \u9023\u60f3\u914d\u5217\u306e\u5404\u8981\u7d20\uff08\u4e00\u90e8\u3092\u7701\u7565\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\uff09\u3092\u5217\u3068\u3057\u3066\u6301\u3064Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u66f8\u304d\u51fa\u3057\u3092\u884c\u3044\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001\u51fa\u529b\u5148\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3068\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u60c5\u5831\uff08\u9023\u60f3\u914d\u5217\u306e\u8981\u7d20\u3068\u5217/\u578b\u306e\u30de\u30c3\u30d4\u30f3\u30b0\uff09\u306f\u5fc5\u9808\u306e\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3059\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u4f7f\u7528\u3057\u3066\u3044\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u7528\u306e td-agent \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u307e\u305f\u3001arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u306f rake-compiler \u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u306e\u3067\u3001\u4e88\u3081\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3059\u3002 \u8a73\u3057\u304f\u306f \u3053\u3061\u3089 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 $ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent4.sh | sh $ sudo /opt/td-agent/bin/fluent-gem install rake-compiler \u6b21\u306b\u3001PG-Strom\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001 fluentd \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u306e\u7269\u4ef6\u3092\u30d3\u30eb\u30c9\u3057\u307e\u3059\u3002 $ git clone https://github.com/heterodb/pg-strom.git $ cd pg-strom/fluentd $ make TD_AGENT=1 gem $ sudo make TD_AGENT=1 install Fluentd\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 $ /opt/td-agent/bin/fluent-gem list | grep arrow fluent-plugin-arrow-file (0.2) \u8a2d\u5b9a \u524d\u8ff0\u306e\u901a\u308a\u3001arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u52d5\u4f5c\u3055\u305b\u308b\u306b\u306f\u3001\u51fa\u529b\u5148\u306e\u30d1\u30b9\u540d\u3068\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u6700\u4f4e\u9650\u5fc5\u8981\u3067\u3059\u3002 \u3053\u308c\u306b\u52a0\u3048\u3066\u3001Apache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u69cb\u9020\u4e0a\u3001Record Batch\u3068\u547c\u3070\u308c\u308b\u30c7\u30fc\u30bf\u306e\u56fa\u307e\u308a\u306f\u3042\u308b\u7a0b\u5ea6\u5927\u304d\u306a\u30b5\u30a4\u30ba\u3067\u533a\u5207\u3063\u3066\u304a\u3044\u305f\u65b9\u304c\u3001\u691c\u7d22\u30fb\u96c6\u8a08\u51e6\u7406\u3092\u884c\u3046\u969b\u306e\u51e6\u7406\u6027\u80fd\u3092\u5f15\u304d\u51fa\u3057\u3084\u3059\u3044\u3067\u3059\u3002 arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001Buffer\u30d7\u30e9\u30b0\u30a4\u30f3\u304b\u3089\u6e21\u3055\u308c\u308bchunk\u3054\u3068\u306bRecord Batch\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u3001Buffer\u30d7\u30e9\u30b0\u30a4\u30f3\u5074\u306e\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u306f\u3053\u308c\u306b\u6e96\u3058\u305f\u8a2d\u5b9a\u3092\u884c\u3046\u3079\u304d\u3067\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f 256MB \u306e\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u3092\u53d6\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 path [type: String ] (\u5fc5\u9808\u30d1\u30e9\u30e1\u30fc\u30bf) arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u30ed\u30b0\u3092\u51fa\u529b\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u5fc5\u9808\u3067\u3001\u4ee5\u4e0b\u306e\u66f8\u5f0f\u6587\u5b57\u3092\u542b\u3081\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u66f8\u5f0f \u8aac\u660e %Y \u73fe\u5728\u306e\u5e74\u3092\u897f\u66a64\u6841\u3067\u8868\u73fe\u3057\u305f\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %y \u73fe\u5728\u306e\u5e74\u306e\u897f\u66a6\u4e0b2\u6841\u3067\u8868\u73fe\u3057\u305f\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %m \u73fe\u5728\u306e\u6708\u3092 01\uff5e12 \u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %d \u73fe\u5728\u306e\u65e5\u3092 01\uff5e31 \u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %H \u73fe\u5728\u6642\u523b\u306e\u6642\u309200\uff5e23\u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %M \u73fe\u5728\u6642\u523b\u306e\u5206\u309200\uff5e59\u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %S \u73fe\u5728\u6642\u523b\u306e\u79d2\u309200\uff5e59\u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %p \u73fe\u5728\u306e Fluentd \u30d7\u30ed\u30bb\u30b9\u306ePID\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 \u66f8\u5f0f\u6587\u5b57\u5217\u306f\u30c1\u30e3\u30f3\u30af\u3092\u66f8\u304d\u51fa\u3059\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u8a55\u4fa1\u3055\u308c\u3001\u540c\u540d\u306eApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306b\u306f\u3001Record Batch\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306fApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u65b0\u898f\u4f5c\u6210\u3057\u3001\u6700\u521d\u306eRecord Batch\u3092\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002 \u305f\u3060\u3057\u3001\u65e2\u5b58\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u304c\u5f8c\u8ff0\u306e filesize_threshold \u8a2d\u5b9a\u5024\u3092\u8d8a\u3048\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u65e2\u5b58\u30d5\u30a1\u30a4\u30eb\u3092\u30ea\u30cd\u30fc\u30e0\u3057\u305f\u5f8c\u3001\u65b0\u898f\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \uff08\u4f8b\uff09`path /tmp/arrow_logs/my_logs_%y%m%d.%p.log` \u51fa\u529b\u5148\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u30c1\u30e3\u30f3\u30af\u3092\u66f8\u304d\u51fa\u3059\u305f\u3073\u306b\u30d5\u30c3\u30bf\u9818\u57df\u3092\u66f4\u65b0\u3057\u3066\u5168\u3066\u306eRecord Batch\u3092\u30dd\u30a4\u30f3\u30c8\u3057\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u751f\u6210\u3055\u308c\u305fApache Arrow\u30d5\u30a1\u30a4\u30eb\u306f\u5373\u5ea7\u306b\u8aad\u307f\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u30a2\u30af\u30bb\u30b9\u7af6\u5408\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u306f lockf(3) \u3092\u7528\u3044\u3066\u6392\u4ed6\u51e6\u7406\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 schema_defs [type: String ] (\u5fc5\u9808\u30d1\u30e9\u30e1\u30fc\u30bf) fluent-plugin-arrow-file \u304c\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u51fa\u529b\u3059\u308b\u969b\u306e\u3001Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u5fc5\u9808\u3067\u3001\u4ee5\u4e0b\u306e\u5f62\u5f0f\u3067\u8a18\u8ff0\u3055\u308c\u305f\u6587\u5b57\u5217\u306b\u3088\u308a\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002 schema_defs := column_def1[,column_def2 ...] column_def := =[;] \u306f\u5217\u306e\u540d\u524d\u3067\u3059\u3002Fluentd\u304b\u3089arrow-file\u306b\u6e21\u3055\u308c\u308b\u9023\u60f3\u914d\u5217\u306e\u30ad\u30fc\u5024\u3068\u4e00\u81f4\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u306f\u5217\u306e\u30c7\u30fc\u30bf\u578b\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u8868\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u306f\u5217\u306e\u4ed8\u52a0\u5c5e\u6027\u3067\u3059\u3002\u73fe\u6642\u70b9\u3067\u306f\u4ee5\u4e0b\u306e\u5c5e\u6027\u306e\u307f\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002 stat_enabled ... \u5217\u306e\u7d71\u8a08\u60c5\u5831\u3092\u53ce\u96c6\u3057\u3001Record Batch\u3054\u3068\u306e\u6700\u5927\u5024/\u6700\u5c0f\u5024\u3092 max_values=... \u304a\u3088\u3073 min_values=... \u30ab\u30b9\u30bf\u30e0\u30e1\u30bf\u30c7\u30fc\u30bf\u3068\u3057\u3066\u57cb\u3081\u8fbc\u307f\u307e\u3059\u3002 \uff08\u4f8b\uff09 schema_defs \"ts=Timestamp;stat_enabled,dev_id=Uint32,temperature=Float32,humidity=Float32\" arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u30c7\u30fc\u30bf\u578b \u30c7\u30fc\u30bf\u578b \u8aac\u660e Int8 Int16 Int32 Int64 \u7b26\u53f7\u4ed8\u304d\u6574\u6570\u578b\u3067\u3001\u305d\u308c\u305e\u308c\u6307\u5b9a\u3057\u305f\u30d3\u30c3\u30c8\u5e45\u3092\u6301\u3061\u307e\u3059\u3002 Uint8 Uint16 Uint32 Uint64 \u7b26\u53f7\u306a\u3057\u6574\u6570\u578b\u3067\u3001\u305d\u308c\u305e\u308c\u6307\u5b9a\u3057\u305f\u30d3\u30c3\u30c8\u5e45\u3092\u6301\u3061\u307e\u3059\u3002 Float16 Float32 Float64 \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3001\u305d\u308c\u305e\u308c\u534a\u7cbe\u5ea6(16bit)\u3001\u5358\u7cbe\u5ea6(32bit)\u3001\u500d\u7cbe\u5ea6(64bit)\u306e\u5e45\u3092\u6301\u3061\u307e\u3059\u3002 Decimal Decimal128 128bit\u56fa\u5b9a\u5c0f\u6570\u70b9\u578b\u3067\u3059\u3002256bit\u56fa\u5b9a\u5c0f\u6570\u70b9\u578b\u306f\u73fe\u5728\u672a\u30b5\u30dd\u30fc\u30c8\u3067\u3059\u3002 Timestamp Timestamp[sec] Timestamp[ms] Timestamp[us] Timestamp[ns] \u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b\u3067\u3059\u3002\u7cbe\u5ea6\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6697\u9ed9\u306b [us] \u3092\u4ed8\u52a0\u3057\u305f\u3082\u306e\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002 Time Time[sec] Time[ms] Time[us] Time[ns] \u6642\u523b\u578b\u3067\u3059\u3002\u7cbe\u5ea6\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6697\u9ed9\u306b [sec] \u3092\u4ed8\u52a0\u3057\u305f\u3082\u306e\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002 Date Date[Day] Date[ms] \u65e5\u4ed8\u578b\u3067\u3059\u3002\u7cbe\u5ea6\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6697\u9ed9\u306b [day] \u3092\u4ed8\u52a0\u3057\u305f\u3082\u306e\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002 Utf8 \u6587\u5b57\u5217\u578b\u3067\u3059\u3002 Ipaddr4 IPv4\u30a2\u30c9\u30ec\u30b9\u578b\u3067\u3059\u3002\u5b9f\u969b\u306b\u306f byteWidth=4 \u3067\u3042\u308b FixedSizeBinary \u578b\u306b\u3001 pg_type=pg_catalog.inet \u3068\u3044\u3046\u30ab\u30b9\u30bf\u30e0\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u4ed8\u4e0e\u3057\u307e\u3059\u3002 Ipaddr6 IPv6\u30a2\u30c9\u30ec\u30b9\u578b\u3067\u3059\u3002\u5b9f\u969b\u306b\u306f byteWidth=16 \u3067\u3042\u308b FixedSizeBinary \u578b\u306b\u3001 pg_type=pg_catalog.inet \u3068\u3044\u3046\u30ab\u30b9\u30bf\u30e0\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u4ed8\u4e0e\u3057\u307e\u3059\u3002 ts_column [type: String / default: \u306a\u3057] \u6307\u5b9a\u3057\u305f\u5217\u306e\u5024\u3092\uff08 record \u9023\u60f3\u914d\u5217\u304b\u3089\u3067\u306f\u306a\u304f\uff09Fluentd\u304b\u3089\u6e21\u3055\u308c\u305f\u30ed\u30b0\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u5024\u3088\u308a\u53d6\u5f97\u3057\u307e\u3059\u3002 \u901a\u5e38\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3059\u308b\u5217\u306f Timestamp \u306a\u3069\u306e\u65e5\u4ed8\u6642\u523b\u578b\u3092\u6301\u3063\u3066\u304a\u308a\u3001\u307e\u305f stat_enabled \u5c5e\u6027\u3068\u4f75\u7528\u3059\u308b\u3053\u3068\u3067\u691c\u7d22\u51e6\u7406\u306e\u9ad8\u901f\u5316\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 tag_column [type: String / default: \u306a\u3057] \u6307\u5b9a\u3057\u305f\u5217\u306e\u5024\u3092\uff08 record \u9023\u60f3\u914d\u5217\u304b\u3089\u3067\u306f\u306a\u304f\uff09Fluentd\u304b\u3089\u6e21\u3055\u308c\u305f\u30ed\u30b0\u306e\u30bf\u30b0\u5024\u3088\u308a\u53d6\u5f97\u3057\u307e\u3059\u3002 \u901a\u5e38\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3059\u308b\u5217\u306f Utf8 \u306a\u3069\u306e\u6587\u5b57\u5217\u578b\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 filesize_threshold [type: Integer / default: 10000] fluent-plugin-arrow-file \u304c\u51fa\u529b\u5148\u30d5\u30a1\u30a4\u30eb\u3092\u5207\u308a\u66ff\u3048\u308b\u95be\u5024\u3092MB\u5358\u4f4d\u3067\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u304c\u7d0410GB\u3092\u8d8a\u3048\u305f\u8fba\u308a\u3067\u51fa\u529b\u5148\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002 \u4f7f\u7528\u4f8b \u7c21\u5358\u306a\u4f8b\u3068\u3057\u3066\u3001\u30ed\u30fc\u30ab\u30eb\u306eApache Httpd\u30b5\u30fc\u30d0\u306e\u30ed\u30b0\u3092\u76e3\u8996\u3057\u3001\u305d\u308c\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u6bce\u306b\u30d1\u30fc\u30b9\u3057\u3066Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002 \u3067 /var/log/httpd/access_log \u3092\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u6307\u5b9a\u3057\u3066\u3044\u308b\u307b\u304b\u3001 apache2 \u306eParse\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u7528\u3044\u3066\u3001host, user, time, method, path, code, size, referer, agent\u306e\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u5207\u308a\u51fa\u3057\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089\u306farrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u9023\u60f3\u914d\u5217\u3068\u3057\u3066\u6e21\u3055\u308c\u3001 \u5185\u306e schema_defs \u306b\u306f\u3001\u3053\u308c\u3089\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u5bfe\u5fdc\u3059\u308bApache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u5217\u5b9a\u7fa9\u3092\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\u3002 \u307e\u305f\u3001\u3053\u3053\u3067\u306f\u7c21\u5358\u306a\u4f7f\u7528\u4f8b\u3092\u793a\u3059\u3053\u3068\u304c\u76ee\u7684\u3067\u3059\u306e\u3067\u3001 \u30bf\u30b0\u3067\u30c1\u30e3\u30f3\u30af\u30b5\u30a4\u30ba\u3092\u6700\u59274MB / 200\u884c\u306b\u7e2e\u5c0f\u3057\u3001\u6700\u5927\u3067\u308210\u79d2\u3067Output\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u6e21\u3059\u3088\u3046\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002 /etc/td-agent/td-agent.conf \u306e\u8a2d\u5b9a\u4f8b @type tail path /var/log/httpd/access_log pos_file /var/log/td-agent/httpd_access.pos tag httpd format apache2 @type apache2 expression /^(?[^ ]*) [^ ]* (?[^ ]*) \\[(? @type arrow_file path /tmp/mytest%Y%m%d.%p.arrow schema_defs \"ts=Timestamp[sec],host=Utf8,method=Utf8,path=Utf8,code=Int32,size=Int32,referer=Utf8,agent=Utf8\" ts_column \"ts\" flush_interval 10s chunk_limit_size 4MB chunk_limit_records 200 td-agent \u3092\u8d77\u52d5\u3057\u307e\u3059\u3002 $ sudo systemctl start td-agent \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001Apache Httpd\u306e\u30ed\u30b0\u304c path \u3067\u8a2d\u5b9a\u3057\u305f /tmp/mytest%Y%m%d.%p.arrow \u304c\u5c55\u958b\u3055\u308c\u305f\u5148\u3067\u3042\u308b /tmp/mytest20220124.3206341.arrow \u306b\u66f8\u304d\u51fa\u3055\u308c\u3066\u3044\u307e\u3059\u3002 $ arrow2csv /tmp/mytest20220124.3206341.arrow --head --offset 300 --limit 10 \"ts\",\"host\",\"method\",\"path\",\"code\",\"size\",\"referer\",\"agent\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme_extra.js\",200,195,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme.js\",200,4401,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/fluentd_overview.png\",200,121459,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/main.js\",200,3027,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-regular.woff2\",200,182708,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/fontawesome-webfont.woff2?v=4.7.0\",200,77160,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/RobotoSlab/roboto-slab-v7-bold.woff2\",200,67312,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-bold.woff2\",200,184912,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/worker.js\",200,3724,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/favicon.ico\",200,1150,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \u3053\u308c\u3092 PG-Strom \u306eArrow_Fdw\u3092\u7528\u3044\u3066PostgreSQL\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3066\u307f\u307e\u3059\u3002 postgres=# IMPORT FOREIGN SCHEMA mytest FROM SERVER arrow_fdw INTO public OPTIONS (file '/tmp/mytest20220124.3206341.arrow'); IMPORT FOREIGN SCHEMA postgres=# SELECT ts, host, path FROM mytest WHERE code = 404; ts | host | path ---------------------+---------------+---------------------- 2022-01-24 12:02:06 | 192.168.77.73 | /~kaigai/ja/fluentd/ (1 row) postgres=# EXPLAIN SELECT ts, host, path FROM mytest WHERE code = 404; QUERY PLAN ------------------------------------------------------------------------------ Custom Scan (GpuScan) on mytest (cost=4026.12..4026.12 rows=3 width=72) GPU Filter: (code = 404) referenced: ts, host, path, code files0: /tmp/mytest20220124.3206341.arrow (read: 128.00KB, size: 133.94KB) (4 rows) \u751f\u6210\u3055\u308c\u305f Apache Arrow \u30d5\u30a1\u30a4\u30eb\u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3001\u3053\u308c\u3092SQL\u304b\u3089\u53c2\u7167\u3057\u3066\u3044\u307e\u3059\u3002 Fluentd\u5074\u3067\u6210\u5f62\u3055\u308c\u305f\u30ed\u30b0\u306e\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53c2\u7167\u3059\u308b\u691c\u7d22\u6761\u4ef6\u3092\u4e0e\u3048\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4e0a\u8a18\u306e\u4f8b\u3067\u306f\u3001HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9404\u306e\u30ed\u30b0\u3092\u691c\u7d22\u3057\u30011\u4ef6\u304c\u30d2\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002","title":"Fluentd\u9023\u643a"},{"location":"fluentd/#fluentd","text":"\u672c\u7ae0\u3067\u306f\u3001Apache Arrow\u30c7\u30fc\u30bf\u5f62\u5f0f\u3092\u4ecb\u3057\u305fFluentd\u3068\u306e\u9023\u643a\u3068\u3001IoT/M2M\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u52b9\u7387\u7684\u306a\u53d6\u308a\u8fbc\u307f\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"Fluentd\u9023\u643a"},{"location":"fluentd/#_1","text":"IoT/M2M\u3068\u3088\u3070\u308c\u308b\u6280\u8853\u9818\u57df\u306b\u304a\u3044\u3066\u306f\u3001PC\u3084\u30b5\u30fc\u30d0\u3060\u3051\u3067\u306a\u304f\u3001\u643a\u5e2f\u96fb\u8a71\u3084\u81ea\u52d5\u8eca\u3001\u5404\u7a2e\u30bb\u30f3\u30b5\u30fc\u306a\u3069\u306e\u30c7\u30d0\u30a4\u30b9\u304c\u751f\u6210\u3057\u305f\u5927\u91cf\u306e\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u84c4\u7a4d\u3057\u3001\u3053\u308c\u3092\u5206\u6790\u3059\u308b\u305f\u3081\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c\u6570\u591a\u304f\u958b\u767a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5927\u91cf\u306e\u30c7\u30d0\u30a4\u30b9\u304c\u6642\u3005\u523b\u3005\u3068\u751f\u6210\u3059\u308b\u30c7\u30fc\u30bf\u306f\u975e\u5e38\u306b\u5927\u304d\u306a\u30b5\u30a4\u30ba\u306b\u306a\u308a\u304c\u3061\u3067\u3001\u3053\u308c\u3092\u5b9f\u7528\u7684\u306a\u6642\u9593\u5185\u306b\u51e6\u7406\u3059\u308b\u306b\u306f\u3001\u7279\u5225\u306a\u5de5\u592b\u304c\u5fc5\u8981\u3068\u306a\u308b\u304b\u3089\u3067\u3059\u3002 PG-Strom\u306e\u5404\u7a2e\u6a5f\u80fd\u306f\u3001\u3053\u3046\u3044\u3063\u305f\u898f\u6a21\u306e\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u9ad8\u901f\u306b\u51e6\u7406\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u30fb\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3057\u304b\u3057\u4e00\u65b9\u3067\u3001\u3053\u3046\u3057\u305f\u898f\u6a21\u306e\u30c7\u30fc\u30bf\u306e\u691c\u7d22\u30fb\u96c6\u8a08\u304c\u53ef\u80fd\u306a\u72b6\u614b\u306b\u3059\u308b\u305f\u3081\u306b\u30c7\u30fc\u30bf\u3092\u79fb\u9001\u3057\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u53d6\u308a\u8fbc\u3080\u306b\u306f\u6642\u9593\u304c\u304b\u304b\u308a\u304c\u3061\u3067\u3059\u3002 \u305d\u3053\u3067\u3001PG-Strom\u306b\u306fFluentd\u5411\u3051\u306bApache Arrow\u5f62\u5f0f\u3067\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u51fa\u529b\u3059\u308b fluent-plugin-arrow-file \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u540c\u68b1\u3057\u3001\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u3068\u3044\u3046\u554f\u984c\u306b\u5bfe\u51e6\u3092\u8a66\u307f\u3066\u3044\u307e\u3059\u3002 Fluentd\u306f\u53e4\u6a4b\u8c9e\u4e4b\u6c0f\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u305f\u30ed\u30b0\u53ce\u96c6\u30c4\u30fc\u30eb\u3067\u3001Syslog\u306e\u3088\u3046\u306a\u30b5\u30fc\u30d0\u30ed\u30b0\u304b\u3089IoT/M2M\u6a5f\u5668\u306e\u30c7\u30d0\u30a4\u30b9\u30ed\u30b0\u306b\u81f3\u308b\u307e\u3067\u3001\u591a\u7a2e\u591a\u69d8\u306a\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u96c6\u7a4d\u30fb\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306b\u4e8b\u5b9f\u4e0a\u306e\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u3068\u3057\u3066\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3059\u3002 Ruby\u3067\u8a18\u8ff0\u3055\u308c\u305f\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u8ffd\u52a0\u306b\u3088\u308a\u3001\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u5165\u51fa\u529b\u3084\u52a0\u5de5\u3092\u81ea\u5728\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u30012022\u5e74\u73fe\u5728\u3001800\u7a2e\u985e\u3092\u8d8a\u3048\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u516c\u5f0fWeb\u30b5\u30a4\u30c8\u3067\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002 PG-Strom\u304c\u53d6\u308a\u6271\u3046\u3053\u3068\u306e\u3067\u304d\u308b\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f\u3001PostgreSQL Heap\u5f62\u5f0f\uff08\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30ca\u30eb\u884c\u30c7\u30fc\u30bf\uff09\u3068Apache Arrow\u5f62\u5f0f\uff08\u69cb\u9020\u5316\u5217\u30c7\u30fc\u30bf\uff09\u306e\uff12\u7a2e\u985e\u3067\u3059\u304c\u3001IoT/M2M\u9818\u57df\u3067\u60f3\u5b9a\u3055\u308c\u308b\u3088\u3046\u306a\u3001\u6642\u3005\u523b\u3005\u3068\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u304c\u767a\u751f\u3059\u308b\u3088\u3046\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u3057\u3066\u306f\u3001Apache Arrow\u5f62\u5f0f\u3092\u7528\u3044\u305f\u65b9\u304c\u5408\u7406\u7684\u3067\u3059\u3002","title":"\u6982\u8981"},{"location":"fluentd/#arrow-file","text":"\u4ee5\u4e0b\u3067\u306f\u3001Fluentd\u304c\u53ce\u96c6\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u3092Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u51fa\u529b\u3057\u3001\u3053\u308c\u3092PG-Strom\u3067\u53c2\u7167\u3059\u308b\u3068\u3044\u3046\u30a2\u30d7\u30ed\u30fc\u30c1\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u307e\u305f\u3001Fluentd\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u306f\u3001Treasure Data\u793e\u306e\u63d0\u4f9b\u3059\u308b\u5b89\u5b9a\u7248 td-agent \u3092\u4f7f\u7528\u3059\u308b\u3082\u306e\u3068\u3057\u307e\u3059\u3002 PG-Strom\u306b\u540c\u68b1\u306eFluentd\u5411\u3051Output\u30d7\u30e9\u30b0\u30a4\u30f3\u306e fluent-plugin-arrow-file \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u5229\u7528\u3059\u308b\u3068\u3001Fluentd\u304c\u53ce\u96c6\u3057\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u3001\u6307\u5b9a\u3057\u305f\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u6301\u3064Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u66f8\u304d\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002PG-Strom\u306eArrow_Fdw\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308c\u3070\u3053\u306eApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u53c2\u7167\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u307e\u305f\u4fdd\u5b58\u5148\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u304c\u9069\u5207\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308c\u3070\u3001GPU-Direct SQL\u3092\u7528\u3044\u305f\u9ad8\u901f\u306a\u8aad\u307f\u51fa\u3057\u3082\u53ef\u80fd\u3067\u3059\u3002 \u3053\u306e\u65b9\u6cd5\u306b\u306f\u4ee5\u4e0b\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002 - Fluentd \u304c\u51fa\u529b\u3057\u305f\u30c7\u30fc\u30bf\u3092\u305d\u306e\u307e\u307ePG-Strom\u3067\u8aad\u307f\u51fa\u305b\u308b\u305f\u3081\u3001\u6539\u3081\u3066DB\u3078\u30c7\u30fc\u30bf\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u3002 - \u5217\u30c7\u30fc\u30bf\u5f62\u5f0f\u3067\u3042\u308b\u305f\u3081\u3001\u691c\u7d22\u30fb\u96c6\u8a08\u51e6\u7406\u306b\u4f34\u3046\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u51fa\u3057\uff08I/O\u8ca0\u8377\uff09\u3092\u5fc5\u8981\u6700\u5c0f\u9650\u306b\u6291\u3048\u308b\u4e8b\u304c\u3067\u304d\u308b\u3002 - \u53e4\u304f\u306a\u3063\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u3082\u3001OS\u4e0a\u306e\u30d5\u30a1\u30a4\u30eb\u79fb\u52d5\u306e\u307f\u3067\u5b8c\u4e86\u3067\u304d\u308b\u3002 \u4e00\u65b9\u3067\u3001Apache Arrow\u5f62\u5f0f\u3067\u6027\u80fd\u4e0a\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u5f97\u308b\u306b\u306f\u3001Record Batch\u306e\u30b5\u30a4\u30ba\u3092\u3042\u308b\u7a0b\u5ea6\u5927\u304d\u304f\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u305f\u3081\u3001\u30ed\u30b0\u306e\u767a\u751f\u983b\u5ea6\u304c\u5c0f\u3055\u304f\u3001\u4e00\u5b9a\u30b5\u30a4\u30ba\u306e\u30ed\u30b0\u304c\u6e9c\u307e\u308b\u307e\u3067\u306b\u6642\u9593\u306e\u304b\u304b\u308b\u5834\u5408\u306b\u306f\u3001PostgreSQL\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u51fa\u529b\u3055\u305b\u308b\u306a\u3069\u3001\u5225\u306e\u65b9\u6cd5\u3092\u8a66\u3057\u305f\u65b9\u304c\u3088\u308a\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306b\u8fd1\u3044\u30ed\u30b0\u5206\u6790\u304c\u53ef\u80fd\u3067\u3057\u3087\u3046\u3002","title":"arrow-file \u30d7\u30e9\u30b0\u30a4\u30f3"},{"location":"fluentd/#_2","text":"Fluentd\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u306f\u3044\u304f\u3064\u304b\u30ab\u30c6\u30b4\u30ea\u304c\u3042\u308a\u3001\u5916\u90e8\u304b\u3089\u30ed\u30b0\u3092\u53d7\u3051\u53d6\u308bInput\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u30ed\u30b0\u3092\u6210\u5f62\u3059\u308bParser\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u53d7\u4fe1\u3057\u305f\u30ed\u30b0\u3092\u4e00\u6642\u7684\u306b\u84c4\u7a4d\u3059\u308bBuffer\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u30ed\u30b0\u3092\u51fa\u529b\u3059\u308bOutput\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u306a\u3069\u306e\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u3002 arrow-file\u306fOutput\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4e00\u3064\u3067\u3059\u304c\u3001\u3053\u308c\u306fBuffer\u30d7\u30e9\u30b0\u30a4\u30f3\u304b\u3089\u6e21\u3055\u308c\u305f\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u56fa\u307e\u308a(chunk)\u3092\u3001\u30b3\u30f3\u30d5\u30a3\u30b0\u3067\u6307\u5b9a\u3055\u308c\u305f\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u6301\u3064Apache Arrow\u5f62\u5f0f\u3067\u66f8\u304d\u51fa\u3059\u5f79\u5272\u3092\u62c5\u3063\u3066\u3044\u307e\u3059\u3002 Input/Parser\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u5f79\u5272\u306f\u3001\u5916\u90e8\u304b\u3089\u53d7\u3051\u53d6\u3063\u305f\u30ed\u30b0\u3092\u5171\u901a\u306e\u5f62\u5f0f\u306b\u5909\u63db\u3057\u3001Buffer\u30d7\u30e9\u30b0\u30a4\u30f3\u3084Output\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u5165\u529b\u30c7\u30fc\u30bf\u306e\u5f62\u5f0f\u3092\u610f\u8b58\u3059\u308b\u3053\u3068\u306a\u304f\u6271\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u3059\u3002 \u3053\u308c\u306f\u5185\u90e8\u7684\u306b\u306f\u3001\u30ed\u30b0\u306e\u632f\u308a\u5206\u3051\u306b\u5229\u7528\u3059\u308b\u3053\u3068\u306e\u3067\u304d\u308b\u8b58\u5225\u5b50\u306e tag \u3001\u30ed\u30b0\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7 time \u3001\u304a\u3088\u3073\u751f\u30ed\u30b0\u3092\u6210\u5f62\u3057\u305f\u9023\u60f3\u914d\u5217\u3067\u3042\u308b record \u306e\u7d44\u3067\u3059\u3002 arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001 tag \u3001 time \u306e\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u3068\u3001 record \u9023\u60f3\u914d\u5217\u306e\u5404\u8981\u7d20\uff08\u4e00\u90e8\u3092\u7701\u7565\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\uff09\u3092\u5217\u3068\u3057\u3066\u6301\u3064Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u66f8\u304d\u51fa\u3057\u3092\u884c\u3044\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001\u51fa\u529b\u5148\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3068\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u60c5\u5831\uff08\u9023\u60f3\u914d\u5217\u306e\u8981\u7d20\u3068\u5217/\u578b\u306e\u30de\u30c3\u30d4\u30f3\u30b0\uff09\u306f\u5fc5\u9808\u306e\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3059\u3002","title":"\u5185\u90e8\u69cb\u9020"},{"location":"fluentd/#_3","text":"\u4f7f\u7528\u3057\u3066\u3044\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u7528\u306e td-agent \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u307e\u305f\u3001arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u306f rake-compiler \u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u306e\u3067\u3001\u4e88\u3081\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3059\u3002 \u8a73\u3057\u304f\u306f \u3053\u3061\u3089 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 $ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent4.sh | sh $ sudo /opt/td-agent/bin/fluent-gem install rake-compiler \u6b21\u306b\u3001PG-Strom\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001 fluentd \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u306e\u7269\u4ef6\u3092\u30d3\u30eb\u30c9\u3057\u307e\u3059\u3002 $ git clone https://github.com/heterodb/pg-strom.git $ cd pg-strom/fluentd $ make TD_AGENT=1 gem $ sudo make TD_AGENT=1 install Fluentd\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 $ /opt/td-agent/bin/fluent-gem list | grep arrow fluent-plugin-arrow-file (0.2)","title":"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"fluentd/#_4","text":"\u524d\u8ff0\u306e\u901a\u308a\u3001arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u52d5\u4f5c\u3055\u305b\u308b\u306b\u306f\u3001\u51fa\u529b\u5148\u306e\u30d1\u30b9\u540d\u3068\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u6700\u4f4e\u9650\u5fc5\u8981\u3067\u3059\u3002 \u3053\u308c\u306b\u52a0\u3048\u3066\u3001Apache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u69cb\u9020\u4e0a\u3001Record Batch\u3068\u547c\u3070\u308c\u308b\u30c7\u30fc\u30bf\u306e\u56fa\u307e\u308a\u306f\u3042\u308b\u7a0b\u5ea6\u5927\u304d\u306a\u30b5\u30a4\u30ba\u3067\u533a\u5207\u3063\u3066\u304a\u3044\u305f\u65b9\u304c\u3001\u691c\u7d22\u30fb\u96c6\u8a08\u51e6\u7406\u3092\u884c\u3046\u969b\u306e\u51e6\u7406\u6027\u80fd\u3092\u5f15\u304d\u51fa\u3057\u3084\u3059\u3044\u3067\u3059\u3002 arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001Buffer\u30d7\u30e9\u30b0\u30a4\u30f3\u304b\u3089\u6e21\u3055\u308c\u308bchunk\u3054\u3068\u306bRecord Batch\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u3001Buffer\u30d7\u30e9\u30b0\u30a4\u30f3\u5074\u306e\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u306f\u3053\u308c\u306b\u6e96\u3058\u305f\u8a2d\u5b9a\u3092\u884c\u3046\u3079\u304d\u3067\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f 256MB \u306e\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u3092\u53d6\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 path [type: String ] (\u5fc5\u9808\u30d1\u30e9\u30e1\u30fc\u30bf) arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u30ed\u30b0\u3092\u51fa\u529b\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u5fc5\u9808\u3067\u3001\u4ee5\u4e0b\u306e\u66f8\u5f0f\u6587\u5b57\u3092\u542b\u3081\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u66f8\u5f0f \u8aac\u660e %Y \u73fe\u5728\u306e\u5e74\u3092\u897f\u66a64\u6841\u3067\u8868\u73fe\u3057\u305f\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %y \u73fe\u5728\u306e\u5e74\u306e\u897f\u66a6\u4e0b2\u6841\u3067\u8868\u73fe\u3057\u305f\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %m \u73fe\u5728\u306e\u6708\u3092 01\uff5e12 \u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %d \u73fe\u5728\u306e\u65e5\u3092 01\uff5e31 \u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %H \u73fe\u5728\u6642\u523b\u306e\u6642\u309200\uff5e23\u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %M \u73fe\u5728\u6642\u523b\u306e\u5206\u309200\uff5e59\u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %S \u73fe\u5728\u6642\u523b\u306e\u79d2\u309200\uff5e59\u3067\u8868\u3057\u305f2\u6841\u306e\u6570\u5024\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 %p \u73fe\u5728\u306e Fluentd \u30d7\u30ed\u30bb\u30b9\u306ePID\u3067\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 \u66f8\u5f0f\u6587\u5b57\u5217\u306f\u30c1\u30e3\u30f3\u30af\u3092\u66f8\u304d\u51fa\u3059\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u8a55\u4fa1\u3055\u308c\u3001\u540c\u540d\u306eApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306b\u306f\u3001Record Batch\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306fApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u65b0\u898f\u4f5c\u6210\u3057\u3001\u6700\u521d\u306eRecord Batch\u3092\u66f8\u304d\u51fa\u3057\u307e\u3059\u3002 \u305f\u3060\u3057\u3001\u65e2\u5b58\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u304c\u5f8c\u8ff0\u306e filesize_threshold \u8a2d\u5b9a\u5024\u3092\u8d8a\u3048\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u65e2\u5b58\u30d5\u30a1\u30a4\u30eb\u3092\u30ea\u30cd\u30fc\u30e0\u3057\u305f\u5f8c\u3001\u65b0\u898f\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \uff08\u4f8b\uff09`path /tmp/arrow_logs/my_logs_%y%m%d.%p.log` \u51fa\u529b\u5148\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u30c1\u30e3\u30f3\u30af\u3092\u66f8\u304d\u51fa\u3059\u305f\u3073\u306b\u30d5\u30c3\u30bf\u9818\u57df\u3092\u66f4\u65b0\u3057\u3066\u5168\u3066\u306eRecord Batch\u3092\u30dd\u30a4\u30f3\u30c8\u3057\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u751f\u6210\u3055\u308c\u305fApache Arrow\u30d5\u30a1\u30a4\u30eb\u306f\u5373\u5ea7\u306b\u8aad\u307f\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u30a2\u30af\u30bb\u30b9\u7af6\u5408\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u306f lockf(3) \u3092\u7528\u3044\u3066\u6392\u4ed6\u51e6\u7406\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 schema_defs [type: String ] (\u5fc5\u9808\u30d1\u30e9\u30e1\u30fc\u30bf) fluent-plugin-arrow-file \u304c\u30ed\u30b0\u30c7\u30fc\u30bf\u3092\u51fa\u529b\u3059\u308b\u969b\u306e\u3001Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u5fc5\u9808\u3067\u3001\u4ee5\u4e0b\u306e\u5f62\u5f0f\u3067\u8a18\u8ff0\u3055\u308c\u305f\u6587\u5b57\u5217\u306b\u3088\u308a\u30b9\u30ad\u30fc\u30de\u69cb\u9020\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002 schema_defs := column_def1[,column_def2 ...] column_def := =[;] \u306f\u5217\u306e\u540d\u524d\u3067\u3059\u3002Fluentd\u304b\u3089arrow-file\u306b\u6e21\u3055\u308c\u308b\u9023\u60f3\u914d\u5217\u306e\u30ad\u30fc\u5024\u3068\u4e00\u81f4\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u306f\u5217\u306e\u30c7\u30fc\u30bf\u578b\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u8868\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u306f\u5217\u306e\u4ed8\u52a0\u5c5e\u6027\u3067\u3059\u3002\u73fe\u6642\u70b9\u3067\u306f\u4ee5\u4e0b\u306e\u5c5e\u6027\u306e\u307f\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002 stat_enabled ... \u5217\u306e\u7d71\u8a08\u60c5\u5831\u3092\u53ce\u96c6\u3057\u3001Record Batch\u3054\u3068\u306e\u6700\u5927\u5024/\u6700\u5c0f\u5024\u3092 max_values=... \u304a\u3088\u3073 min_values=... \u30ab\u30b9\u30bf\u30e0\u30e1\u30bf\u30c7\u30fc\u30bf\u3068\u3057\u3066\u57cb\u3081\u8fbc\u307f\u307e\u3059\u3002 \uff08\u4f8b\uff09 schema_defs \"ts=Timestamp;stat_enabled,dev_id=Uint32,temperature=Float32,humidity=Float32\" arrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u30c7\u30fc\u30bf\u578b \u30c7\u30fc\u30bf\u578b \u8aac\u660e Int8 Int16 Int32 Int64 \u7b26\u53f7\u4ed8\u304d\u6574\u6570\u578b\u3067\u3001\u305d\u308c\u305e\u308c\u6307\u5b9a\u3057\u305f\u30d3\u30c3\u30c8\u5e45\u3092\u6301\u3061\u307e\u3059\u3002 Uint8 Uint16 Uint32 Uint64 \u7b26\u53f7\u306a\u3057\u6574\u6570\u578b\u3067\u3001\u305d\u308c\u305e\u308c\u6307\u5b9a\u3057\u305f\u30d3\u30c3\u30c8\u5e45\u3092\u6301\u3061\u307e\u3059\u3002 Float16 Float32 Float64 \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3001\u305d\u308c\u305e\u308c\u534a\u7cbe\u5ea6(16bit)\u3001\u5358\u7cbe\u5ea6(32bit)\u3001\u500d\u7cbe\u5ea6(64bit)\u306e\u5e45\u3092\u6301\u3061\u307e\u3059\u3002 Decimal Decimal128 128bit\u56fa\u5b9a\u5c0f\u6570\u70b9\u578b\u3067\u3059\u3002256bit\u56fa\u5b9a\u5c0f\u6570\u70b9\u578b\u306f\u73fe\u5728\u672a\u30b5\u30dd\u30fc\u30c8\u3067\u3059\u3002 Timestamp Timestamp[sec] Timestamp[ms] Timestamp[us] Timestamp[ns] \u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b\u3067\u3059\u3002\u7cbe\u5ea6\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6697\u9ed9\u306b [us] \u3092\u4ed8\u52a0\u3057\u305f\u3082\u306e\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002 Time Time[sec] Time[ms] Time[us] Time[ns] \u6642\u523b\u578b\u3067\u3059\u3002\u7cbe\u5ea6\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6697\u9ed9\u306b [sec] \u3092\u4ed8\u52a0\u3057\u305f\u3082\u306e\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002 Date Date[Day] Date[ms] \u65e5\u4ed8\u578b\u3067\u3059\u3002\u7cbe\u5ea6\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6697\u9ed9\u306b [day] \u3092\u4ed8\u52a0\u3057\u305f\u3082\u306e\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002 Utf8 \u6587\u5b57\u5217\u578b\u3067\u3059\u3002 Ipaddr4 IPv4\u30a2\u30c9\u30ec\u30b9\u578b\u3067\u3059\u3002\u5b9f\u969b\u306b\u306f byteWidth=4 \u3067\u3042\u308b FixedSizeBinary \u578b\u306b\u3001 pg_type=pg_catalog.inet \u3068\u3044\u3046\u30ab\u30b9\u30bf\u30e0\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u4ed8\u4e0e\u3057\u307e\u3059\u3002 Ipaddr6 IPv6\u30a2\u30c9\u30ec\u30b9\u578b\u3067\u3059\u3002\u5b9f\u969b\u306b\u306f byteWidth=16 \u3067\u3042\u308b FixedSizeBinary \u578b\u306b\u3001 pg_type=pg_catalog.inet \u3068\u3044\u3046\u30ab\u30b9\u30bf\u30e0\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u4ed8\u4e0e\u3057\u307e\u3059\u3002 ts_column [type: String / default: \u306a\u3057] \u6307\u5b9a\u3057\u305f\u5217\u306e\u5024\u3092\uff08 record \u9023\u60f3\u914d\u5217\u304b\u3089\u3067\u306f\u306a\u304f\uff09Fluentd\u304b\u3089\u6e21\u3055\u308c\u305f\u30ed\u30b0\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u5024\u3088\u308a\u53d6\u5f97\u3057\u307e\u3059\u3002 \u901a\u5e38\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3059\u308b\u5217\u306f Timestamp \u306a\u3069\u306e\u65e5\u4ed8\u6642\u523b\u578b\u3092\u6301\u3063\u3066\u304a\u308a\u3001\u307e\u305f stat_enabled \u5c5e\u6027\u3068\u4f75\u7528\u3059\u308b\u3053\u3068\u3067\u691c\u7d22\u51e6\u7406\u306e\u9ad8\u901f\u5316\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 tag_column [type: String / default: \u306a\u3057] \u6307\u5b9a\u3057\u305f\u5217\u306e\u5024\u3092\uff08 record \u9023\u60f3\u914d\u5217\u304b\u3089\u3067\u306f\u306a\u304f\uff09Fluentd\u304b\u3089\u6e21\u3055\u308c\u305f\u30ed\u30b0\u306e\u30bf\u30b0\u5024\u3088\u308a\u53d6\u5f97\u3057\u307e\u3059\u3002 \u901a\u5e38\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3059\u308b\u5217\u306f Utf8 \u306a\u3069\u306e\u6587\u5b57\u5217\u578b\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 filesize_threshold [type: Integer / default: 10000] fluent-plugin-arrow-file \u304c\u51fa\u529b\u5148\u30d5\u30a1\u30a4\u30eb\u3092\u5207\u308a\u66ff\u3048\u308b\u95be\u5024\u3092MB\u5358\u4f4d\u3067\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u304c\u7d0410GB\u3092\u8d8a\u3048\u305f\u8fba\u308a\u3067\u51fa\u529b\u5148\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002","title":"\u8a2d\u5b9a"},{"location":"fluentd/#_5","text":"\u7c21\u5358\u306a\u4f8b\u3068\u3057\u3066\u3001\u30ed\u30fc\u30ab\u30eb\u306eApache Httpd\u30b5\u30fc\u30d0\u306e\u30ed\u30b0\u3092\u76e3\u8996\u3057\u3001\u305d\u308c\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u6bce\u306b\u30d1\u30fc\u30b9\u3057\u3066Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002 \u3067 /var/log/httpd/access_log \u3092\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u6307\u5b9a\u3057\u3066\u3044\u308b\u307b\u304b\u3001 apache2 \u306eParse\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u7528\u3044\u3066\u3001host, user, time, method, path, code, size, referer, agent\u306e\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u5207\u308a\u51fa\u3057\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089\u306farrow-file\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u9023\u60f3\u914d\u5217\u3068\u3057\u3066\u6e21\u3055\u308c\u3001 \u5185\u306e schema_defs \u306b\u306f\u3001\u3053\u308c\u3089\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u5bfe\u5fdc\u3059\u308bApache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u5217\u5b9a\u7fa9\u3092\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\u3002 \u307e\u305f\u3001\u3053\u3053\u3067\u306f\u7c21\u5358\u306a\u4f7f\u7528\u4f8b\u3092\u793a\u3059\u3053\u3068\u304c\u76ee\u7684\u3067\u3059\u306e\u3067\u3001 \u30bf\u30b0\u3067\u30c1\u30e3\u30f3\u30af\u30b5\u30a4\u30ba\u3092\u6700\u59274MB / 200\u884c\u306b\u7e2e\u5c0f\u3057\u3001\u6700\u5927\u3067\u308210\u79d2\u3067Output\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u6e21\u3059\u3088\u3046\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002 /etc/td-agent/td-agent.conf \u306e\u8a2d\u5b9a\u4f8b @type tail path /var/log/httpd/access_log pos_file /var/log/td-agent/httpd_access.pos tag httpd format apache2 @type apache2 expression /^(?[^ ]*) [^ ]* (?[^ ]*) \\[(? @type arrow_file path /tmp/mytest%Y%m%d.%p.arrow schema_defs \"ts=Timestamp[sec],host=Utf8,method=Utf8,path=Utf8,code=Int32,size=Int32,referer=Utf8,agent=Utf8\" ts_column \"ts\" flush_interval 10s chunk_limit_size 4MB chunk_limit_records 200 td-agent \u3092\u8d77\u52d5\u3057\u307e\u3059\u3002 $ sudo systemctl start td-agent \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001Apache Httpd\u306e\u30ed\u30b0\u304c path \u3067\u8a2d\u5b9a\u3057\u305f /tmp/mytest%Y%m%d.%p.arrow \u304c\u5c55\u958b\u3055\u308c\u305f\u5148\u3067\u3042\u308b /tmp/mytest20220124.3206341.arrow \u306b\u66f8\u304d\u51fa\u3055\u308c\u3066\u3044\u307e\u3059\u3002 $ arrow2csv /tmp/mytest20220124.3206341.arrow --head --offset 300 --limit 10 \"ts\",\"host\",\"method\",\"path\",\"code\",\"size\",\"referer\",\"agent\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme_extra.js\",200,195,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme.js\",200,4401,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/fluentd_overview.png\",200,121459,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/main.js\",200,3027,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-regular.woff2\",200,182708,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/fontawesome-webfont.woff2?v=4.7.0\",200,77160,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/RobotoSlab/roboto-slab-v7-bold.woff2\",200,67312,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-bold.woff2\",200,184912,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/worker.js\",200,3724,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/favicon.ico\",200,1150,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \u3053\u308c\u3092 PG-Strom \u306eArrow_Fdw\u3092\u7528\u3044\u3066PostgreSQL\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3066\u307f\u307e\u3059\u3002 postgres=# IMPORT FOREIGN SCHEMA mytest FROM SERVER arrow_fdw INTO public OPTIONS (file '/tmp/mytest20220124.3206341.arrow'); IMPORT FOREIGN SCHEMA postgres=# SELECT ts, host, path FROM mytest WHERE code = 404; ts | host | path ---------------------+---------------+---------------------- 2022-01-24 12:02:06 | 192.168.77.73 | /~kaigai/ja/fluentd/ (1 row) postgres=# EXPLAIN SELECT ts, host, path FROM mytest WHERE code = 404; QUERY PLAN ------------------------------------------------------------------------------ Custom Scan (GpuScan) on mytest (cost=4026.12..4026.12 rows=3 width=72) GPU Filter: (code = 404) referenced: ts, host, path, code files0: /tmp/mytest20220124.3206341.arrow (read: 128.00KB, size: 133.94KB) (4 rows) \u751f\u6210\u3055\u308c\u305f Apache Arrow \u30d5\u30a1\u30a4\u30eb\u3092\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3001\u3053\u308c\u3092SQL\u304b\u3089\u53c2\u7167\u3057\u3066\u3044\u307e\u3059\u3002 Fluentd\u5074\u3067\u6210\u5f62\u3055\u308c\u305f\u30ed\u30b0\u306e\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53c2\u7167\u3059\u308b\u691c\u7d22\u6761\u4ef6\u3092\u4e0e\u3048\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4e0a\u8a18\u306e\u4f8b\u3067\u306f\u3001HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9404\u306e\u30ed\u30b0\u3092\u691c\u7d22\u3057\u30011\u4ef6\u304c\u30d2\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002","title":"\u4f7f\u7528\u4f8b"},{"location":"gpucache/","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5 \u6982\u8981 GPU\u306b\u306f\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u306eRAM\u3068\u306f\u72ec\u7acb\u306a\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u304c\u642d\u8f09\u3055\u308c\u3066\u304a\u308a\u3001GPU\u3067\u8a08\u7b97\u3059\u308b\u306b\u306fPCI-E\u30d0\u30b9\u306a\u3069\u3092\u901a\u3058\u3066\u3001\u4e00\u65e6\u3001\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u3084\u30b9\u30c8\u30ec\u30fc\u30b8\u30c7\u30d0\u30a4\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u5074\u3078\u8ee2\u9001\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 PG-Strom\u304cSQL\u30af\u30a8\u30ea\u3092GPU\u3067\u51e6\u7406\u3059\u308b\u5834\u5408\u3082\u4f8b\u5916\u3067\u306f\u306a\u304f\u3001\u5185\u90e8\u7684\u306b\u306f\u3001PostgreSQL\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30ec\u30b3\u30fc\u30c9\u3092GPU\u3078\u3068\u8ee2\u9001\u3057\u3001\u305d\u306e\u4e0a\u3067GPU\u3067SQL\u306e\u5404\u7a2e\u51e6\u7406\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 \u3057\u304b\u3057\u3053\u308c\u3089\u306e\u51e6\u7406\u306b\u306f\u3001\u591a\u304b\u308c\u5c11\u306a\u304b\u308c\u30c6\u30fc\u30d6\u30eb\u306e\u8aad\u307f\u51fa\u3057\u3084\u30c7\u30fc\u30bf\u306e\u8ee2\u9001\u306b\u6642\u9593\u3092\u8981\u3057\u307e\u3059\uff08\u591a\u304f\u306e\u5834\u5408\u3001GPU\u3067\u306e\u51e6\u7406\u3088\u308a\u3082\u9065\u304b\u306b\u9577\u3044\u6642\u9593\u306e\uff01\uff09\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\uff08GPU Cache\uff09\u3068\u306f\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u4e88\u3081\u9818\u57df\u3092\u78ba\u4fdd\u3057\u3066\u304a\u304d\u3001\u305d\u3053\u306bPostgreSQL\u30c6\u30fc\u30d6\u30eb\u306e\u8907\u88fd\u3092\u4fdd\u6301\u3057\u3066\u304a\u304f\u6a5f\u80fd\u3067\u3059\u3002 \u6bd4\u8f03\u7684\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u306e\u5c0f\u3055\u306a\uff08\uff5e10GB\u7a0b\u5ea6\uff09\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u3001\u66f4\u65b0\u983b\u5ea6\u304c\u9ad8\u3044\u3046\u3048\u306b\u3001\u3057\u3070\u3057\u3070\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u691c\u7d22/\u5206\u6790\u7cfb\u306eSQL\u3092\u5b9f\u884c\u3059\u308b\u3068\u3044\u3046\u30d1\u30bf\u30fc\u30f3\u3092\u610f\u56f3\u3057\u3066\u3044\u307e\u3059\u3002 \u5f8c\u8ff0\u3059\u308b\u30ed\u30b0\u30d9\u30fc\u30b9\u306e\u540c\u671f\u30e1\u30ab\u30cb\u30ba\u30e0\u306b\u3088\u308a\u3001\u4e26\u5217\u5ea6\u306e\u9ad8\u3044\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30ca\u30eb\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u59a8\u3052\u308b\u3053\u3068\u306a\u304fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6700\u65b0\u306e\u72b6\u614b\u306b\u4fdd\u3064\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u305d\u306e\u4e00\u65b9\u3067\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306eSQL\u3092\u5b9f\u884c\u3059\u308b\u969b\u306b\u306f\u65e2\u306bGPU\u4e0a\u306b\u30c7\u30fc\u30bf\u304c\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u6539\u3081\u3066\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30ec\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u51fa\u3057\u305f\u308a\u3001PCI-E\u30d0\u30b9\u3092\u4ecb\u3057\u3066\u30c7\u30fc\u30bf\u3092\u8ee2\u9001\u3057\u305f\u308a\u3059\u308b\u4e8b\u306a\u304f\u3001SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5178\u578b\u7684\u306a\u5229\u7528\u30b7\u30fc\u30f3\u3068\u3057\u3066\u306f\u3001\u81ea\u52d5\u8eca\u3084\u643a\u5e2f\u96fb\u8a71\u3068\u3044\u3063\u305f\u30e2\u30d0\u30a4\u30eb\u30c7\u30d0\u30a4\u30b9\u306e\u4f4d\u7f6e\u60c5\u5831\uff08\u73fe\u5728\u4f4d\u7f6e\uff09\u3092\u6642\u3005\u523b\u3005\u53ce\u96c6\u3057\u3001 GPU\u7248PostGIS \u306a\u3069\u3092\u7528\u3044\u3066\u4ed6\u306e\u30c7\u30fc\u30bf\u3068\u7a81\u304d\u5408\u308f\u305b\u308b\u3068\u3044\u3063\u305f\u30b1\u30fc\u30b9\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u3002 \u591a\u6570\u306e\u30c7\u30d0\u30a4\u30b9\u304b\u3089\u9001\u51fa\u3055\u308c\u308b\u4f4d\u7f6e\u60c5\u5831\u306e\u66f4\u65b0\u306f\u6975\u3081\u3066\u66f4\u65b0\u30d8\u30d3\u30fc\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u304c\u3001\u4e00\u65b9\u3067\u3001\u6700\u65b0\u306e\u4f4d\u7f6e\u60c5\u5831\u306b\u57fa\u3065\u3044\u3066\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u3082\u3042\u308b\u305f\u3081\u3001\u3053\u308c\u3089\u66f4\u65b0\u30c7\u30fc\u30bf\u3092\u9045\u6ede\u306a\u304fGPU\u5074\u3078\u9069\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u306b\u306f\u5236\u7d04\u304c\u3042\u308a\u307e\u3059\u304c\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u9ad8\u983b\u5ea6\u306e\u66f4\u65b0\u3068\u3001\u9ad8\u6027\u80fd\u306a\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u3092\u4e21\u7acb\u3059\u308b\u4e00\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002 \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3067\u306f\u3001\u4e26\u5217\u5ea6\u306e\u9ad8\u3044\u66f4\u65b0\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u5fdc\u3059\u308b\u3053\u3068\u3068\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u304c\u5e38\u306b\u6700\u65b0\u306e\u30c7\u30fc\u30bf\u3092\u53c2\u7167\u3059\u308b\u3068\u3044\u30462\u3064\u306e\u8981\u4ef6\u3092\u30af\u30ea\u30a2\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u591a\u304f\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u306fCPU\u3068GPU\u306fPCI-E\u30d0\u30b9\u3092\u4ecb\u3057\u3066\u63a5\u7d9a\u3055\u308c\u3001\u305d\u306e\u901a\u4fe1\u306b\u306f\u76f8\u5fdc\u306e\u30ec\u30a4\u30c6\u30f3\u30b7\u304c\u767a\u751f\u3057\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u304c1\u884c\u66f4\u65b0\u3055\u308c\u308b\u305f\u3073\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u540c\u671f\u3057\u3066\u3044\u3066\u306f\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u6027\u80fd\u306b\u5927\u304d\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u3066\u3057\u307e\u3044\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3059\u308b\u3068\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u7528\u306e\u30e1\u30e2\u30ea\u9818\u57df\u3092\u78ba\u4fdd\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u30db\u30b9\u30c8\u5074\u5171\u6709\u30e1\u30e2\u30ea\u4e0a\u306bREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u306e\u66f4\u65b0\u3092\u4f34\u3046SQL\u30b3\u30de\u30f3\u30c9\uff08INSERT\u3001UPDATE\u3001DELETE\uff09\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001AFTER ROW\u30c8\u30ea\u30ac\u306b\u3088\u3063\u3066\u66f4\u65b0\u5185\u5bb9\u304cREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u30b3\u30d4\u30fc\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u306e\u51e6\u7406\u306fGPU\u3078\u306e\u547c\u3073\u51fa\u3057\u3092\u4f34\u308f\u306a\u3044\u3001CPU\u3068RAM\u3060\u3051\u3067\u5b8c\u7d50\u3059\u308b\u51e6\u7406\u3067\u3059\u306e\u3067\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u6027\u80fd\u3078\u306e\u5f71\u97ff\u306f\u307b\u3068\u3093\u3069\u3042\u308a\u307e\u305b\u3093\u3002 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u304c\u4e00\u5b9a\u91cf\u305f\u307e\u308b\u304b\u3001\u6700\u5f8c\u306e\u66f8\u304d\u8fbc\u307f\u304b\u3089\u4e00\u5b9a\u6642\u9593\u304c\u7d4c\u904e\u3059\u308b\u3068\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\uff08GPU memory keeper\uff09\u306b\u3088\u3063\u3066\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u306fGPU\u3078\u30ed\u30fc\u30c9\u3055\u308c\u3001\u66f4\u65b0\u5dee\u5206\u3092GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u9069\u7528\u3057\u307e\u3059\u3002 \u3053\u306e\u6642\u3001REDO\u30ed\u30b0\u306f\u307e\u3068\u3081\u3066GPU\u306b\u8ee2\u9001\u3055\u308c\u3001\u3055\u3089\u306bGPU\u306e\u6570\u5343\u30d7\u30ed\u30bb\u30c3\u30b5\u30b3\u30a2\u304c\u4e26\u5217\u306bREDO\u30ed\u30b0\u3092\u9069\u7528\u3059\u308b\u305f\u3081\u3001\u901a\u5e38\u306f\u51e6\u7406\u9045\u5ef6\u304c\u554f\u984c\u3068\u306a\u308b\u4e8b\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u3092\u53c2\u7167\u3059\u308b\u969b\u306b\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3057\u3066GPU\u306b\u30ed\u30fc\u30c9\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u65e2\u306bGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u5272\u5f53\u3066\u6e08\u307f\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u5148\u7acb\u3063\u3066\u3001\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u958b\u59cb\u6642\u70b9\u3067\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u3001\u3053\u308c\u3089\u306f\u5168\u3066\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u524d\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3078\u9069\u7528\u3055\u308c\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u304c\u5bfe\u8c61\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u305f\u7d50\u679c\u306f\u3001\u76f4\u63a5\u30c6\u30fc\u30d6\u30eb\u3092\u53c2\u7167\u3057\u305f\u5834\u5408\u3068\u540c\u3058\u7d50\u679c\u3092\u8fd4\u3059\u4e8b\u3068\u306a\u308a\u3001\u554f\u3044\u5408\u308f\u305b\u306e\u4e00\u8cab\u6027\u306f\u5e38\u306b\u4fdd\u6301\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u8a2d\u5b9a GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6709\u52b9\u306b\u3059\u308b\u306b\u306f\u3001\u5bfe\u8c61\u3068\u306a\u308b\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066 pgstrom.gpucache_sync_trigger() \u95a2\u6570\u3092\u5b9f\u884c\u3059\u308bAFTER INSERT OR UPDATE OR DELETE\u306e\u884c\u30c8\u30ea\u30ac\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b9\u30ec\u30fc\u30d6\u5074\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u3053\u306e\u30c8\u30ea\u30ac\u306e\u767a\u884c\u30e2\u30fc\u30c9\u304c ALWAYS \u3067\u3042\u308b\u4e8b\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u30c6\u30fc\u30d6\u30eb dpoints \u306b\u5bfe\u3057\u3066GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3059\u308b\u4f8b\u3067\u3059\u3002 =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; Note PostgreSQL v12.x \u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u304a\u3051\u308b\u8ffd\u52a0\u8a2d\u5b9a PostgreSQL v12\u304a\u3088\u3073\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u3001\u4e0a\u8a18\u306e\u30c8\u30ea\u30ac\u306b\u52a0\u3048\u3066\u3001 pgstrom.gpucache_sync_trigger() \u95a2\u6570\u3092\u5b9f\u884c\u3059\u308bBEFORE TRUNCATE\u306e\u69cb\u6587\u30c8\u30ea\u30ac\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002 \u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b9\u30ec\u30fc\u30d6\u5074\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u3001\u540c\u69d8\u306b\u3001\u3053\u306e\u30c8\u30ea\u30ac\u306e\u767a\u884c\u30e2\u30fc\u30c9\u304c ALWAYS \u3067\u3042\u308b\u4e8b\u304c\u5fc5\u8981\u3067\u3059\u3002 PostgreSQL v13\u3067\u306fObject Access Hook\u304c\u62e1\u5f35\u3055\u308c\u3001\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u30c8\u30ea\u30ac\u8a2d\u5b9a\u306a\u3057\u3067 TRUNCATE\u306e\u5b9f\u884c\u3092\u6355\u6349\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u3057\u304b\u3057\u305d\u308c\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u3001TRUNCATE\u3092\u6355\u6349\u3057\u3066GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4e00\u8cab\u6027\u3092\u4fdd\u3064\u306b\u306f\u3001 BEFORE TRUNCATE\u306e\u69cb\u6587\u30c8\u30ea\u30ac\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4ee5\u4e0b\u306f\u3001PostgreSQL v12\u4ee5\u524d\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092 dpoints \u30c6\u30fc\u30d6\u30eb\u306b\u8a2d\u5b9a\u3059\u308b\u4f8b\u3067\u3059\u3002 =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# create trigger stmt_sync before truncate on dpoints_even for statement execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; =# alter table dpoints_even enable always trigger stmt_sync; GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u884c\u30c8\u30ea\u30ac\u306b\u5f15\u6570\u3068\u3057\u3066 KEY=VALUE \u5f62\u5f0f\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3092\u4e0e\u3048\u308b\u4e8b\u3067\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u69cb\u6587\u30c8\u30ea\u30ac\u306e\u65b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u884c\u6570\u306e\u6700\u5927\u5024\u304c250\u4e07\u884c\u3001REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u30b5\u30a4\u30ba\u3092100MB\u3068\u3057\u3066\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002 =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger('max_num_rows=2500000,redo_buffer_size=100m'); \u884c\u30c8\u30ea\u30ac\u306e\u5f15\u6570\u306b\u4e0e\u3048\u308b\u4e8b\u306e\u3067\u304d\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 gpu_device_id=GPU_ID (default: 0) GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u78ba\u4fdd\u3059\u308b\u5bfe\u8c61\u306eGPU\u30c7\u30d0\u30a4\u30b9ID\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 max_num_rows=NROWS (default: 10485760) GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306b\u78ba\u4fdd\u3067\u304d\u308b\u884c\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 PostgreSQL\u30c6\u30fc\u30d6\u30eb\u3068\u540c\u69d8\u306b\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3067\u3082\u53ef\u8996\u6027\u5236\u5fa1\u306e\u305f\u3081\u306b\u30b3\u30df\u30c3\u30c8\u524d\u306e\u66f4\u65b0\u884c\u3092\u4fdd\u6301\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u3066 max_num_rows \u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u306a\u304a\u3001\u66f4\u65b0/\u524a\u9664\u3055\u308c\u305f\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u884c\u306f\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u30b3\u30df\u30c3\u30c8\u5f8c\u306b\u89e3\u653e\u3055\u308c\u307e\u3059\u3002 redo_buffer_size=SIZE \u3000\uff08default: 160m\uff09 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u5358\u4f4d\u3068\u3057\u3066\u3001k\u3001m\u3001g\u3092\u6307\u5b9a\u3067\u304d\u308b\u3002 gpu_sync_interval=SECONDS \u3000\uff08default: 5\uff09 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3078\u306e\u6700\u5f8c\u306e\u66f8\u304d\u8fbc\u307f\u304b\u3089 SECONDS \u79d2\u7d4c\u904e\u3059\u308b\u3068\u3001\u305f\u3068\u3048\u66f4\u65b0\u884c\u6570\u304c\u5c11\u306a\u304f\u3068\u3082\u3001REDO\u30ed\u30b0\u3092GPU\u5074\u3078\u53cd\u6620\u3057\u307e\u3059\u3002 gpu_sync_threshold=SIZE \u3000\uff08default: redo_buffer_size \u306e25%\uff09 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u66f8\u304d\u8fbc\u307f\u306e\u3046\u3061\u3001\u672a\u53cd\u6620\u5206\u306e\u5927\u304d\u3055\u304c SIZE \u30d0\u30a4\u30c8\u306b\u9054\u3059\u308b\u3068\u3001GPU\u5074\u306bREDO\u30ed\u30b0\u3092\u53cd\u6620\u3057\u307e\u3059\u3002 \u5358\u4f4d\u3068\u3057\u3066k\u3001m\u3001g\u3092\u6307\u5b9a\u3067\u304d\u308b\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30aa\u30d7\u30b7\u30e7\u30f3 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u95a2\u9023\u3057\u3066\u3001\u4ee5\u4e0b\u306ePostgreSQL\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002 pg_strom.enable_gpucache \u3000\uff08default: on\uff09 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5229\u7528\u53ef\u80fd\u3067\u3042\u308b\u5834\u5408\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 \u3053\u306e\u5024\u304c off \u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5b58\u5728\u3057\u3066\u3044\u3066\u3082\u3053\u308c\u3092\u7121\u8996\u3057\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u90fd\u5ea6\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u305d\u3046\u3068\u3057\u307e\u3059\u3002 \u306a\u304a\u3001\u672c\u8a2d\u5b9a\u306f\u30c8\u30ea\u30ac\u306b\u3088\u308bREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3078\u306e\u8ffd\u8a18\u306b\u306f\u5f71\u97ff\u3057\u307e\u305b\u3093\u3002 pg_strom.gpucache_auto_preload \u3000\uff08default: NULL\uff09 PostgreSQL\u306e\u8d77\u52d5\u6642/\u518d\u8d77\u52d5\u6642\u306b\u3001\u672c\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4e88\u3081\u69cb\u7bc9\u3057\u3066\u304a\u304d\u307e\u3059\u3002 \u66f8\u5f0f\u306f DATABASE_NAME.SCHEMA_NAME.TABLE_NAME \u3067\u3001\u8907\u6570\u500b\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3053\u308c\u3092\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u4e26\u3079\u307e\u3059\u3002 \u307e\u3060GPU\u30c7\u30d0\u30a4\u30b9\u4e0a\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u69cb\u7bc9\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u3001\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u3092\u30d5\u30eb\u30b9\u30ad\u30e3\u30f3\u3057\u3066GPU\u5074\u3078\u8ee2\u9001\u3059\u308b\u306e\u306f\u3001\u6700\u521d\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3088\u3046\u3068\u8a66\u307f\u305fPostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306e\u5f79\u5272\u3067\u3059\u3002\u3053\u308c\u306f\u901a\u5e38\u3001\u76f8\u5fdc\u306e\u6642\u9593\u3092\u8981\u3059\u308b\u51e6\u7406\u3067\u3059\u304c\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u30ed\u30fc\u30c9\u3059\u3079\u304d\u30c6\u30fc\u30d6\u30eb\u3092\u8a18\u8f09\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u521d\u56de\u5b9f\u884c\u6642\u306b\u9577\u3005\u3068\u5f85\u305f\u3055\u308c\u308b\u4e8b\u3092\u6291\u6b62\u3067\u304d\u307e\u3059\u3002 \u306a\u304a\u3001\u3053\u306e\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306b '*' \u3068\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6301\u3064\u5168\u3066\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092\u9806\u306bGPU\u3078\u30ed\u30fc\u30c9\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002\u3053\u306e\u6642\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u306f\u5168\u3066\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u9806\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3044\u304f\u4e8b\u3068\u306a\u308a\u307e\u3059\u304c\u3001postmaster\u306b\u518d\u8d77\u52d5\u3092\u4fc3\u3059\u305f\u3081\u7d42\u4e86\u30b3\u30fc\u30c9 1 \u3092\u8fd4\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u30b5\u30fc\u30d0\u306e\u8d77\u52d5\u30ed\u30b0\u306b\u300cGPUCache Startup Preloader\u300d\u304c\u7d42\u4e86\u30b3\u30fc\u30c9 1 \u3067\u7d42\u4e86\u3057\u305f\u3068\u51fa\u529b\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u308c\u306f\u7570\u5e38\u3067\u306f\u3042\u308a\u307e\u305b\u3093 LOG: database system is ready to accept connections LOG: background worker \"GPUCache Startup Preloader\" (PID 856418) exited with exit code 1 LOG: background worker \"GPUCache Startup Preloader\" (PID 856427) exited with exit code 1 LOG: create GpuCacheSharedState dpoints:164c95f71 LOG: gpucache: AllocMemory dpoints:164c95f71 (main_sz=772505600, extra_sz=0) LOG: gpucache: auto preload 'public.dpoints' (DB: postgres) LOG: create GpuCacheSharedState mytest:1773a589b LOG: gpucache: auto preload 'public.mytest' (DB: postgres) LOG: gpucache: AllocMemory mytest:1773a589b (main_sz=675028992, extra_sz=0) \u904b\u7528 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5229\u7528\u3092\u78ba\u8a8d\u3059\u308b GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u53c2\u7167\u306f\u900f\u904e\u7684\u306b\u884c\u308f\u308c\u307e\u3059\u3002\u30e6\u30fc\u30b6\u306f\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u6709\u7121\u3092\u610f\u8b58\u3059\u308b\u5fc5\u8981\u306f\u306a\u304f\u3001PG-Strom\u304c\u81ea\u52d5\u7684\u306b\u5224\u5b9a\u3057\u3066\u51e6\u7406\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u306f\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u8a2d\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb dpoints \u3078\u306e\u53c2\u7167\u3092\u542b\u3080\u3082\u306e\u3067\u3059\u3002\u4e0b\u304b\u30893\u884c\u76ee\u306e\u300cGPU Cache\u300d\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u3001\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u57fa\u672c\u7684\u306a\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u3066\u304a\u308a\u3001\u3053\u306e\u30af\u30a8\u30ea\u3067\u306f dpoints \u30c6\u30fc\u30d6\u30eb\u3092\u8aad\u307f\u51fa\u3059\u306e\u3067\u306f\u306a\u304f\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u53c2\u7167\u3057\u3066\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 \u306a\u304a\u3001 max_num_rows \u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4fdd\u6301\u3067\u304d\u308b\u6700\u5927\u306e\u884c\u6570\u3001 main \u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u56fa\u5b9a\u9577\u30d5\u30a3\u30fc\u30eb\u30c9\u7528\u306e\u9818\u57df\u306e\u5927\u304d\u3055\u3001 extra \u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306f\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u5927\u304d\u3055\u3067\u3059\u3002 =# explain select pref, city, count(*) from giscity g, dpoints d where pref = 'Tokyo' and st_contains(g.geom,st_makepoint(d.x, d.y)) group by pref, city; QUERY PLAN -------------------------------------------------------------------------------------------------------- HashAggregate (cost=5638809.75..5638859.99 rows=5024 width=29) Group Key: g.pref, g.city -> Custom Scan (GpuPreAgg) (cost=5638696.71..5638759.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=631923.57..5606933.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) GPU Cache: NVIDIA Tesla V100-PCIE-16GB [max_num_rows: 12000000, main: 772.51M, extra: 0] -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (16 rows) GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u73fe\u5728\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f pgstrom.gpucache_info \u30d3\u30e5\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | refcnt | corrupted | gpu_main_sz | gpu_extra_sz | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------+------------+--------+-----------+-------------+--------------+----------------------------+-------------------+----------------+------------------+---------------+---------------+------------------------------------------------------------------------------------------------------------------------ 12728 | postgres | 25244 | mytest | 6295279771 | 3 | f | 675028992 | 0 | 2021-05-14 03:00:18.623503 | 500000 | 36000000 | 500000 | 36000000 | 36000000 | gpu_device_id=0,max_num_rows=10485760,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 12728 | postgres | 25262 | dpoints | 5985886065 | 3 | f | 772505600 | 0 | 2021-05-14 03:00:18.524627 | 8000000 | 576000192 | 8000000 | 576000192 | 576000192 | gpu_device_id=0,max_num_rows=12000000,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 (2 rows) \u3053\u306e\u30d3\u30e5\u30fc\u3067\u8868\u793a\u3055\u308c\u308bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u72b6\u614b\u306f\u3001\u305d\u306e\u6642\u70b9\u3067\u521d\u671f\u30ed\u30fc\u30c9\u304c\u7d42\u308f\u3063\u3066\u304a\u308a\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u9818\u57df\u304c\u78ba\u4fdd\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3060\u3051\u3067\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u3064\u307e\u308a\u3001\u30c8\u30ea\u30ac\u95a2\u6570\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u304c\u521d\u671f\u30ed\u30fc\u30c9\u304c\u7d42\u308f\u3063\u3066\u3044\u306a\u3044\uff08\u307e\u3060\u8ab0\u3082\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3044\u306a\u3044\uff09\u5834\u5408\u3001\u6f5c\u5728\u7684\u306b\u78ba\u4fdd\u3055\u308c\u3046\u308bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u307e\u3060 pgstrom.gpucache_info \u306b\u306f\u73fe\u308c\u307e\u305b\u3093\u3002 \u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u610f\u5473\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 database_oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eOID\u3067\u3059 database_name GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u540d\u524d\u3067\u3059 table_oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306eOID\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 table_name GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u540d\u524d\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 signature GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4e00\u610f\u6027\u3092\u793a\u3059\u30cf\u30c3\u30b7\u30e5\u5024\u3067\u3059\u3002\u4f8b\u3048\u3070 ALTER TABLE \u306e\u524d\u5f8c\u306a\u3069\u3067\u3053\u306e\u5024\u304c\u5909\u308f\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 refcnt GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u53c2\u7167\u30ab\u30a6\u30f3\u30bf\u3067\u3059\u3002\u3053\u308c\u306f\u5fc5\u305a\u3057\u3082\u6700\u65b0\u306e\u5024\u3092\u53cd\u6620\u3057\u3066\u3044\u308b\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002 corrupted GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5185\u5bb9\u304c\u7834\u640d\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u793a\u3057\u307e\u3059\u3002 gpu_main_sz GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306b\u78ba\u4fdd\u3055\u308c\u305f\u56fa\u5b9a\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_extra_sz GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306b\u78ba\u4fdd\u3055\u308c\u305f\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 redo_write_ts REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u6700\u5f8c\u306b\u66f4\u65b0\u3057\u305f\u6642\u523b\u3067\u3059\u3002 redo_write_nitems REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_write_pos REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_read_nitems REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_read_pos REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_sync_pos REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u3046\u3061\u3001\u65e2\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3078\u306e\u9069\u7528\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u305f\u4f4d\u7f6e\u3067\u3059\u3002 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u6b8b\u308a\u5bb9\u91cf\u304c\u903c\u8feb\u3057\u3066\u304d\u305f\u969b\u306b\u3001\u591a\u6570\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u540c\u6642\u306b\u975e\u540c\u671f\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u767a\u751f\u3055\u305b\u308b\u4e8b\u3092\u907f\u3051\u308b\u305f\u3081\u3001\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002 config_options GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3067\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u7834\u640d\u3068\u5fa9\u5143 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b max_num_rows \u3067\u6307\u5b9a\u3057\u305f\u4ee5\u4e0a\u306e\u884c\u6570\u3092\u633f\u5165\u3057\u3088\u3046\u3068\u3057\u305f\u308a\u3001\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u306e\u30d0\u30c3\u30d5\u30a1\u9577\u304c\u80a5\u5927\u5316\u3057\u3059\u304e\u305f\u308a\u3001 \u3068\u3044\u3063\u305f\u7406\u7531\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306bREDO\u30ed\u30b0\u3092\u9069\u7528\u3067\u304d\u306a\u304b\u3063\u305f\u5834\u5408\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u7834\u640d\uff08corrupted\uff09\u72b6\u614b\u306b\u79fb\u884c\u3057\u307e\u3059\u3002 \u4e00\u5ea6GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u7834\u640d\u3059\u308b\u3068\u3001\u3053\u308c\u3092\u624b\u52d5\u3067\u5fa9\u65e7\u3059\u308b\u307e\u3067\u306f\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u53c2\u7167\u3059\u308b\u4e8b\u306f\u306a\u304f\u306a\u308a\u3001 \u307e\u305f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u66f4\u65b0\u306b\u969b\u3057\u3066\u3082REDO\u30ed\u30b0\u306e\u8a18\u9332\u3092\u884c\u308f\u306a\u304f\u306a\u308a\u307e\u3059\u3002 \uff08\u904b\u60aa\u304f\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u304c\u5b9f\u884c\u3092\u958b\u59cb\u3057\u305f\u5f8c\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u7834\u640d\u3057\u305f\u5834\u5408\u3001\u305d\u306e\u30af\u30a8\u30ea\u306f\u30a8\u30e9\u30fc\u3092\u8fd4\u3059\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002\uff09 GPU\u30d0\u30c3\u30d5\u30a1\u3092\u7834\u640d\u72b6\u614b\u304b\u3089\u5fa9\u5143\u3059\u308b\u306e\u306f pgstrom.gpucache_recovery(regclass) \u95a2\u6570\u3067\u3059\u3002 REDO\u30ed\u30b0\u3092\u9069\u7528\u3067\u304d\u306a\u304b\u3063\u305f\u539f\u56e0\u3092\u53d6\u308a\u9664\u3044\u305f\u4e0a\u3067\u3053\u306e\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u518d\u5ea6\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u521d\u671f\u30ed\u30fc\u30c9\u3092\u884c\u3044\u3001\u5143\u306e\u72b6\u614b\u3078\u306e \u5fa9\u65e7\u3092\u8a66\u307f\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001 max_num_rows \u3067\u6307\u5b9a\u3057\u305f\u4ee5\u4e0a\u306e\u884c\u6570\u3092\u633f\u5165\u3057\u3088\u3046\u3068\u3057\u305f\u5834\u5408\u3067\u3042\u308c\u3070\u3001\u30c8\u30ea\u30ac\u306e\u5b9a\u7fa9\u3092\u5909\u66f4\u3057\u3066 max_num_rows \u8a2d\u5b9a\u3092 \u62e1\u5927\u3059\u308b\u304b\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u4e00\u90e8\u306e\u884c\u3092\u524a\u9664\u3057\u305f\u5f8c\u3067\u3001 pgstrom.gpucache_recovery() \u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3068\u3044\u3046\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5"},{"location":"gpucache/#gpu","text":"","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5"},{"location":"gpucache/#_1","text":"GPU\u306b\u306f\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u306eRAM\u3068\u306f\u72ec\u7acb\u306a\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u304c\u642d\u8f09\u3055\u308c\u3066\u304a\u308a\u3001GPU\u3067\u8a08\u7b97\u3059\u308b\u306b\u306fPCI-E\u30d0\u30b9\u306a\u3069\u3092\u901a\u3058\u3066\u3001\u4e00\u65e6\u3001\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u3084\u30b9\u30c8\u30ec\u30fc\u30b8\u30c7\u30d0\u30a4\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u5074\u3078\u8ee2\u9001\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 PG-Strom\u304cSQL\u30af\u30a8\u30ea\u3092GPU\u3067\u51e6\u7406\u3059\u308b\u5834\u5408\u3082\u4f8b\u5916\u3067\u306f\u306a\u304f\u3001\u5185\u90e8\u7684\u306b\u306f\u3001PostgreSQL\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30ec\u30b3\u30fc\u30c9\u3092GPU\u3078\u3068\u8ee2\u9001\u3057\u3001\u305d\u306e\u4e0a\u3067GPU\u3067SQL\u306e\u5404\u7a2e\u51e6\u7406\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 \u3057\u304b\u3057\u3053\u308c\u3089\u306e\u51e6\u7406\u306b\u306f\u3001\u591a\u304b\u308c\u5c11\u306a\u304b\u308c\u30c6\u30fc\u30d6\u30eb\u306e\u8aad\u307f\u51fa\u3057\u3084\u30c7\u30fc\u30bf\u306e\u8ee2\u9001\u306b\u6642\u9593\u3092\u8981\u3057\u307e\u3059\uff08\u591a\u304f\u306e\u5834\u5408\u3001GPU\u3067\u306e\u51e6\u7406\u3088\u308a\u3082\u9065\u304b\u306b\u9577\u3044\u6642\u9593\u306e\uff01\uff09\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\uff08GPU Cache\uff09\u3068\u306f\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u4e88\u3081\u9818\u57df\u3092\u78ba\u4fdd\u3057\u3066\u304a\u304d\u3001\u305d\u3053\u306bPostgreSQL\u30c6\u30fc\u30d6\u30eb\u306e\u8907\u88fd\u3092\u4fdd\u6301\u3057\u3066\u304a\u304f\u6a5f\u80fd\u3067\u3059\u3002 \u6bd4\u8f03\u7684\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u306e\u5c0f\u3055\u306a\uff08\uff5e10GB\u7a0b\u5ea6\uff09\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u3001\u66f4\u65b0\u983b\u5ea6\u304c\u9ad8\u3044\u3046\u3048\u306b\u3001\u3057\u3070\u3057\u3070\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u691c\u7d22/\u5206\u6790\u7cfb\u306eSQL\u3092\u5b9f\u884c\u3059\u308b\u3068\u3044\u3046\u30d1\u30bf\u30fc\u30f3\u3092\u610f\u56f3\u3057\u3066\u3044\u307e\u3059\u3002 \u5f8c\u8ff0\u3059\u308b\u30ed\u30b0\u30d9\u30fc\u30b9\u306e\u540c\u671f\u30e1\u30ab\u30cb\u30ba\u30e0\u306b\u3088\u308a\u3001\u4e26\u5217\u5ea6\u306e\u9ad8\u3044\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30ca\u30eb\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u59a8\u3052\u308b\u3053\u3068\u306a\u304fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6700\u65b0\u306e\u72b6\u614b\u306b\u4fdd\u3064\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u305d\u306e\u4e00\u65b9\u3067\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306eSQL\u3092\u5b9f\u884c\u3059\u308b\u969b\u306b\u306f\u65e2\u306bGPU\u4e0a\u306b\u30c7\u30fc\u30bf\u304c\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u6539\u3081\u3066\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30ec\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u51fa\u3057\u305f\u308a\u3001PCI-E\u30d0\u30b9\u3092\u4ecb\u3057\u3066\u30c7\u30fc\u30bf\u3092\u8ee2\u9001\u3057\u305f\u308a\u3059\u308b\u4e8b\u306a\u304f\u3001SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5178\u578b\u7684\u306a\u5229\u7528\u30b7\u30fc\u30f3\u3068\u3057\u3066\u306f\u3001\u81ea\u52d5\u8eca\u3084\u643a\u5e2f\u96fb\u8a71\u3068\u3044\u3063\u305f\u30e2\u30d0\u30a4\u30eb\u30c7\u30d0\u30a4\u30b9\u306e\u4f4d\u7f6e\u60c5\u5831\uff08\u73fe\u5728\u4f4d\u7f6e\uff09\u3092\u6642\u3005\u523b\u3005\u53ce\u96c6\u3057\u3001 GPU\u7248PostGIS \u306a\u3069\u3092\u7528\u3044\u3066\u4ed6\u306e\u30c7\u30fc\u30bf\u3068\u7a81\u304d\u5408\u308f\u305b\u308b\u3068\u3044\u3063\u305f\u30b1\u30fc\u30b9\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u3002 \u591a\u6570\u306e\u30c7\u30d0\u30a4\u30b9\u304b\u3089\u9001\u51fa\u3055\u308c\u308b\u4f4d\u7f6e\u60c5\u5831\u306e\u66f4\u65b0\u306f\u6975\u3081\u3066\u66f4\u65b0\u30d8\u30d3\u30fc\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u304c\u3001\u4e00\u65b9\u3067\u3001\u6700\u65b0\u306e\u4f4d\u7f6e\u60c5\u5831\u306b\u57fa\u3065\u3044\u3066\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u3082\u3042\u308b\u305f\u3081\u3001\u3053\u308c\u3089\u66f4\u65b0\u30c7\u30fc\u30bf\u3092\u9045\u6ede\u306a\u304fGPU\u5074\u3078\u9069\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u306b\u306f\u5236\u7d04\u304c\u3042\u308a\u307e\u3059\u304c\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u9ad8\u983b\u5ea6\u306e\u66f4\u65b0\u3068\u3001\u9ad8\u6027\u80fd\u306a\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u3092\u4e21\u7acb\u3059\u308b\u4e00\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002","title":"\u6982\u8981"},{"location":"gpucache/#_2","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3067\u306f\u3001\u4e26\u5217\u5ea6\u306e\u9ad8\u3044\u66f4\u65b0\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u5fdc\u3059\u308b\u3053\u3068\u3068\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u304c\u5e38\u306b\u6700\u65b0\u306e\u30c7\u30fc\u30bf\u3092\u53c2\u7167\u3059\u308b\u3068\u3044\u30462\u3064\u306e\u8981\u4ef6\u3092\u30af\u30ea\u30a2\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u591a\u304f\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u306fCPU\u3068GPU\u306fPCI-E\u30d0\u30b9\u3092\u4ecb\u3057\u3066\u63a5\u7d9a\u3055\u308c\u3001\u305d\u306e\u901a\u4fe1\u306b\u306f\u76f8\u5fdc\u306e\u30ec\u30a4\u30c6\u30f3\u30b7\u304c\u767a\u751f\u3057\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u304c1\u884c\u66f4\u65b0\u3055\u308c\u308b\u305f\u3073\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u540c\u671f\u3057\u3066\u3044\u3066\u306f\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u6027\u80fd\u306b\u5927\u304d\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u3066\u3057\u307e\u3044\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3059\u308b\u3068\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u7528\u306e\u30e1\u30e2\u30ea\u9818\u57df\u3092\u78ba\u4fdd\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u30db\u30b9\u30c8\u5074\u5171\u6709\u30e1\u30e2\u30ea\u4e0a\u306bREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u306e\u66f4\u65b0\u3092\u4f34\u3046SQL\u30b3\u30de\u30f3\u30c9\uff08INSERT\u3001UPDATE\u3001DELETE\uff09\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001AFTER ROW\u30c8\u30ea\u30ac\u306b\u3088\u3063\u3066\u66f4\u65b0\u5185\u5bb9\u304cREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u30b3\u30d4\u30fc\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u306e\u51e6\u7406\u306fGPU\u3078\u306e\u547c\u3073\u51fa\u3057\u3092\u4f34\u308f\u306a\u3044\u3001CPU\u3068RAM\u3060\u3051\u3067\u5b8c\u7d50\u3059\u308b\u51e6\u7406\u3067\u3059\u306e\u3067\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u6027\u80fd\u3078\u306e\u5f71\u97ff\u306f\u307b\u3068\u3093\u3069\u3042\u308a\u307e\u305b\u3093\u3002 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u304c\u4e00\u5b9a\u91cf\u305f\u307e\u308b\u304b\u3001\u6700\u5f8c\u306e\u66f8\u304d\u8fbc\u307f\u304b\u3089\u4e00\u5b9a\u6642\u9593\u304c\u7d4c\u904e\u3059\u308b\u3068\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\uff08GPU memory keeper\uff09\u306b\u3088\u3063\u3066\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u306fGPU\u3078\u30ed\u30fc\u30c9\u3055\u308c\u3001\u66f4\u65b0\u5dee\u5206\u3092GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u9069\u7528\u3057\u307e\u3059\u3002 \u3053\u306e\u6642\u3001REDO\u30ed\u30b0\u306f\u307e\u3068\u3081\u3066GPU\u306b\u8ee2\u9001\u3055\u308c\u3001\u3055\u3089\u306bGPU\u306e\u6570\u5343\u30d7\u30ed\u30bb\u30c3\u30b5\u30b3\u30a2\u304c\u4e26\u5217\u306bREDO\u30ed\u30b0\u3092\u9069\u7528\u3059\u308b\u305f\u3081\u3001\u901a\u5e38\u306f\u51e6\u7406\u9045\u5ef6\u304c\u554f\u984c\u3068\u306a\u308b\u4e8b\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u3092\u53c2\u7167\u3059\u308b\u969b\u306b\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3057\u3066GPU\u306b\u30ed\u30fc\u30c9\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u65e2\u306bGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u5272\u5f53\u3066\u6e08\u307f\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u5148\u7acb\u3063\u3066\u3001\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u958b\u59cb\u6642\u70b9\u3067\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u3001\u3053\u308c\u3089\u306f\u5168\u3066\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u524d\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3078\u9069\u7528\u3055\u308c\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u304c\u5bfe\u8c61\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u305f\u7d50\u679c\u306f\u3001\u76f4\u63a5\u30c6\u30fc\u30d6\u30eb\u3092\u53c2\u7167\u3057\u305f\u5834\u5408\u3068\u540c\u3058\u7d50\u679c\u3092\u8fd4\u3059\u4e8b\u3068\u306a\u308a\u3001\u554f\u3044\u5408\u308f\u305b\u306e\u4e00\u8cab\u6027\u306f\u5e38\u306b\u4fdd\u6301\u3055\u308c\u3066\u3044\u307e\u3059\u3002","title":"\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3"},{"location":"gpucache/#_3","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6709\u52b9\u306b\u3059\u308b\u306b\u306f\u3001\u5bfe\u8c61\u3068\u306a\u308b\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066 pgstrom.gpucache_sync_trigger() \u95a2\u6570\u3092\u5b9f\u884c\u3059\u308bAFTER INSERT OR UPDATE OR DELETE\u306e\u884c\u30c8\u30ea\u30ac\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b9\u30ec\u30fc\u30d6\u5074\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u3053\u306e\u30c8\u30ea\u30ac\u306e\u767a\u884c\u30e2\u30fc\u30c9\u304c ALWAYS \u3067\u3042\u308b\u4e8b\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u30c6\u30fc\u30d6\u30eb dpoints \u306b\u5bfe\u3057\u3066GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3059\u308b\u4f8b\u3067\u3059\u3002 =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; Note PostgreSQL v12.x \u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u304a\u3051\u308b\u8ffd\u52a0\u8a2d\u5b9a PostgreSQL v12\u304a\u3088\u3073\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u3001\u4e0a\u8a18\u306e\u30c8\u30ea\u30ac\u306b\u52a0\u3048\u3066\u3001 pgstrom.gpucache_sync_trigger() \u95a2\u6570\u3092\u5b9f\u884c\u3059\u308bBEFORE TRUNCATE\u306e\u69cb\u6587\u30c8\u30ea\u30ac\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002 \u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b9\u30ec\u30fc\u30d6\u5074\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u3001\u540c\u69d8\u306b\u3001\u3053\u306e\u30c8\u30ea\u30ac\u306e\u767a\u884c\u30e2\u30fc\u30c9\u304c ALWAYS \u3067\u3042\u308b\u4e8b\u304c\u5fc5\u8981\u3067\u3059\u3002 PostgreSQL v13\u3067\u306fObject Access Hook\u304c\u62e1\u5f35\u3055\u308c\u3001\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u30c8\u30ea\u30ac\u8a2d\u5b9a\u306a\u3057\u3067 TRUNCATE\u306e\u5b9f\u884c\u3092\u6355\u6349\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u3057\u304b\u3057\u305d\u308c\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u3001TRUNCATE\u3092\u6355\u6349\u3057\u3066GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4e00\u8cab\u6027\u3092\u4fdd\u3064\u306b\u306f\u3001 BEFORE TRUNCATE\u306e\u69cb\u6587\u30c8\u30ea\u30ac\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4ee5\u4e0b\u306f\u3001PostgreSQL v12\u4ee5\u524d\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092 dpoints \u30c6\u30fc\u30d6\u30eb\u306b\u8a2d\u5b9a\u3059\u308b\u4f8b\u3067\u3059\u3002 =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# create trigger stmt_sync before truncate on dpoints_even for statement execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; =# alter table dpoints_even enable always trigger stmt_sync;","title":"\u8a2d\u5b9a"},{"location":"gpucache/#gpu_1","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u884c\u30c8\u30ea\u30ac\u306b\u5f15\u6570\u3068\u3057\u3066 KEY=VALUE \u5f62\u5f0f\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3092\u4e0e\u3048\u308b\u4e8b\u3067\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u69cb\u6587\u30c8\u30ea\u30ac\u306e\u65b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u884c\u6570\u306e\u6700\u5927\u5024\u304c250\u4e07\u884c\u3001REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u30b5\u30a4\u30ba\u3092100MB\u3068\u3057\u3066\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002 =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger('max_num_rows=2500000,redo_buffer_size=100m'); \u884c\u30c8\u30ea\u30ac\u306e\u5f15\u6570\u306b\u4e0e\u3048\u308b\u4e8b\u306e\u3067\u304d\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 gpu_device_id=GPU_ID (default: 0) GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u78ba\u4fdd\u3059\u308b\u5bfe\u8c61\u306eGPU\u30c7\u30d0\u30a4\u30b9ID\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 max_num_rows=NROWS (default: 10485760) GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306b\u78ba\u4fdd\u3067\u304d\u308b\u884c\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 PostgreSQL\u30c6\u30fc\u30d6\u30eb\u3068\u540c\u69d8\u306b\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3067\u3082\u53ef\u8996\u6027\u5236\u5fa1\u306e\u305f\u3081\u306b\u30b3\u30df\u30c3\u30c8\u524d\u306e\u66f4\u65b0\u884c\u3092\u4fdd\u6301\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u3066 max_num_rows \u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u306a\u304a\u3001\u66f4\u65b0/\u524a\u9664\u3055\u308c\u305f\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u884c\u306f\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u30b3\u30df\u30c3\u30c8\u5f8c\u306b\u89e3\u653e\u3055\u308c\u307e\u3059\u3002 redo_buffer_size=SIZE \u3000\uff08default: 160m\uff09 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u5358\u4f4d\u3068\u3057\u3066\u3001k\u3001m\u3001g\u3092\u6307\u5b9a\u3067\u304d\u308b\u3002 gpu_sync_interval=SECONDS \u3000\uff08default: 5\uff09 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3078\u306e\u6700\u5f8c\u306e\u66f8\u304d\u8fbc\u307f\u304b\u3089 SECONDS \u79d2\u7d4c\u904e\u3059\u308b\u3068\u3001\u305f\u3068\u3048\u66f4\u65b0\u884c\u6570\u304c\u5c11\u306a\u304f\u3068\u3082\u3001REDO\u30ed\u30b0\u3092GPU\u5074\u3078\u53cd\u6620\u3057\u307e\u3059\u3002 gpu_sync_threshold=SIZE \u3000\uff08default: redo_buffer_size \u306e25%\uff09 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u66f8\u304d\u8fbc\u307f\u306e\u3046\u3061\u3001\u672a\u53cd\u6620\u5206\u306e\u5927\u304d\u3055\u304c SIZE \u30d0\u30a4\u30c8\u306b\u9054\u3059\u308b\u3068\u3001GPU\u5074\u306bREDO\u30ed\u30b0\u3092\u53cd\u6620\u3057\u307e\u3059\u3002 \u5358\u4f4d\u3068\u3057\u3066k\u3001m\u3001g\u3092\u6307\u5b9a\u3067\u304d\u308b\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba"},{"location":"gpucache/#gpu_2","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u95a2\u9023\u3057\u3066\u3001\u4ee5\u4e0b\u306ePostgreSQL\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002 pg_strom.enable_gpucache \u3000\uff08default: on\uff09 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5229\u7528\u53ef\u80fd\u3067\u3042\u308b\u5834\u5408\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 \u3053\u306e\u5024\u304c off \u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5b58\u5728\u3057\u3066\u3044\u3066\u3082\u3053\u308c\u3092\u7121\u8996\u3057\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u90fd\u5ea6\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u305d\u3046\u3068\u3057\u307e\u3059\u3002 \u306a\u304a\u3001\u672c\u8a2d\u5b9a\u306f\u30c8\u30ea\u30ac\u306b\u3088\u308bREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3078\u306e\u8ffd\u8a18\u306b\u306f\u5f71\u97ff\u3057\u307e\u305b\u3093\u3002 pg_strom.gpucache_auto_preload \u3000\uff08default: NULL\uff09 PostgreSQL\u306e\u8d77\u52d5\u6642/\u518d\u8d77\u52d5\u6642\u306b\u3001\u672c\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4e88\u3081\u69cb\u7bc9\u3057\u3066\u304a\u304d\u307e\u3059\u3002 \u66f8\u5f0f\u306f DATABASE_NAME.SCHEMA_NAME.TABLE_NAME \u3067\u3001\u8907\u6570\u500b\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3053\u308c\u3092\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u4e26\u3079\u307e\u3059\u3002 \u307e\u3060GPU\u30c7\u30d0\u30a4\u30b9\u4e0a\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u69cb\u7bc9\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u3001\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u3092\u30d5\u30eb\u30b9\u30ad\u30e3\u30f3\u3057\u3066GPU\u5074\u3078\u8ee2\u9001\u3059\u308b\u306e\u306f\u3001\u6700\u521d\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3088\u3046\u3068\u8a66\u307f\u305fPostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306e\u5f79\u5272\u3067\u3059\u3002\u3053\u308c\u306f\u901a\u5e38\u3001\u76f8\u5fdc\u306e\u6642\u9593\u3092\u8981\u3059\u308b\u51e6\u7406\u3067\u3059\u304c\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u30ed\u30fc\u30c9\u3059\u3079\u304d\u30c6\u30fc\u30d6\u30eb\u3092\u8a18\u8f09\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u521d\u56de\u5b9f\u884c\u6642\u306b\u9577\u3005\u3068\u5f85\u305f\u3055\u308c\u308b\u4e8b\u3092\u6291\u6b62\u3067\u304d\u307e\u3059\u3002 \u306a\u304a\u3001\u3053\u306e\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306b '*' \u3068\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6301\u3064\u5168\u3066\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092\u9806\u306bGPU\u3078\u30ed\u30fc\u30c9\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002\u3053\u306e\u6642\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u306f\u5168\u3066\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u9806\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3044\u304f\u4e8b\u3068\u306a\u308a\u307e\u3059\u304c\u3001postmaster\u306b\u518d\u8d77\u52d5\u3092\u4fc3\u3059\u305f\u3081\u7d42\u4e86\u30b3\u30fc\u30c9 1 \u3092\u8fd4\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u30b5\u30fc\u30d0\u306e\u8d77\u52d5\u30ed\u30b0\u306b\u300cGPUCache Startup Preloader\u300d\u304c\u7d42\u4e86\u30b3\u30fc\u30c9 1 \u3067\u7d42\u4e86\u3057\u305f\u3068\u51fa\u529b\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u308c\u306f\u7570\u5e38\u3067\u306f\u3042\u308a\u307e\u305b\u3093 LOG: database system is ready to accept connections LOG: background worker \"GPUCache Startup Preloader\" (PID 856418) exited with exit code 1 LOG: background worker \"GPUCache Startup Preloader\" (PID 856427) exited with exit code 1 LOG: create GpuCacheSharedState dpoints:164c95f71 LOG: gpucache: AllocMemory dpoints:164c95f71 (main_sz=772505600, extra_sz=0) LOG: gpucache: auto preload 'public.dpoints' (DB: postgres) LOG: create GpuCacheSharedState mytest:1773a589b LOG: gpucache: auto preload 'public.mytest' (DB: postgres) LOG: gpucache: AllocMemory mytest:1773a589b (main_sz=675028992, extra_sz=0)","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30aa\u30d7\u30b7\u30e7\u30f3"},{"location":"gpucache/#_4","text":"","title":"\u904b\u7528"},{"location":"gpucache/#gpu_3","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u53c2\u7167\u306f\u900f\u904e\u7684\u306b\u884c\u308f\u308c\u307e\u3059\u3002\u30e6\u30fc\u30b6\u306f\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u6709\u7121\u3092\u610f\u8b58\u3059\u308b\u5fc5\u8981\u306f\u306a\u304f\u3001PG-Strom\u304c\u81ea\u52d5\u7684\u306b\u5224\u5b9a\u3057\u3066\u51e6\u7406\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u306f\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u8a2d\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb dpoints \u3078\u306e\u53c2\u7167\u3092\u542b\u3080\u3082\u306e\u3067\u3059\u3002\u4e0b\u304b\u30893\u884c\u76ee\u306e\u300cGPU Cache\u300d\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u3001\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306eGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u57fa\u672c\u7684\u306a\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u3066\u304a\u308a\u3001\u3053\u306e\u30af\u30a8\u30ea\u3067\u306f dpoints \u30c6\u30fc\u30d6\u30eb\u3092\u8aad\u307f\u51fa\u3059\u306e\u3067\u306f\u306a\u304f\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u53c2\u7167\u3057\u3066\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 \u306a\u304a\u3001 max_num_rows \u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4fdd\u6301\u3067\u304d\u308b\u6700\u5927\u306e\u884c\u6570\u3001 main \u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u56fa\u5b9a\u9577\u30d5\u30a3\u30fc\u30eb\u30c9\u7528\u306e\u9818\u57df\u306e\u5927\u304d\u3055\u3001 extra \u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306f\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u5927\u304d\u3055\u3067\u3059\u3002 =# explain select pref, city, count(*) from giscity g, dpoints d where pref = 'Tokyo' and st_contains(g.geom,st_makepoint(d.x, d.y)) group by pref, city; QUERY PLAN -------------------------------------------------------------------------------------------------------- HashAggregate (cost=5638809.75..5638859.99 rows=5024 width=29) Group Key: g.pref, g.city -> Custom Scan (GpuPreAgg) (cost=5638696.71..5638759.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=631923.57..5606933.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) GPU Cache: NVIDIA Tesla V100-PCIE-16GB [max_num_rows: 12000000, main: 772.51M, extra: 0] -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (16 rows)","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5229\u7528\u3092\u78ba\u8a8d\u3059\u308b"},{"location":"gpucache/#gpu_4","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u73fe\u5728\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f pgstrom.gpucache_info \u30d3\u30e5\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | refcnt | corrupted | gpu_main_sz | gpu_extra_sz | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------+------------+--------+-----------+-------------+--------------+----------------------------+-------------------+----------------+------------------+---------------+---------------+------------------------------------------------------------------------------------------------------------------------ 12728 | postgres | 25244 | mytest | 6295279771 | 3 | f | 675028992 | 0 | 2021-05-14 03:00:18.623503 | 500000 | 36000000 | 500000 | 36000000 | 36000000 | gpu_device_id=0,max_num_rows=10485760,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 12728 | postgres | 25262 | dpoints | 5985886065 | 3 | f | 772505600 | 0 | 2021-05-14 03:00:18.524627 | 8000000 | 576000192 | 8000000 | 576000192 | 576000192 | gpu_device_id=0,max_num_rows=12000000,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 (2 rows) \u3053\u306e\u30d3\u30e5\u30fc\u3067\u8868\u793a\u3055\u308c\u308bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u72b6\u614b\u306f\u3001\u305d\u306e\u6642\u70b9\u3067\u521d\u671f\u30ed\u30fc\u30c9\u304c\u7d42\u308f\u3063\u3066\u304a\u308a\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u9818\u57df\u304c\u78ba\u4fdd\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3060\u3051\u3067\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u3064\u307e\u308a\u3001\u30c8\u30ea\u30ac\u95a2\u6570\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u304c\u521d\u671f\u30ed\u30fc\u30c9\u304c\u7d42\u308f\u3063\u3066\u3044\u306a\u3044\uff08\u307e\u3060\u8ab0\u3082\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3044\u306a\u3044\uff09\u5834\u5408\u3001\u6f5c\u5728\u7684\u306b\u78ba\u4fdd\u3055\u308c\u3046\u308bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u307e\u3060 pgstrom.gpucache_info \u306b\u306f\u73fe\u308c\u307e\u305b\u3093\u3002 \u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u610f\u5473\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 database_oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eOID\u3067\u3059 database_name GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u540d\u524d\u3067\u3059 table_oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306eOID\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 table_name GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u540d\u524d\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 signature GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4e00\u610f\u6027\u3092\u793a\u3059\u30cf\u30c3\u30b7\u30e5\u5024\u3067\u3059\u3002\u4f8b\u3048\u3070 ALTER TABLE \u306e\u524d\u5f8c\u306a\u3069\u3067\u3053\u306e\u5024\u304c\u5909\u308f\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 refcnt GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u53c2\u7167\u30ab\u30a6\u30f3\u30bf\u3067\u3059\u3002\u3053\u308c\u306f\u5fc5\u305a\u3057\u3082\u6700\u65b0\u306e\u5024\u3092\u53cd\u6620\u3057\u3066\u3044\u308b\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002 corrupted GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5185\u5bb9\u304c\u7834\u640d\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u793a\u3057\u307e\u3059\u3002 gpu_main_sz GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306b\u78ba\u4fdd\u3055\u308c\u305f\u56fa\u5b9a\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_extra_sz GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306b\u78ba\u4fdd\u3055\u308c\u305f\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 redo_write_ts REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u6700\u5f8c\u306b\u66f4\u65b0\u3057\u305f\u6642\u523b\u3067\u3059\u3002 redo_write_nitems REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_write_pos REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_read_nitems REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_read_pos REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_sync_pos REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u3046\u3061\u3001\u65e2\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3078\u306e\u9069\u7528\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u305f\u4f4d\u7f6e\u3067\u3059\u3002 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u6b8b\u308a\u5bb9\u91cf\u304c\u903c\u8feb\u3057\u3066\u304d\u305f\u969b\u306b\u3001\u591a\u6570\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u540c\u6642\u306b\u975e\u540c\u671f\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u767a\u751f\u3055\u305b\u308b\u4e8b\u3092\u907f\u3051\u308b\u305f\u3081\u3001\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002 config_options GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3067\u3059\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b"},{"location":"gpucache/#gpu_5","text":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b max_num_rows \u3067\u6307\u5b9a\u3057\u305f\u4ee5\u4e0a\u306e\u884c\u6570\u3092\u633f\u5165\u3057\u3088\u3046\u3068\u3057\u305f\u308a\u3001\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u306e\u30d0\u30c3\u30d5\u30a1\u9577\u304c\u80a5\u5927\u5316\u3057\u3059\u304e\u305f\u308a\u3001 \u3068\u3044\u3063\u305f\u7406\u7531\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306bREDO\u30ed\u30b0\u3092\u9069\u7528\u3067\u304d\u306a\u304b\u3063\u305f\u5834\u5408\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u7834\u640d\uff08corrupted\uff09\u72b6\u614b\u306b\u79fb\u884c\u3057\u307e\u3059\u3002 \u4e00\u5ea6GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u7834\u640d\u3059\u308b\u3068\u3001\u3053\u308c\u3092\u624b\u52d5\u3067\u5fa9\u65e7\u3059\u308b\u307e\u3067\u306f\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u53c2\u7167\u3059\u308b\u4e8b\u306f\u306a\u304f\u306a\u308a\u3001 \u307e\u305f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u66f4\u65b0\u306b\u969b\u3057\u3066\u3082REDO\u30ed\u30b0\u306e\u8a18\u9332\u3092\u884c\u308f\u306a\u304f\u306a\u308a\u307e\u3059\u3002 \uff08\u904b\u60aa\u304f\u3001\u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u304c\u5b9f\u884c\u3092\u958b\u59cb\u3057\u305f\u5f8c\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u7834\u640d\u3057\u305f\u5834\u5408\u3001\u305d\u306e\u30af\u30a8\u30ea\u306f\u30a8\u30e9\u30fc\u3092\u8fd4\u3059\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002\uff09 GPU\u30d0\u30c3\u30d5\u30a1\u3092\u7834\u640d\u72b6\u614b\u304b\u3089\u5fa9\u5143\u3059\u308b\u306e\u306f pgstrom.gpucache_recovery(regclass) \u95a2\u6570\u3067\u3059\u3002 REDO\u30ed\u30b0\u3092\u9069\u7528\u3067\u304d\u306a\u304b\u3063\u305f\u539f\u56e0\u3092\u53d6\u308a\u9664\u3044\u305f\u4e0a\u3067\u3053\u306e\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u518d\u5ea6\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u521d\u671f\u30ed\u30fc\u30c9\u3092\u884c\u3044\u3001\u5143\u306e\u72b6\u614b\u3078\u306e \u5fa9\u65e7\u3092\u8a66\u307f\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001 max_num_rows \u3067\u6307\u5b9a\u3057\u305f\u4ee5\u4e0a\u306e\u884c\u6570\u3092\u633f\u5165\u3057\u3088\u3046\u3068\u3057\u305f\u5834\u5408\u3067\u3042\u308c\u3070\u3001\u30c8\u30ea\u30ac\u306e\u5b9a\u7fa9\u3092\u5909\u66f4\u3057\u3066 max_num_rows \u8a2d\u5b9a\u3092 \u62e1\u5927\u3059\u308b\u304b\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u4e00\u90e8\u306e\u884c\u3092\u524a\u9664\u3057\u305f\u5f8c\u3067\u3001 pgstrom.gpucache_recovery() \u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3068\u3044\u3046\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u7834\u640d\u3068\u5fa9\u5143"},{"location":"install/","text":"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u672c\u7ae0\u3067\u306fPG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8 \u30cf\u30fc\u30c9\u30a6\u30a7\u30a2 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30aa\u30da\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u3092\u52d5\u4f5c\u53ef\u80fd\u306a x86_64 \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306e\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u304c\u5fc5\u8981\u3067\u3059\u3002 CPU\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3001\u304a\u3088\u3073\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30c7\u30d0\u30a4\u30b9\u306b\u306f\u7279\u5225\u306a\u8981\u4ef6\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001 note002:HW Validation List \u306f\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9078\u5b9a\u306e\u4e0a\u3067\u53c2\u8003\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3092\u5229\u7528\u3059\u308b\u306b\u306fNVME\u898f\u683c\u306b\u5bfe\u5fdc\u3057\u305fSSD\u3001\u307e\u305f\u306fRoCE\u306b\u5bfe\u5fdc\u3057\u305f\u9ad8\u901fNIC\u304c\u5fc5\u8981\u3067\u3001GPU\u3068\u540c\u4e00\u306ePCIe Root Complex\u914d\u4e0b\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9 PG-Strom\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u5c11\u306a\u304f\u3068\u3082\u4e00\u500b\u306eGPU\u30c7\u30d0\u30a4\u30b9\u304c\u30b7\u30b9\u30c6\u30e0\u4e0a\u306b\u5fc5\u8981\u3067\u3059\u3002\u3053\u308c\u3089\u306fCUDA Toolkit\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u304a\u308a\u3001computing capability \u304c6.0\u4ee5\u964d\u306e\u30e2\u30c7\u30eb\uff08Pascal\u4e16\u4ee3\u4ee5\u964d\uff09\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 002: HW Validation List - List of supported GPU models \u3092\u53c2\u8003\u306bGPU\u3092\u9078\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Operating System PG-Strom\u306e\u5b9f\u884c\u306b\u306f\u3001CUDA Toolkit\u306b\u3088\u308a\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308bx86_64\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u5411\u3051\u306eLinux OS\u304c\u5fc5\u8981\u3067\u3059\u3002\u63a8\u5968\u74b0\u5883\u306fRed Hat Enterprise Linux\u307e\u305f\u306fRocky Linux\u30d0\u30fc\u30b8\u30e7\u30f3 8.x\u3067\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\uff08cuFile\u30c9\u30e9\u30a4\u30d0\uff09\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u3001CUDA Toolkit\u306b\u542b\u307e\u308c\u308bnvidia-fs\u30c9\u30e9\u30a4\u30d0\u3068\u3001Mellanox OFED (OpenFabrics Enterprise Distribution) \u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002 PostgreSQL PG-Strom v5.0\u306e\u5b9f\u884c\u306b\u306fPostgreSQL\u30d0\u30fc\u30b8\u30e7\u30f315\u4ee5\u964d\u304c\u5fc5\u8981\u3067\u3059\u3002 PG-Strom\u304c\u5185\u90e8\u7684\u306b\u5229\u7528\u3057\u3066\u3044\u308bAPI\u306e\u4e2d\u306b\u306f\u3001\u3053\u308c\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u63d0\u4f9b\u3055\u308c\u3066\u3044\u306a\u3044\u3082\u306e\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002 CUDA Toolkit PG-Strom\u306e\u5b9f\u884c\u306b\u306fCUDA Toolkit \u30d0\u30fc\u30b8\u30e7\u30f312.2update2\u4ee5\u964d\u304c\u5fc5\u8981\u3067\u3059\u3002 PG-Strom\u304c\u5185\u90e8\u7684\u306b\u5229\u7528\u3057\u3066\u3044\u308bAPI\u306e\u4e2d\u306b\u306f\u3001\u3053\u308c\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u63d0\u4f9b\u3055\u308c\u3066\u3044\u306a\u3044\u3082\u306e\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806 \u4e00\u9023\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3068\u306a\u308a\u307e\u3059\u3002 H/W\u306e\u521d\u671f\u8a2d\u5b9a OS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb MOFED\u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb CUDA Toolkit \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb HeteroDB\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PostgreSQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PostgreSQL\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u5fc5\u8981\u306b\u5fdc\u3058\u3066\uff09 PostGIS contrib/cube OS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3092\u9078\u629e\u3057\u3001\u500b\u3005\u306e\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d7\u30ed\u30bb\u30b9\u306b\u5f93\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4f5c\u696d\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306f\u3001 NVIDIA DEVELOPER ZONE \u306b\u304a\u3044\u3066\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002 Red Hat Enterprise Linux 8.x\u7cfb\u5217\uff08Rocky Linux 8.x\u7cfb\u5217\u3092\u542b\u3080\uff09\u306e\u5834\u5408\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u69cb\u6210\u306f\u3001\u30d9\u30fc\u30b9\u74b0\u5883\u3068\u3057\u3066\u300c\u6700\u5c0f\u9650\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3001\u3055\u3089\u306b\u8ffd\u52a0\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u3057\u3066\u300c\u958b\u767a\u30c4\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Red Hat Enterprise Linux 9.x\u7cfb\u5217\uff08Rocky Linux 9.x\u7cfb\u5217\u3092\u542b\u3080\uff09\u306e\u5834\u5408\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u69cb\u6210\u306f\u3001\u30d9\u30fc\u30b9\u74b0\u5883\u3068\u3057\u3066\u300c\u6700\u5c0f\u9650\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3001\u3055\u3089\u306b\u8ffd\u52a0\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u3057\u3066\u300c\u6a19\u6e96\u300d\u300c\u958b\u767a\u30c4\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30b5\u30fc\u30d0\u30fc\u3078\u306eOS\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u3001\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u30fc\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u306b\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002 \u306a\u304a\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u3067\u300c\u958b\u767a\u30c4\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067OS\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306b\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 # dnf groupinstall 'Development Tools' Tip \u30b5\u30fc\u30d0\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308bGPU\u304c\u65b0\u3057\u3059\u304e\u308b\u5834\u5408\u3001OS\u8d77\u52d5\u4e2d\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u7b49\u306e\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u5834\u5408\u3001\u30ab\u30fc\u30cd\u30eb\u8d77\u52d5\u30aa\u30d7\u30b7\u30e7\u30f3\u306b nouveau.modeset=0 \u3092\u8ffd\u52a0\u3057\u3066\u6a19\u6e96\u306e\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u30c9\u30e9\u30a4\u30d0\u3092\u7121\u52b9\u5316\u3059\u308b\u4e8b\u3067 \u554f\u984c\u3092\u56de\u907f\u3067\u304d\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 nouveau\u30c9\u30e9\u30a4\u30d0\u306e\u7121\u52b9\u5316 NVIDIA\u88fdGPU\u5411\u3051\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u4e92\u63db\u30c9\u30e9\u30a4\u30d0\u3067\u3042\u308bnouveau\u30c9\u30e9\u30a4\u30d0\u304c\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001nvidia\u30c9\u30e9\u30a4\u30d0\u3092\u30ed\u30fc\u30c9\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002 \u3053\u306e\u5834\u5408\u306f\u3001nouveau\u30c9\u30e9\u30a4\u30d0\u306e\u7121\u52b9\u5316\u8a2d\u5b9a\u3092\u884c\u3063\u305f\u4e0a\u3067\u30b7\u30b9\u30c6\u30e0\u3092\u4e00\u5ea6\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 nouveau\u30c9\u30e9\u30a4\u30d0\u3092\u7121\u52b9\u5316\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092 /etc/modprobe.d/disable-nouveau.conf \u3068\u3044\u3046\u540d\u524d\u3067\u4fdd\u5b58\u3057\u3001 dracut \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066Linux kernel\u306e\u30d6\u30fc\u30c8\u30a4\u30e1\u30fc\u30b8\u306b\u53cd\u6620\u3057\u307e\u3059\u3002 \u305d\u306e\u5f8c\u3001\u30b7\u30b9\u30c6\u30e0\u3092\u4e00\u5ea6\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 # cat > /etc/modprobe.d/disable-nouveau.conf </kernel/drivers/nvme/host/nvme-rdma.ko.xz \uff09\u3067\u306f\u306a\u304f\u3001\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f /lib/modules//extra/mlnx-nvme/host/nvme-rdma.ko \u304c\u512a\u5148\u3057\u3066\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002 $ modinfo nvme-rdma filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/mlnx-nvme/host/nvme-rdma.ko license: GPL v2 rhelversion: 9.4 srcversion: 16C0049F26768D6EA12771B depends: nvme-core,rdma_cm,ib_core,nvme-fabrics,mlx_compat retpoline: Y name: nvme_rdma vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions parm: register_always:Use memory registration even for contiguous memory regions (bool) \u65e2\u306b\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\uff08\u4f8b: nvme \uff09\u3092\u7f6e\u304d\u63db\u3048\u308b\u305f\u3081\u3001\u3053\u3053\u3067\u4e00\u5ea6\u30b7\u30b9\u30c6\u30e0\u306e\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3068\u518d\u8d77\u52d5\u3092\u884c\u3044\u307e\u3059\u3002 mlnxofedinstall \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b8c\u4e86\u5f8c\u306b\u3001 dracut -f \u3092\u5b9f\u884c\u3059\u308b\u306e\u3092\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002 Tips Linux kernel\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3068MOFED\u30c9\u30e9\u30a4\u30d0 RHEL\u7cfb\u5217\u306e\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306b\u304a\u3044\u3066\u3001MODED\u30c9\u30e9\u30a4\u30d0\u306fDKMS(Dynamic Kernel Module Support)\u3092\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002 \u305d\u306e\u305f\u3081\u3001Linux kernel\u3092\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3057\u305f\u5834\u5408\u306b\u306f\u3001\u4e0a\u8a18\u306e\u624b\u9806\u3092\u518d\u5ea6\u5b9f\u884c\u3057\u3001\u65b0\u3057\u3044Linux kernel\u306b\u5bfe\u5fdc\u3057\u305fMOFED\u30c9\u30e9\u30a4\u30d0\u3092\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u5f8c\u8ff0\u306eCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u66f4\u65b0\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067Linux kernel\u304c\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3055\u308c\u308b\u4e8b\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u305d\u306e\u5834\u5408\u3067\u3082\u540c\u69d8\u3067\u3059\u3002 heterodb-swdc\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PG-Strom\u307b\u304b\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8\u306f HeteroDB Software Distribution Center \u304b\u3089\u914d\u5e03\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u5165\u624b\u3059\u308b\u305f\u3081\u306b\u3001HeteroDB-SWDC\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u3092yum\u30b7\u30b9\u30c6\u30e0\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 HeteroDB-SWDC\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u5b9a\u7fa9\u306fheterodb-swdc\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3088\u308a\u63d0\u4f9b\u3055\u308c\u307e\u3059\u3002 Web\u30d6\u30e9\u30a6\u30b6\u306a\u3069\u3067 HeteroDB Software Distribution Center \u3078\u30a2\u30af\u30bb\u30b9\u3057\u3001\u30da\u30fc\u30b8\u306e\u5148\u982d\u306b\u30ea\u30f3\u30af\u306e\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b heterodb-swdc-1.3-1.el9.noarch.rpm \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08RHEL8\u306e\u5834\u5408\u306f heterodb-swdc-1.3-1.el8.noarch.rpm \uff09 heterodb-swdc\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u3068\u3001HeteroDB-SWDC\u304b\u3089\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u5165\u624b\u3059\u308b\u305f\u3081\u306eyum\u30b7\u30b9\u30c6\u30e0\u3078\u306e\u8a2d\u5b9a\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306bheterodb-swdc\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 # dnf install https://heterodb.github.io/swdc/yum/rhel8-noarch/heterodb-swdc-1.2-1.el8.noarch.rpm CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u672c\u7bc0\u3067\u306fCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u65e2\u306b\u6700\u65b0\u306eCUDA Toolkit\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3067\u3042\u308b\u5834\u5408\u3001\u672c\u7bc0\u306e\u521d\u671f\u8a2d\u5b9a\u3068\u5408\u81f4\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 NVIDIA\u306fCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\uff12\u901a\u308a\u306e\u65b9\u6cd5\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002\u4e00\u3064\u306f\u81ea\u5df1\u5b9f\u884c\u578b\u30a2\u30fc\u30ab\u30a4\u30d6\uff08runfile\uff09\u306b\u3088\u308b\u3082\u306e\u3002\u3082\u3046\u4e00\u3064\u306fRPM\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3088\u308b\u3082\u306e\u3067\u3001PG-Strom\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u306fRPM\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u63a8\u5968\u3057\u307e\u3059\u3002 CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u7528\u30d1\u30c3\u30b1\u30fc\u30b8\u306fNVIDIA DEVELOPER ZONE\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u9069\u5207\u306aOS\u3001\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3001\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3001\u300erpm(network)\u300f\u7248\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u300erpm(network)\u300f\u3092\u9078\u629e\u3059\u308b\u3068\u3001\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u767b\u9332\u3057\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7d4c\u7531\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u306e\u30b7\u30a7\u30eb\u30b3\u30de\u30f3\u30c9\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u30ac\u30a4\u30c0\u30f3\u30b9\u901a\u308a\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u9032\u3081\u3066\u304f\u3060\u3055\u3044\u3002 # dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo # dnf clean all # dnf install cuda-toolkit-12-5 CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u7d9a\u3044\u3066\u3001\u30c9\u30e9\u30a4\u30d0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u305f\u3081\u306e\u30b3\u30de\u30f3\u30c9\u304c\uff12\u7a2e\u985e\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u3053\u3067\u306f \u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248\u306envidia-driver \u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248\u306e\u307f\u304cGPUDirect Storage\u6a5f\u80fd\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u304a\u308a\u3001PG-Strom\u306eGPU-Direct SQL\u306f\u672c\u6a5f\u80fd\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002 Tips Volta\u4ee5\u524d\u306eGPU\u306e\u5229\u7528\u306b\u3064\u3044\u3066 \u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248nvidia\u30c9\u30e9\u30a4\u30d0\u306f\u3001Volta\u4e16\u4ee3\u4ee5\u524d\u306eGPU\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002 \u3057\u305f\u304c\u3063\u3066\u3001Volta\u307e\u305f\u306fPascal\u4e16\u4ee3\u306eGPU\u3067PG-Strom\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u30d7\u30ed\u30d7\u30e9\u30a8\u30bf\u30ea\u7248\u306e\u30c9\u30e9\u30a4\u30d0\u3067\u3042\u3063\u3066\u3082GPUDirect Storage\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308bCUDA 12.2 Update 1\u3092\u5229\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 CUDA 12.2 Update 1\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306f \u3053\u3061\u3089 \u304b\u3089\u5165\u624b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u7d9a\u3044\u3066\u3001GPU-Direct Storage(GDS)\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306e\u30c9\u30e9\u30a4\u30d0\u30e2\u30b8\u30e5\u30fc\u30eb nvidia-gds \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u306b\u7d9a\u3044\u3066CUDA Toolkit\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u540c\u4e00\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u540d\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 # dnf module install nvidia-driver:open-dkms # dnf install nvidia-gds-12-5 \u6b63\u5e38\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001 /usr/local/cuda \u914d\u4e0b\u306bCUDA Toolkit\u304c\u5c0e\u5165\u3055\u308c\u3066\u3044\u307e\u3059\u3002 $ ls /usr/local/cuda/ bin/ gds/ nsightee_plugins/ targets/ compute-sanitizer/ include@ nvml/ tools/ CUDA_Toolkit_Release_Notes.txt lib64@ nvvm/ version.json DOCS libnvvp/ README EULA.txt LICENSE share/ extras/ man/ src/ \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001GPU\u304c\u6b63\u3057\u304f\u8a8d\u8b58\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 nvidia-smi \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u51fa\u529b\u4f8b\u306e\u3088\u3046\u306b\u3001\u30b7\u30b9\u30c6\u30e0\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308bGPU\u306e\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 $ nvidia-smi Mon Jun 3 09:56:41 2024 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 555.42.02 Driver Version: 555.42.02 CUDA Version: 12.5 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA A100-PCIE-40GB Off | 00000000:41:00.0 Off | 0 | | N/A 58C P0 66W / 250W | 1MiB / 40960MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+ GPUDirect Storage\u306e\u78ba\u8a8d \u4e0a\u8a18\u306e\u624b\u9806\u3067CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001GPUDirect Storage\u304c\u5229\u7528\u53ef\u80fd\u306a\u72b6\u614b\u3068\u306a\u3063\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u901a\u308a\u3001 gdscheck \u30c4\u30fc\u30eb\u3092\u7528\u3044\u3066\u30b9\u30c8\u30ec\u30fc\u30b8\u30c7\u30d0\u30a4\u30b9\u6bce\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \uff08\u3053\u306e\u4f8b\u3067\u306f\u3001 nvme \u3060\u3051\u3067\u306a\u304f\u3001 nvme-rdma \u3084 rpcrdma \u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\u3082\u30ed\u30fc\u30c9\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u95a2\u9023\u3059\u308b\u6a5f\u80fd\u304c Supported \u3068\u306a\u3063\u3066\u3044\u307e\u3059\uff09 # /usr/local/cuda/gds/tools/gdscheck -p GDS release version: 1.10.0.4 nvidia_fs version: 2.20 libcufile version: 2.12 Platform: x86_64 ============ ENVIRONMENT: ============ ===================== DRIVER CONFIGURATION: ===================== NVMe : Supported NVMeOF : Supported SCSI : Unsupported ScaleFlux CSD : Unsupported NVMesh : Unsupported DDN EXAScaler : Unsupported IBM Spectrum Scale : Unsupported NFS : Supported BeeGFS : Unsupported WekaFS : Unsupported Userspace RDMA : Unsupported --Mellanox PeerDirect : Disabled --rdma library : Not Loaded (libcufile_rdma.so) --rdma devices : Not configured --rdma_device_status : Up: 0 Down: 0 ===================== CUFILE CONFIGURATION: ===================== properties.use_compat_mode : true properties.force_compat_mode : false properties.gds_rdma_write_support : true properties.use_poll_mode : false properties.poll_mode_max_size_kb : 4 properties.max_batch_io_size : 128 properties.max_batch_io_timeout_msecs : 5 properties.max_direct_io_size_kb : 16384 properties.max_device_cache_size_kb : 131072 properties.max_device_pinned_mem_size_kb : 33554432 properties.posix_pool_slab_size_kb : 4 1024 16384 properties.posix_pool_slab_count : 128 64 32 properties.rdma_peer_affinity_policy : RoundRobin properties.rdma_dynamic_routing : 0 fs.generic.posix_unaligned_writes : false fs.lustre.posix_gds_min_kb: 0 fs.beegfs.posix_gds_min_kb: 0 fs.weka.rdma_write_support: false fs.gpfs.gds_write_support: false profile.nvtx : false profile.cufile_stats : 0 miscellaneous.api_check_aggressive : false execution.max_io_threads : 4 execution.max_io_queue_depth : 128 execution.parallel_io : true execution.min_io_threshold_size_kb : 8192 execution.max_request_parallelism : 4 properties.force_odirect_mode : false properties.prefer_iouring : false ========= GPU INFO: ========= GPU index 0 NVIDIA A100-PCIE-40GB bar:1 bar size (MiB):65536 supports GDS, IOMMU State: Disabled ============== PLATFORM INFO: ============== IOMMU: disabled Nvidia Driver Info Status: Supported(Nvidia Open Driver Installed) Cuda Driver Version Installed: 12050 Platform: AS -2014CS-TR, Arch: x86_64(Linux 5.14.0-427.18.1.el9_4.x86_64) Platform verification succeeded Tips RAID\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306e\u8ffd\u52a0\u8a2d\u5b9a GPUDirect Storage\u3092\u5229\u7528\u3057\u3066Software RAID (md-raid0) \u533a\u753b\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3059\u5834\u5408\u3001 \u4ee5\u4e0b\u306e\u4e00\u884c\u3092 /lib/udev/rules.d/63-md-raid-arrays.rules \u8a2d\u5b9a\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 IMPORT{\u200bprogram}=\"/usr/sbin/mdadm --detail --export $devnode\" \u305d\u306e\u5f8c\u3001\u8a2d\u5b9a\u3092\u53cd\u6620\u3055\u305b\u308b\u305f\u3081\u306b\u30b7\u30b9\u30c6\u30e0\u3092\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u8a73\u3057\u304f\u306f NVIDIA GPUDirect Storage Installation and Troubleshooting Guide \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 PCI Bar1\u30e1\u30e2\u30ea\u306e\u8a2d\u5b9a GPU-Direct SQL\u306f\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u3092\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u4e0a\u306ePCI BAR1\u9818\u57df\uff08\u7269\u7406\u30a2\u30c9\u30ec\u30b9\u7a7a\u9593\uff09\u306b\u30de\u30c3\u30d7\u3057\u3001\u305d\u3053\u3092Destination\u3068\u3059\u308bP2P-RDMA\u8981\u6c42\u3092NVME\u6a5f\u5668\u306b\u5bfe\u3057\u3066\u884c\u3046\u4e8b\u3067\u3001\u30ed\u30b9\u306e\u306a\u3044\u9ad8\u901f\u306a\u30c7\u30fc\u30bf\u8aad\u51fa\u3057\u3092\u5b9f\u73fe\u3057\u307e\u3059\u3002 \u5341\u5206\u306a\u591a\u91cd\u5ea6\u3092\u6301\u3063\u305fP2P-RDMA\u3092\u884c\u3046\u306b\u306f\u3001GPU\u304c\u30d0\u30c3\u30d5\u30a1\u3092\u30de\u30c3\u30d7\u3059\u308b\u306e\u306b\u5341\u5206\u306aPCI BAR1\u9818\u57df\u3092\u6709\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u5927\u534a\u306eGPU\u3067\u306fPCI BAR1\u9818\u57df\u306e\u5927\u304d\u3055\u306f\u56fa\u5b9a\u3067\u3001PG-Strom\u306b\u304a\u3044\u3066\u306f\u3001\u305d\u308c\u304cGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30b5\u30a4\u30ba\u3092\u4e0a\u56de\u3063\u3066\u3044\u308b\u88fd\u54c1\u3092\u63a8\u5968\u3057\u3066\u3044\u307e\u3059\u3002 \u3057\u304b\u3057\u3001\u4e00\u90e8\u306eGPU\u88fd\u54c1\u306b\u304a\u3044\u3066\u306f\u300e\u52d5\u4f5c\u30e2\u30fc\u30c9\u300f\u3092\u5207\u308a\u66ff\u3048\u308b\u4e8b\u3067PCI BAR1\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3092\u5207\u308a\u66ff\u3048\u308b\u4e8b\u304c\u3067\u304d\u308b\u3082\u306e\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u304a\u4f7f\u3044\u306eGPU\u304c\u305d\u308c\u306b\u8a72\u5f53\u3059\u308b\u5834\u5408\u306f\u3001 NVIDIA Display Mode Selector Tool \u3092\u53c2\u7167\u306e\u4e0a\u3001PCI BAR1\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3092\u6700\u5927\u5316\u3059\u308b\u30e2\u30fc\u30c9\u3078\u3068\u5207\u308a\u66ff\u3048\u3066\u304f\u3060\u3055\u3044\u3002 2023\u5e7412\u6708\u6642\u70b9\u3067\u306f\u3001\u4ee5\u4e0b\u306eGPU\u306e\u5834\u5408\u306bNVIDIA Display Mode Selector Tool\u3092\u5229\u7528\u3057\u3066 *Display Off \u30e2\u30fc\u30c9\u3078\u3068\u5207\u308a\u66ff\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 NVIDIA L40S NVIDIA L40 NVIDIA A40 NVIDIA RTX 6000 Ada NVIDIA RTX A6000 NVIDIA RTX A5500 NVIDIA RTX A5000 \u30b7\u30b9\u30c6\u30e0\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308bGPU\u306e\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u3084PCI BAR1\u30b5\u30a4\u30ba\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f\u3001 nvidia-smi -q \u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u30e1\u30e2\u30ea\u95a2\u9023\u306e\u72b6\u614b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 $ nvidia-smi -q : FB Memory Usage Total : 46068 MiB Reserved : 685 MiB Used : 4 MiB Free : 45377 MiB BAR1 Memory Usage Total : 65536 MiB Used : 1 MiB Free : 65535 MiB : HeteroDB \u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb heterodb-extra \u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001PG-Strom\u306b\u4ee5\u4e0b\u306e\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002 \u30de\u30eb\u30c1GPU\u306e\u5bfe\u5fdc GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5bfe\u5fdc \u30e9\u30a4\u30bb\u30f3\u30b9\u7ba1\u7406\u6a5f\u80fd \u3053\u308c\u3089\u306e\u6a5f\u80fd\u3092\u4f7f\u7528\u305b\u305a\u3001\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248\u306e\u6a5f\u80fd\u306e\u307f\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f heterodb-extra \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u4e0d\u8981\u3067\u3059\u3002 \u672c\u7bc0\u306e\u5185\u5bb9\u306f\u8aad\u307f\u98db\u3070\u3057\u3066\u69cb\u3044\u307e\u305b\u3093\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001SWDC\u304b\u3089 heterodb-extra \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002 # dnf install heterodb-extra \u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u6709\u52b9\u5316 heterodb-extra \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5168\u3066\u306e\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u3001HeteroDB\u793e\u304c\u63d0\u4f9b\u3059\u308b\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u6709\u52b9\u5316\u304c\u5fc5\u8981\u3067\u3059\u3002\u30e9\u30a4\u30bb\u30f3\u30b9\u306a\u3057\u3067\u904b\u7528\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001\u305d\u306e\u5834\u5408\u3001\u4e0b\u8a18\u306e\u6a5f\u80fd\u304c\u5236\u9650\u3092\u53d7\u3051\u307e\u3059\u3002 \u30de\u30eb\u30c1GPU\u306e\u5229\u7528 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306b\u304a\u3051\u308b\u8907\u6570NVME-SSD\u306b\u3088\u308b\u30b9\u30c8\u30e9\u30a4\u30d4\u30f3\u30b0(md-raid0) GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306b\u304a\u3051\u308bNVME-oF\u30c7\u30d0\u30a4\u30b9\u306e\u5229\u7528 GPU\u7248PostGIS\u306b\u304a\u3051\u308bGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u5229\u7528 \u30e9\u30a4\u30bb\u30f3\u30b9\u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5f62\u5f0f\u3067HeteroDB\u793e\u304b\u3089\u5165\u624b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 IAgIVdKxhe+BSer3Y67jQW0+uTzYh00K6WOSH7xQ26Qcw8aeUNYqJB9YcKJTJb+QQhjmUeQpUnboNxVwLCd3HFuLXeBWMKp11/BgG0FSrkUWu/ZCtDtw0F1hEIUY7m767zAGV8y+i7BuNXGJFvRlAkxdVO3/K47ocIgoVkuzBfLvN/h9LffOydUnHPzrFHfLc0r3nNNgtyTrfvoZiXegkGM9GBTAKyq8uWu/OGonh9ybzVKOgofhDLk0rVbLohOXDhMlwDl2oMGIr83tIpCWG+BGE+TDwsJ4n71Sv6n4bi/ZBXBS498qShNHDGrbz6cNcDVBa+EuZc6HzZoF6UrljEcl= ---- VERSION:2 SERIAL_NR:HDB-TRIAL ISSUED_AT:2019-05-09 EXPIRED_AT:2019-06-08 GPU_UUID:GPU-a137b1df-53c9-197f-2801-f2dccaf9d42f \u3053\u308c\u3092 /etc/heterodb.license \u306b\u30b3\u30d4\u30fc\u3057\u3001PostgreSQL\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306bPostgreSQL\u306e\u8d77\u52d5\u30ed\u30b0\u306b\u30e9\u30a4\u30bb\u30f3\u30b9\u60c5\u5831\u304c\u51fa\u529b\u3055\u308c\u3001\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u6709\u52b9\u5316\u304c\u884c\u308f\u308c\u305f\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 : LOG: HeteroDB Extra module loaded [api_version=20231105,cufile=on,nvme_strom=off,githash=9ca2fe4d2fbb795ad2d741dcfcb9f2fe499a5bdf] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2022-11-19\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} LOG: PG-Strom version 5.0.1 built for PostgreSQL 15 (githash: 972441dbafed6679af86af40bc8613be2d73c4fd) : PostgreSQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u672c\u7bc0\u3067\u306fRPM\u306b\u3088\u308bPostgreSQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u30bd\u30fc\u30b9\u304b\u3089\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u95a2\u3057\u3066\u306f\u65e2\u306b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u6570\u591a\u304f\u5b58\u5728\u3057\u3001 ./configure \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u591a\u5c90\u306b\u308f\u305f\u308b\u4e8b\u304b\u3089\u3001\u3053\u3053\u3067\u306f\u7d39\u4ecb\u3057\u307e\u305b\u3093\u3002 Linux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u914d\u5e03\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3082PostgreSQL\u306f\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u5fc5\u305a\u3057\u3082\u6700\u65b0\u3067\u306f\u306a\u304f\u3001PG-Strom\u306e\u5bfe\u5fdc\u30d0\u30fc\u30b8\u30e7\u30f3\u3088\u308a\u3082\u53e4\u3044\u3082\u306e\u3067\u3042\u308b\u4e8b\u304c\u591a\u3005\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001Red Hat Enterprise Linux 7.x\u3067\u914d\u5e03\u3055\u308c\u3066\u3044\u308bPostgreSQL\u306fv9.2.x\u3067\u3059\u304c\u3001\u3053\u308c\u306fPostgreSQL\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3068\u3057\u3066\u65e2\u306bEOL\u3068\u306a\u3063\u3066\u3044\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3059\u3002 PostgreSQL Global Development Group\u306f\u3001\u6700\u65b0\u306ePostgreSQL\u304a\u3088\u3073\u95a2\u9023\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u914d\u5e03\u306e\u305f\u3081\u306byum\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002 EPEL\u306e\u8a2d\u5b9a\u306e\u3088\u3046\u306b\u3001yum\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u3060\u3051\u306e\u5c0f\u3055\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u305d\u306e\u5f8c\u3001PostgreSQL\u3084\u305d\u306e\u4ed6\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 yum\u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u306e\u4e00\u89a7\u306f http://yum.postgresql.org/repopackages.php \u3067\u3059\u3002 PostgreSQL\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u3068Linux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3054\u3068\u306b\u591a\u304f\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3042\u306a\u305f\u306eLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u5411\u3051\u306ePostgreSQL 15\u4ee5\u964d\u306e\u3082\u306e\u3092\u9078\u629e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30b9\u30c6\u30c3\u30d7\u3067 PostgreSQL \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3044\u307e\u3059\u3002 yum\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u5b9a\u7fa9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb OS\u6a19\u6e96\u306ePostgreSQL\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u7121\u52b9\u5316 PostgreSQL\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u4f8b\u3048\u3070PostgreSQL v16\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001PG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u306f postgresql16-server \u304a\u3088\u3073 postgresql16-devel \u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4ee5\u4e0b\u306f\u3001RHEL9\u306b\u304a\u3044\u3066PostgreSQL v16\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u624b\u9806\u306e\u4f8b\u3067\u3059\u3002 # dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm # dnf -y module disable postgresql # dnf install -y postgresql16-devel postgresql16-server Note Red Hat Enterprise Linux\u306e\u5834\u5408\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u540d postgresql \u304c\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u6a19\u6e96\u306e\u3082\u306e\u3068\u7af6\u5408\u3057\u3066\u3057\u307e\u3044\u3001PGDG\u63d0\u4f9b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001 dnf -y module disable postgresql \u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u3066\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u6a19\u6e96\u306e postgresql \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u7121\u52b9\u5316\u3057\u307e\u3059\u3002 PG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u672c\u7bc0\u3067\u306fPG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u63a8\u5968\u306fRPM\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u3059\u304c\u3001\u958b\u767a\u8005\u5411\u3051\u306b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u306e\u30d3\u30eb\u30c9\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3082\u7d39\u4ecb\u3057\u307e\u3059\u3002 RPM\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PG-Strom\u304a\u3088\u3073\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8\u306f HeteroDB Software Distribution Center \u3088\u308a\u914d\u5e03\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u65e2\u306byum\u30b7\u30b9\u30c6\u30e0\u3078\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u6e08\u307f\u3067\u3042\u308c\u3070\u3001\u305d\u308c\u307b\u3069\u4f5c\u696d\u306f\u591a\u304f\u3042\u308a\u307e\u305b\u3093\u3002 \u57fa\u76e4\u3068\u306a\u308bPostgreSQL\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3054\u3068\u306b\u5225\u500b\u306ePG-Strom\u306eRPM\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u6e96\u5099\u3055\u308c\u3066\u304a\u308a\u3001PostgreSQL v15\u7528\u3067\u3042\u308c\u3070 pg_strom-PG15 \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u3001PostgreSQL v16\u7528\u3067\u3042\u308c\u3070 pg_strom-PG16 \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u3001PostgreSQL\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30d0\u30a4\u30ca\u30ea\u4e92\u63db\u6027\u306b\u4f34\u3046\u5236\u7d04\u3067\u3059\u3002 # dnf install -y pg_strom-PG16 \u4ee5\u4e0a\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5b8c\u4e86\u3067\u3059\u3002 \u30bd\u30fc\u30b9\u304b\u3089\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u958b\u767a\u8005\u5411\u3051\u306b\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089PG-Strom\u3092\u30d3\u30eb\u30c9\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3082\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u5165\u624b RPM\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u540c\u69d8\u306b\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306etarball\u3092 HeteroDB Software Distribution Center \u304b\u3089\u5165\u624b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u305f\u3060\u3001tarball\u306e\u30ea\u30ea\u30fc\u30b9\u306b\u306f\u3042\u308b\u7a0b\u5ea6\u306e\u30bf\u30a4\u30e0\u30e9\u30b0\u304c\u751f\u3058\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u6700\u65b0\u306e\u958b\u767a\u7248\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306b\u306f PG-Strom\u306eGitHub\u30ea\u30dd\u30b8\u30c8\u30ea \u306e master \u30d6\u30e9\u30f3\u30c1\u3092\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3059\u308b\u65b9\u6cd5\u306e\u65b9\u304c\u597d\u307e\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 $ git clone https://github.com/heterodb/pg-strom.git Cloning into 'pg-strom'... remote: Counting objects: 13797, done. remote: Compressing objects: 100% (215/215), done. remote: Total 13797 (delta 208), reused 339 (delta 167), pack-reused 13400 Receiving objects: 100% (13797/13797), 11.81 MiB | 1.76 MiB/s, done. Resolving deltas: 100% (10504/10504), done. PG-Strom\u306e\u30d3\u30eb\u30c9 PG-Strom\u3092\u30d3\u30eb\u30c9\u3059\u308b\u6642\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u306f\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u306ePostgreSQL\u3068\u53b3\u5bc6\u306b\u4e00\u81f4\u3057\u3066\u3044\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070\u3001\u540c\u3058\u69cb\u9020\u4f53\u304c\u30d3\u30eb\u30c9\u6642\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u306b\u3088\u308aPostgreSQL\u3068PG-Strom\u3067\u7570\u306a\u3063\u305f\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u6301\u3063\u3066\u3057\u307e\u3063\u305f\u3068\u3059\u308c\u3070\u3001\u975e\u5e38\u306b\u767a\u898b\u306e\u96e3\u3057\u3044\u30d0\u30b0\u3092\u751f\u307f\u51fa\u3057\u3066\u3057\u307e\u3046\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 \u3057\u305f\u304c\u3063\u3066\u3001\uff08\u4e00\u8cab\u6027\u306e\u306a\u3044\u72b6\u614b\u3092\u907f\u3051\u308b\u305f\u3081\uff09PG-Strom\u306f\u72ec\u81ea\u306bconfigure\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8d70\u3089\u305b\u305f\u308a\u306f\u305b\u305a\u3001 pg_config \u3092\u4f7f\u3063\u3066PostgreSQL\u306e\u30d3\u30eb\u30c9\u6642\u8a2d\u5b9a\u3092\u53c2\u7167\u3057\u307e\u3059\u3002 pg_config \u306b\u30d1\u30b9\u304c\u901a\u3063\u3066\u304a\u308a\u3001\u305d\u308c\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u306ePostgreSQL\u306e\u3082\u306e\u3067\u3042\u308c\u3070\u3001\u305d\u306e\u307e\u307e make \u3001 make install \u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 \u76f4\u63a5\u30d1\u30b9\u304c\u901a\u3063\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001 make \u30b3\u30de\u30f3\u30c9\u306b PG_CONFIG=... \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4e0e\u3048\u3001 pg_config \u306e\u30d5\u30eb\u30d1\u30b9\u3092\u6e21\u3057\u307e\u3059\u3002 $ cd pg-strom/src $ make PG_CONFIG=/usr/pgsql-16/bin/pg_config $ sudo make install PG_CONFIG=/usr/pgsql-16/bin/pg_config \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306e\u8a2d\u5b9a \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u306e\u4f5c\u6210 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u306e\u4f5c\u6210\u304c\u6e08\u3093\u3067\u3044\u306a\u3044\u5834\u5408\u306f\u3001 initdb \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066PostgreSQL\u306e\u521d\u671f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 RPM\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u304a\u3051\u308b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u306e\u30d1\u30b9\u306f /var/lib/pgsql//data \u3067\u3059\u3002 postgresql-alternatives \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001PostgreSQL\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u62e0\u3089\u305a /var/lib/pgdata \u3067\u53c2\u7167\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 # su - postgres $ /usr/pgsql-16/bin/initdb -D /var/lib/pgdata/ The files belonging to this database system will be owned by user \"postgres\". This user must also own the server process. The database cluster will be initialized with locale \"en_US.UTF-8\". The default database encoding has accordingly been set to \"UTF8\". The default text search configuration will be set to \"english\". Data page checksums are disabled. fixing permissions on existing directory /var/lib/pgdata ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Tokyo creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling \"trust\" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D /var/lib/pgdata/ -l logfile start postgresql.conf\u306e\u7de8\u96c6 \u7d9a\u3044\u3066\u3001PostgreSQL\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308b postgresql.conf \u3092\u7de8\u96c6\u3057\u307e\u3059\u3002 PG-Strom\u3092\u52d5\u4f5c\u3055\u305b\u308b\u305f\u3081\u306b\u306f\u3001\u6700\u4f4e\u9650\u3001\u4ee5\u4e0b\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002 \u3053\u308c\u4ee5\u5916\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3064\u3044\u3066\u3082\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u7528\u9014\u3084\u60f3\u5b9a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u8e0f\u307e\u3048\u3066\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 shared_preload_libraries PG-Strom\u30e2\u30b8\u30e5\u30fc\u30eb\u306f shared_preload_libraries \u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308apostmaster\u30d7\u30ed\u30bb\u30b9\u306e\u8d77\u52d5\u6642\u306b\u30ed\u30fc\u30c9\u3055\u308c\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30aa\u30f3\u30c7\u30de\u30f3\u30c9\u3067\u306e\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30ed\u30fc\u30c9\u306f\u30b5\u30dd\u30fc\u30c8\u5bfe\u8c61\u5916\u3067\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u9805\u76ee\u306f\u5fc5\u9808\u3067\u3059\u3002 shared_preload_libraries = '$libdir/pg_strom' max_worker_processes PG-Strom\u306f\u6570\u500b\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u3092\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3067\u3042\u308b 8 \u3067\u306f\u3001\u305d\u308c\u4ee5\u5916\u306e\u51e6\u7406\u306b\u5229\u7528\u3067\u304d\u308b\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u6570\u304c\u3042\u307e\u308a\u306b\u3082\u5c11\u306a\u3059\u304e\u3066\u3057\u307e\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u305f\u5024\u3092\u8a2d\u5b9a\u3059\u3079\u304d\u3067\u3059\u3002 max_worker_processes = 100 shared_buffers \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u3088\u308a\u307e\u3059\u304c\u3001 shared_buffers \u306e\u521d\u671f\u8a2d\u5b9a\u306f\u975e\u5e38\u306b\u5c0f\u3055\u3044\u305f\u3081\u3001PG-Strom\u304c\u6709\u52b9\u306b\u6a5f\u80fd\u3059\u308b\u6c34\u6e96\u306e\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u306b\u5bfe\u3057\u3066\u306f\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3078\u306e\u8aad\u307f\u66f8\u304d\u304c\u5f8b\u901f\u8981\u56e0\u3068\u306a\u3063\u3066\u3057\u307e\u3044\u3001GPU\u306e\u4e26\u5217\u8a08\u7b97\u6a5f\u80fd\u3092\u6709\u52b9\u306b\u5229\u7528\u3067\u304d\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u305f\u5024\u3092\u8a2d\u5b9a\u3059\u3079\u304d\u3067\u3059\u3002 shared_buffers = 10GB \u660e\u3089\u304b\u306b\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u3088\u308a\u3082\u5927\u304d\u306a\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306f\u3001SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306e\u5229\u7528\u3092\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 work_mem \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u3088\u308a\u307e\u3059\u304c\u3001 work_mem \u306e\u521d\u671f\u8a2d\u5b9a\u306f\u975e\u5e38\u306b\u5c0f\u3055\u3044\u305f\u3081\u3001\u89e3\u6790\u7cfb\u30af\u30a8\u30ea\u3067\u6700\u9069\u306a\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u304c\u9078\u629e\u3055\u308c\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u5178\u578b\u7684\u306a\u4f8b\u306f\u3001\u30bd\u30fc\u30c8\u51e6\u7406\u306b\u30aa\u30f3\u30e1\u30e2\u30ea\u306e\u30af\u30a4\u30c3\u30af\u30bd\u30fc\u30c8\u3067\u306f\u306a\u304f\u3001\u30c7\u30a3\u30b9\u30af\u30d9\u30fc\u30b9\u306e\u30de\u30fc\u30b8\u30bd\u30fc\u30c8\u3092\u9078\u629e\u3059\u308b\u3068\u3044\u3063\u305f\u3082\u306e\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u305f\u5024\u3092\u8a2d\u5b9a\u3059\u3079\u304d\u3067\u3059\u3002 work_mem = 1GB OS\u306e\u30ea\u30bd\u30fc\u30b9\u5236\u9650\u306e\u62e1\u5f35 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u7279\u306b\u3001\u540c\u6642\u306b\u5927\u91cf\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30aa\u30fc\u30d7\u30f3\u3059\u308b\u4e8b\u304c\u3042\u308b\u305f\u3081\u3001\u30d7\u30ed\u30bb\u30b9\u3042\u305f\u308a\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30b9\u30af\u30ea\u30d7\u30bf\u6570\u306e\u4e0a\u9650\u3092\u62e1\u5927\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u307e\u305f\u3001PostgreSQL\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u6642\u306b\u78ba\u5b9f\u306b\u30b3\u30a2\u30c0\u30f3\u30d7\u3092\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u3001\u30b3\u30a2\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u4e0a\u9650\u3092\u5236\u9650\u3057\u306a\u3044\u3053\u3068\u3092\u63a8\u5968\u3057\u307e\u3059\u3002 PostgreSQL\u3092systemd\u7d4c\u7531\u3067\u8d77\u52d5\u3059\u308b\u5834\u5408\u3001\u30ea\u30bd\u30fc\u30b9\u5236\u9650\u306b\u95a2\u3059\u308b\u8a2d\u5b9a\u306f /etc/systemd/system/postgresql-XX.service.d/pg_strom.conf \u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002 RPM\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u5834\u5408\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4ee5\u4e0b\u306e\u5185\u5bb9\u304c\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002 \u74b0\u5883\u5909\u6570 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u306b\u95a2\u3059\u308b\u8a2d\u5b9a\u304c\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u958b\u767a\u8005\u5411\u3051\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3001\u3053\u308c\u3092\u6709\u52b9\u306b\u3057\u3066\u8d77\u52d5\u3059\u308b\u3068\u3001GPU\u5074\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306bGPU\u306e\u30b3\u30a2\u30c0\u30f3\u30d7\u3092\u751f\u6210\u3055\u305b\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u8a73\u3057\u304f\u306f CUDA-GDB:GPU core dump support \u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1 PostgreSQL\u306e\u8d77\u52d5 PostgreSQL\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002 \u6b63\u5e38\u306b\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u304c\u5b8c\u4e86\u3057\u3066\u3044\u308c\u3070\u3001\u30ed\u30b0\u306bPG-Strom\u304cGPU\u3092\u8a8d\u8b58\u3057\u305f\u4e8b\u3092\u793a\u3059\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8a18\u9332\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001NVIDIA A100 (PCIE\u7248; 40GB) \u3092\u8a8d\u8b58\u3057\u3066\u304a\u308a\u3001\u307e\u305f\u3001NVME-SSD\u3054\u3068\u306b\u8fd1\u508d\u306eGPU\u304c\u3069\u3061\u3089\u3067\u3042\u308b\u306e\u304b\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002 # systemctl start postgresql-16 # journalctl -u postgresql-16 Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB Extra module loaded [api_version=20240418,cufile=off,nvme_strom=off,githash=3ffc65428c07bb3c9d0e5c75a2973389f91dfcd4] Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2024-06-02\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: PG-Strom version 5.12.el9 built for PostgreSQL 16 (githash: ) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom binary built for CUDA 12.4 (CUDA runtime 12.5) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] WARNING: The CUDA version where this PG-Strom module binary was built for (12.4) is newer than the CUDA runtime version on this platform (12.5). It may lead unexpected behavior, and upgrade of CUDA toolkit is recommended. Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78979c134606) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:81:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:82:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c2:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c6:00:0] nvme4 (Corsair MP600 CORE) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c3:00:0] nvme5 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c1:00:0] nvme0 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c4:00:0] nvme2 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] LOG: redirecting log output to logging collector process Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] HINT: Future log output will appear in directory \"log\". Jun 02 17:28:48 buri.heterodb.com systemd[1]: Started PostgreSQL 16 database server. PG-Strom\u30a8\u30af\u30b9\u30c6\u30f3\u30b7\u30e7\u30f3\u306e\u4f5c\u6210 \u6700\u5f8c\u306b\u3001PG-Strom\u306b\u95a2\u9023\u3059\u308bSQL\u95a2\u6570\u306a\u3069\u306eDB\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u3053\u306e\u624b\u9806\u306fPostgreSQL\u306eEXTENSION\u6a5f\u80fd\u3092\u7528\u3044\u3066\u30d1\u30c3\u30b1\u30fc\u30b8\u5316\u3055\u308c\u3066\u304a\u308a\u3001SQL\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067 CREATE EXTENSION \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u3059\u3002 \u306a\u304a\u3001\u3053\u306e\u624b\u9806\u306f\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u305f\u3073\u306b\u5fc5\u8981\u306b\u306a\u308b\u4e8b\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u305f\u6642\u70b9\u3067\u65e2\u306bPG-Strom\u95a2\u9023\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u3066\u307b\u3057\u3044\u5834\u5408\u306f\u3001\u4e88\u3081 template1 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067PG-Strom\u30a8\u30af\u30b9\u30c6\u30f3\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3066\u304a\u3051\u3070\u3001 CREATE DATABASE \u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u6642\u306b\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u8a2d\u5b9a\u304c\u30b3\u30d4\u30fc\u3055\u308c\u307e\u3059\u3002 $ psql -U postgres psql (16.3) Type \"help\" for help. postgres=# CREATE EXTENSION pg_strom ; CREATE EXTENSION \u4ee5\u4e0a\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4f5c\u696d\u306f\u5b8c\u4e86\u3067\u3059\u3002 PostGIS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PG-Strom\u306f\u4e00\u90e8\u306ePostGIS\u95a2\u6570\u306eGPU\u51e6\u7406\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002 \u672c\u7bc0\u3067\u306fPostGIS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306b\u3064\u3044\u3066\u8aac\u660e\u3092\u884c\u3044\u307e\u3059\u304c\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u8aad\u307f\u98db\u3070\u3057\u3066\u304f\u3060\u3055\u3044\u3002 PostgreSQL\u3068\u540c\u69d8\u306b\u3001PostgreSQL Global Development Group\u306eyum\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089PostGIS\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001PostgreSQL v16\u5411\u3051\u306b\u30d3\u30eb\u30c9\u3055\u308c\u305fPostGIS v3.4\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3082\u306e\u3067\u3059\u3002 # dnf install postgis34_16 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u3092\u4f5c\u6210\u3057\u3066PostgreSQL\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3057\u3001SQL\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089 CREATE EXTENSION \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066Geometry\u30c7\u30fc\u30bf\u578b\u3084\u5730\u7406\u60c5\u5831\u5206\u6790\u306e\u305f\u3081\u306eSQL\u95a2\u6570\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u3053\u308c\u3067PostGIS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5b8c\u4e86\u3067\u3059\u3002 postgres=# CREATE EXTENSION postgis; CREATE EXTENSION","title":"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#_1","text":"\u672c\u7ae0\u3067\u306fPG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#_2","text":"\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30aa\u30da\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u3092\u52d5\u4f5c\u53ef\u80fd\u306a x86_64 \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306e\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u304c\u5fc5\u8981\u3067\u3059\u3002 CPU\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3001\u304a\u3088\u3073\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30c7\u30d0\u30a4\u30b9\u306b\u306f\u7279\u5225\u306a\u8981\u4ef6\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001 note002:HW Validation List \u306f\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9078\u5b9a\u306e\u4e0a\u3067\u53c2\u8003\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3092\u5229\u7528\u3059\u308b\u306b\u306fNVME\u898f\u683c\u306b\u5bfe\u5fdc\u3057\u305fSSD\u3001\u307e\u305f\u306fRoCE\u306b\u5bfe\u5fdc\u3057\u305f\u9ad8\u901fNIC\u304c\u5fc5\u8981\u3067\u3001GPU\u3068\u540c\u4e00\u306ePCIe Root Complex\u914d\u4e0b\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9 PG-Strom\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u5c11\u306a\u304f\u3068\u3082\u4e00\u500b\u306eGPU\u30c7\u30d0\u30a4\u30b9\u304c\u30b7\u30b9\u30c6\u30e0\u4e0a\u306b\u5fc5\u8981\u3067\u3059\u3002\u3053\u308c\u3089\u306fCUDA Toolkit\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u304a\u308a\u3001computing capability \u304c6.0\u4ee5\u964d\u306e\u30e2\u30c7\u30eb\uff08Pascal\u4e16\u4ee3\u4ee5\u964d\uff09\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 002: HW Validation List - List of supported GPU models \u3092\u53c2\u8003\u306bGPU\u3092\u9078\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Operating System PG-Strom\u306e\u5b9f\u884c\u306b\u306f\u3001CUDA Toolkit\u306b\u3088\u308a\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308bx86_64\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u5411\u3051\u306eLinux OS\u304c\u5fc5\u8981\u3067\u3059\u3002\u63a8\u5968\u74b0\u5883\u306fRed Hat Enterprise Linux\u307e\u305f\u306fRocky Linux\u30d0\u30fc\u30b8\u30e7\u30f3 8.x\u3067\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\uff08cuFile\u30c9\u30e9\u30a4\u30d0\uff09\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u3001CUDA Toolkit\u306b\u542b\u307e\u308c\u308bnvidia-fs\u30c9\u30e9\u30a4\u30d0\u3068\u3001Mellanox OFED (OpenFabrics Enterprise Distribution) \u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002 PostgreSQL PG-Strom v5.0\u306e\u5b9f\u884c\u306b\u306fPostgreSQL\u30d0\u30fc\u30b8\u30e7\u30f315\u4ee5\u964d\u304c\u5fc5\u8981\u3067\u3059\u3002 PG-Strom\u304c\u5185\u90e8\u7684\u306b\u5229\u7528\u3057\u3066\u3044\u308bAPI\u306e\u4e2d\u306b\u306f\u3001\u3053\u308c\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u63d0\u4f9b\u3055\u308c\u3066\u3044\u306a\u3044\u3082\u306e\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002 CUDA Toolkit PG-Strom\u306e\u5b9f\u884c\u306b\u306fCUDA Toolkit \u30d0\u30fc\u30b8\u30e7\u30f312.2update2\u4ee5\u964d\u304c\u5fc5\u8981\u3067\u3059\u3002 PG-Strom\u304c\u5185\u90e8\u7684\u306b\u5229\u7528\u3057\u3066\u3044\u308bAPI\u306e\u4e2d\u306b\u306f\u3001\u3053\u308c\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u63d0\u4f9b\u3055\u308c\u3066\u3044\u306a\u3044\u3082\u306e\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002","title":"\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8"},{"location":"install/#_3","text":"\u4e00\u9023\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3068\u306a\u308a\u307e\u3059\u3002 H/W\u306e\u521d\u671f\u8a2d\u5b9a OS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb MOFED\u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb CUDA Toolkit \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb HeteroDB\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PostgreSQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PostgreSQL\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u5fc5\u8981\u306b\u5fdc\u3058\u3066\uff09 PostGIS contrib/cube","title":"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806"},{"location":"install/#os","text":"CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3092\u9078\u629e\u3057\u3001\u500b\u3005\u306e\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d7\u30ed\u30bb\u30b9\u306b\u5f93\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4f5c\u696d\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306f\u3001 NVIDIA DEVELOPER ZONE \u306b\u304a\u3044\u3066\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002 Red Hat Enterprise Linux 8.x\u7cfb\u5217\uff08Rocky Linux 8.x\u7cfb\u5217\u3092\u542b\u3080\uff09\u306e\u5834\u5408\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u69cb\u6210\u306f\u3001\u30d9\u30fc\u30b9\u74b0\u5883\u3068\u3057\u3066\u300c\u6700\u5c0f\u9650\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3001\u3055\u3089\u306b\u8ffd\u52a0\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u3057\u3066\u300c\u958b\u767a\u30c4\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 Red Hat Enterprise Linux 9.x\u7cfb\u5217\uff08Rocky Linux 9.x\u7cfb\u5217\u3092\u542b\u3080\uff09\u306e\u5834\u5408\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u69cb\u6210\u306f\u3001\u30d9\u30fc\u30b9\u74b0\u5883\u3068\u3057\u3066\u300c\u6700\u5c0f\u9650\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3001\u3055\u3089\u306b\u8ffd\u52a0\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u3057\u3066\u300c\u6a19\u6e96\u300d\u300c\u958b\u767a\u30c4\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30b5\u30fc\u30d0\u30fc\u3078\u306eOS\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u3001\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u30fc\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u306b\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002 \u306a\u304a\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u3067\u300c\u958b\u767a\u30c4\u30fc\u30eb\u300d\u3092\u9078\u629e\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067OS\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306b\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 # dnf groupinstall 'Development Tools' Tip \u30b5\u30fc\u30d0\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308bGPU\u304c\u65b0\u3057\u3059\u304e\u308b\u5834\u5408\u3001OS\u8d77\u52d5\u4e2d\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u7b49\u306e\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u5834\u5408\u3001\u30ab\u30fc\u30cd\u30eb\u8d77\u52d5\u30aa\u30d7\u30b7\u30e7\u30f3\u306b nouveau.modeset=0 \u3092\u8ffd\u52a0\u3057\u3066\u6a19\u6e96\u306e\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u30c9\u30e9\u30a4\u30d0\u3092\u7121\u52b9\u5316\u3059\u308b\u4e8b\u3067 \u554f\u984c\u3092\u56de\u907f\u3067\u304d\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002","title":"OS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#nouveau","text":"NVIDIA\u88fdGPU\u5411\u3051\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u4e92\u63db\u30c9\u30e9\u30a4\u30d0\u3067\u3042\u308bnouveau\u30c9\u30e9\u30a4\u30d0\u304c\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001nvidia\u30c9\u30e9\u30a4\u30d0\u3092\u30ed\u30fc\u30c9\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002 \u3053\u306e\u5834\u5408\u306f\u3001nouveau\u30c9\u30e9\u30a4\u30d0\u306e\u7121\u52b9\u5316\u8a2d\u5b9a\u3092\u884c\u3063\u305f\u4e0a\u3067\u30b7\u30b9\u30c6\u30e0\u3092\u4e00\u5ea6\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 nouveau\u30c9\u30e9\u30a4\u30d0\u3092\u7121\u52b9\u5316\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092 /etc/modprobe.d/disable-nouveau.conf \u3068\u3044\u3046\u540d\u524d\u3067\u4fdd\u5b58\u3057\u3001 dracut \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066Linux kernel\u306e\u30d6\u30fc\u30c8\u30a4\u30e1\u30fc\u30b8\u306b\u53cd\u6620\u3057\u307e\u3059\u3002 \u305d\u306e\u5f8c\u3001\u30b7\u30b9\u30c6\u30e0\u3092\u4e00\u5ea6\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 # cat > /etc/modprobe.d/disable-nouveau.conf </kernel/drivers/nvme/host/nvme-rdma.ko.xz \uff09\u3067\u306f\u306a\u304f\u3001\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f /lib/modules//extra/mlnx-nvme/host/nvme-rdma.ko \u304c\u512a\u5148\u3057\u3066\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002 $ modinfo nvme-rdma filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/mlnx-nvme/host/nvme-rdma.ko license: GPL v2 rhelversion: 9.4 srcversion: 16C0049F26768D6EA12771B depends: nvme-core,rdma_cm,ib_core,nvme-fabrics,mlx_compat retpoline: Y name: nvme_rdma vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions parm: register_always:Use memory registration even for contiguous memory regions (bool) \u65e2\u306b\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\uff08\u4f8b: nvme \uff09\u3092\u7f6e\u304d\u63db\u3048\u308b\u305f\u3081\u3001\u3053\u3053\u3067\u4e00\u5ea6\u30b7\u30b9\u30c6\u30e0\u306e\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3068\u518d\u8d77\u52d5\u3092\u884c\u3044\u307e\u3059\u3002 mlnxofedinstall \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b8c\u4e86\u5f8c\u306b\u3001 dracut -f \u3092\u5b9f\u884c\u3059\u308b\u306e\u3092\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002 Tips Linux kernel\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3068MOFED\u30c9\u30e9\u30a4\u30d0 RHEL\u7cfb\u5217\u306e\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306b\u304a\u3044\u3066\u3001MODED\u30c9\u30e9\u30a4\u30d0\u306fDKMS(Dynamic Kernel Module Support)\u3092\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002 \u305d\u306e\u305f\u3081\u3001Linux kernel\u3092\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3057\u305f\u5834\u5408\u306b\u306f\u3001\u4e0a\u8a18\u306e\u624b\u9806\u3092\u518d\u5ea6\u5b9f\u884c\u3057\u3001\u65b0\u3057\u3044Linux kernel\u306b\u5bfe\u5fdc\u3057\u305fMOFED\u30c9\u30e9\u30a4\u30d0\u3092\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u5f8c\u8ff0\u306eCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u66f4\u65b0\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067Linux kernel\u304c\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3055\u308c\u308b\u4e8b\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u305d\u306e\u5834\u5408\u3067\u3082\u540c\u69d8\u3067\u3059\u3002","title":"MOFED\u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#heterodb-swdc","text":"PG-Strom\u307b\u304b\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8\u306f HeteroDB Software Distribution Center \u304b\u3089\u914d\u5e03\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u5165\u624b\u3059\u308b\u305f\u3081\u306b\u3001HeteroDB-SWDC\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u3092yum\u30b7\u30b9\u30c6\u30e0\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 HeteroDB-SWDC\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u5b9a\u7fa9\u306fheterodb-swdc\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3088\u308a\u63d0\u4f9b\u3055\u308c\u307e\u3059\u3002 Web\u30d6\u30e9\u30a6\u30b6\u306a\u3069\u3067 HeteroDB Software Distribution Center \u3078\u30a2\u30af\u30bb\u30b9\u3057\u3001\u30da\u30fc\u30b8\u306e\u5148\u982d\u306b\u30ea\u30f3\u30af\u306e\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b heterodb-swdc-1.3-1.el9.noarch.rpm \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08RHEL8\u306e\u5834\u5408\u306f heterodb-swdc-1.3-1.el8.noarch.rpm \uff09 heterodb-swdc\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u3068\u3001HeteroDB-SWDC\u304b\u3089\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u5165\u624b\u3059\u308b\u305f\u3081\u306eyum\u30b7\u30b9\u30c6\u30e0\u3078\u306e\u8a2d\u5b9a\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306bheterodb-swdc\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 # dnf install https://heterodb.github.io/swdc/yum/rhel8-noarch/heterodb-swdc-1.2-1.el8.noarch.rpm","title":"heterodb-swdc\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#cuda-toolkit","text":"\u672c\u7bc0\u3067\u306fCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u65e2\u306b\u6700\u65b0\u306eCUDA Toolkit\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3067\u3042\u308b\u5834\u5408\u3001\u672c\u7bc0\u306e\u521d\u671f\u8a2d\u5b9a\u3068\u5408\u81f4\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 NVIDIA\u306fCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\uff12\u901a\u308a\u306e\u65b9\u6cd5\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002\u4e00\u3064\u306f\u81ea\u5df1\u5b9f\u884c\u578b\u30a2\u30fc\u30ab\u30a4\u30d6\uff08runfile\uff09\u306b\u3088\u308b\u3082\u306e\u3002\u3082\u3046\u4e00\u3064\u306fRPM\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3088\u308b\u3082\u306e\u3067\u3001PG-Strom\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u306fRPM\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u63a8\u5968\u3057\u307e\u3059\u3002 CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u7528\u30d1\u30c3\u30b1\u30fc\u30b8\u306fNVIDIA DEVELOPER ZONE\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u9069\u5207\u306aOS\u3001\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3001\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3001\u300erpm(network)\u300f\u7248\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u300erpm(network)\u300f\u3092\u9078\u629e\u3059\u308b\u3068\u3001\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u767b\u9332\u3057\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7d4c\u7531\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u306e\u30b7\u30a7\u30eb\u30b3\u30de\u30f3\u30c9\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u30ac\u30a4\u30c0\u30f3\u30b9\u901a\u308a\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u9032\u3081\u3066\u304f\u3060\u3055\u3044\u3002 # dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo # dnf clean all # dnf install cuda-toolkit-12-5 CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u7d9a\u3044\u3066\u3001\u30c9\u30e9\u30a4\u30d0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u305f\u3081\u306e\u30b3\u30de\u30f3\u30c9\u304c\uff12\u7a2e\u985e\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u3053\u3067\u306f \u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248\u306envidia-driver \u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248\u306e\u307f\u304cGPUDirect Storage\u6a5f\u80fd\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u304a\u308a\u3001PG-Strom\u306eGPU-Direct SQL\u306f\u672c\u6a5f\u80fd\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002 Tips Volta\u4ee5\u524d\u306eGPU\u306e\u5229\u7528\u306b\u3064\u3044\u3066 \u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248nvidia\u30c9\u30e9\u30a4\u30d0\u306f\u3001Volta\u4e16\u4ee3\u4ee5\u524d\u306eGPU\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002 \u3057\u305f\u304c\u3063\u3066\u3001Volta\u307e\u305f\u306fPascal\u4e16\u4ee3\u306eGPU\u3067PG-Strom\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u30d7\u30ed\u30d7\u30e9\u30a8\u30bf\u30ea\u7248\u306e\u30c9\u30e9\u30a4\u30d0\u3067\u3042\u3063\u3066\u3082GPUDirect Storage\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308bCUDA 12.2 Update 1\u3092\u5229\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 CUDA 12.2 Update 1\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306f \u3053\u3061\u3089 \u304b\u3089\u5165\u624b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u7d9a\u3044\u3066\u3001GPU-Direct Storage(GDS)\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306e\u30c9\u30e9\u30a4\u30d0\u30e2\u30b8\u30e5\u30fc\u30eb nvidia-gds \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u306b\u7d9a\u3044\u3066CUDA Toolkit\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u540c\u4e00\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u540d\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 # dnf module install nvidia-driver:open-dkms # dnf install nvidia-gds-12-5 \u6b63\u5e38\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001 /usr/local/cuda \u914d\u4e0b\u306bCUDA Toolkit\u304c\u5c0e\u5165\u3055\u308c\u3066\u3044\u307e\u3059\u3002 $ ls /usr/local/cuda/ bin/ gds/ nsightee_plugins/ targets/ compute-sanitizer/ include@ nvml/ tools/ CUDA_Toolkit_Release_Notes.txt lib64@ nvvm/ version.json DOCS libnvvp/ README EULA.txt LICENSE share/ extras/ man/ src/ \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001GPU\u304c\u6b63\u3057\u304f\u8a8d\u8b58\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 nvidia-smi \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u51fa\u529b\u4f8b\u306e\u3088\u3046\u306b\u3001\u30b7\u30b9\u30c6\u30e0\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308bGPU\u306e\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 $ nvidia-smi Mon Jun 3 09:56:41 2024 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 555.42.02 Driver Version: 555.42.02 CUDA Version: 12.5 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA A100-PCIE-40GB Off | 00000000:41:00.0 Off | 0 | | N/A 58C P0 66W / 250W | 1MiB / 40960MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+","title":"CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#gpudirect-storage","text":"\u4e0a\u8a18\u306e\u624b\u9806\u3067CUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001GPUDirect Storage\u304c\u5229\u7528\u53ef\u80fd\u306a\u72b6\u614b\u3068\u306a\u3063\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u901a\u308a\u3001 gdscheck \u30c4\u30fc\u30eb\u3092\u7528\u3044\u3066\u30b9\u30c8\u30ec\u30fc\u30b8\u30c7\u30d0\u30a4\u30b9\u6bce\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \uff08\u3053\u306e\u4f8b\u3067\u306f\u3001 nvme \u3060\u3051\u3067\u306a\u304f\u3001 nvme-rdma \u3084 rpcrdma \u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\u3082\u30ed\u30fc\u30c9\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u95a2\u9023\u3059\u308b\u6a5f\u80fd\u304c Supported \u3068\u306a\u3063\u3066\u3044\u307e\u3059\uff09 # /usr/local/cuda/gds/tools/gdscheck -p GDS release version: 1.10.0.4 nvidia_fs version: 2.20 libcufile version: 2.12 Platform: x86_64 ============ ENVIRONMENT: ============ ===================== DRIVER CONFIGURATION: ===================== NVMe : Supported NVMeOF : Supported SCSI : Unsupported ScaleFlux CSD : Unsupported NVMesh : Unsupported DDN EXAScaler : Unsupported IBM Spectrum Scale : Unsupported NFS : Supported BeeGFS : Unsupported WekaFS : Unsupported Userspace RDMA : Unsupported --Mellanox PeerDirect : Disabled --rdma library : Not Loaded (libcufile_rdma.so) --rdma devices : Not configured --rdma_device_status : Up: 0 Down: 0 ===================== CUFILE CONFIGURATION: ===================== properties.use_compat_mode : true properties.force_compat_mode : false properties.gds_rdma_write_support : true properties.use_poll_mode : false properties.poll_mode_max_size_kb : 4 properties.max_batch_io_size : 128 properties.max_batch_io_timeout_msecs : 5 properties.max_direct_io_size_kb : 16384 properties.max_device_cache_size_kb : 131072 properties.max_device_pinned_mem_size_kb : 33554432 properties.posix_pool_slab_size_kb : 4 1024 16384 properties.posix_pool_slab_count : 128 64 32 properties.rdma_peer_affinity_policy : RoundRobin properties.rdma_dynamic_routing : 0 fs.generic.posix_unaligned_writes : false fs.lustre.posix_gds_min_kb: 0 fs.beegfs.posix_gds_min_kb: 0 fs.weka.rdma_write_support: false fs.gpfs.gds_write_support: false profile.nvtx : false profile.cufile_stats : 0 miscellaneous.api_check_aggressive : false execution.max_io_threads : 4 execution.max_io_queue_depth : 128 execution.parallel_io : true execution.min_io_threshold_size_kb : 8192 execution.max_request_parallelism : 4 properties.force_odirect_mode : false properties.prefer_iouring : false ========= GPU INFO: ========= GPU index 0 NVIDIA A100-PCIE-40GB bar:1 bar size (MiB):65536 supports GDS, IOMMU State: Disabled ============== PLATFORM INFO: ============== IOMMU: disabled Nvidia Driver Info Status: Supported(Nvidia Open Driver Installed) Cuda Driver Version Installed: 12050 Platform: AS -2014CS-TR, Arch: x86_64(Linux 5.14.0-427.18.1.el9_4.x86_64) Platform verification succeeded Tips RAID\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306e\u8ffd\u52a0\u8a2d\u5b9a GPUDirect Storage\u3092\u5229\u7528\u3057\u3066Software RAID (md-raid0) \u533a\u753b\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3059\u5834\u5408\u3001 \u4ee5\u4e0b\u306e\u4e00\u884c\u3092 /lib/udev/rules.d/63-md-raid-arrays.rules \u8a2d\u5b9a\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 IMPORT{\u200bprogram}=\"/usr/sbin/mdadm --detail --export $devnode\" \u305d\u306e\u5f8c\u3001\u8a2d\u5b9a\u3092\u53cd\u6620\u3055\u305b\u308b\u305f\u3081\u306b\u30b7\u30b9\u30c6\u30e0\u3092\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u8a73\u3057\u304f\u306f NVIDIA GPUDirect Storage Installation and Troubleshooting Guide \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"GPUDirect Storage\u306e\u78ba\u8a8d"},{"location":"install/#pci-bar1","text":"GPU-Direct SQL\u306f\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u3092\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u4e0a\u306ePCI BAR1\u9818\u57df\uff08\u7269\u7406\u30a2\u30c9\u30ec\u30b9\u7a7a\u9593\uff09\u306b\u30de\u30c3\u30d7\u3057\u3001\u305d\u3053\u3092Destination\u3068\u3059\u308bP2P-RDMA\u8981\u6c42\u3092NVME\u6a5f\u5668\u306b\u5bfe\u3057\u3066\u884c\u3046\u4e8b\u3067\u3001\u30ed\u30b9\u306e\u306a\u3044\u9ad8\u901f\u306a\u30c7\u30fc\u30bf\u8aad\u51fa\u3057\u3092\u5b9f\u73fe\u3057\u307e\u3059\u3002 \u5341\u5206\u306a\u591a\u91cd\u5ea6\u3092\u6301\u3063\u305fP2P-RDMA\u3092\u884c\u3046\u306b\u306f\u3001GPU\u304c\u30d0\u30c3\u30d5\u30a1\u3092\u30de\u30c3\u30d7\u3059\u308b\u306e\u306b\u5341\u5206\u306aPCI BAR1\u9818\u57df\u3092\u6709\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u5927\u534a\u306eGPU\u3067\u306fPCI BAR1\u9818\u57df\u306e\u5927\u304d\u3055\u306f\u56fa\u5b9a\u3067\u3001PG-Strom\u306b\u304a\u3044\u3066\u306f\u3001\u305d\u308c\u304cGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30b5\u30a4\u30ba\u3092\u4e0a\u56de\u3063\u3066\u3044\u308b\u88fd\u54c1\u3092\u63a8\u5968\u3057\u3066\u3044\u307e\u3059\u3002 \u3057\u304b\u3057\u3001\u4e00\u90e8\u306eGPU\u88fd\u54c1\u306b\u304a\u3044\u3066\u306f\u300e\u52d5\u4f5c\u30e2\u30fc\u30c9\u300f\u3092\u5207\u308a\u66ff\u3048\u308b\u4e8b\u3067PCI BAR1\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3092\u5207\u308a\u66ff\u3048\u308b\u4e8b\u304c\u3067\u304d\u308b\u3082\u306e\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u304a\u4f7f\u3044\u306eGPU\u304c\u305d\u308c\u306b\u8a72\u5f53\u3059\u308b\u5834\u5408\u306f\u3001 NVIDIA Display Mode Selector Tool \u3092\u53c2\u7167\u306e\u4e0a\u3001PCI BAR1\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3092\u6700\u5927\u5316\u3059\u308b\u30e2\u30fc\u30c9\u3078\u3068\u5207\u308a\u66ff\u3048\u3066\u304f\u3060\u3055\u3044\u3002 2023\u5e7412\u6708\u6642\u70b9\u3067\u306f\u3001\u4ee5\u4e0b\u306eGPU\u306e\u5834\u5408\u306bNVIDIA Display Mode Selector Tool\u3092\u5229\u7528\u3057\u3066 *Display Off \u30e2\u30fc\u30c9\u3078\u3068\u5207\u308a\u66ff\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 NVIDIA L40S NVIDIA L40 NVIDIA A40 NVIDIA RTX 6000 Ada NVIDIA RTX A6000 NVIDIA RTX A5500 NVIDIA RTX A5000 \u30b7\u30b9\u30c6\u30e0\u306b\u642d\u8f09\u3055\u308c\u3066\u3044\u308bGPU\u306e\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u3084PCI BAR1\u30b5\u30a4\u30ba\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f\u3001 nvidia-smi -q \u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u30e1\u30e2\u30ea\u95a2\u9023\u306e\u72b6\u614b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 $ nvidia-smi -q : FB Memory Usage Total : 46068 MiB Reserved : 685 MiB Used : 4 MiB Free : 45377 MiB BAR1 Memory Usage Total : 65536 MiB Used : 1 MiB Free : 65535 MiB :","title":"PCI Bar1\u30e1\u30e2\u30ea\u306e\u8a2d\u5b9a"},{"location":"install/#heterodb","text":"heterodb-extra \u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001PG-Strom\u306b\u4ee5\u4e0b\u306e\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002 \u30de\u30eb\u30c1GPU\u306e\u5bfe\u5fdc GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5bfe\u5fdc \u30e9\u30a4\u30bb\u30f3\u30b9\u7ba1\u7406\u6a5f\u80fd \u3053\u308c\u3089\u306e\u6a5f\u80fd\u3092\u4f7f\u7528\u305b\u305a\u3001\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u7248\u306e\u6a5f\u80fd\u306e\u307f\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f heterodb-extra \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u4e0d\u8981\u3067\u3059\u3002 \u672c\u7bc0\u306e\u5185\u5bb9\u306f\u8aad\u307f\u98db\u3070\u3057\u3066\u69cb\u3044\u307e\u305b\u3093\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001SWDC\u304b\u3089 heterodb-extra \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002 # dnf install heterodb-extra","title":"HeteroDB \u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb"},{"location":"install/#_5","text":"heterodb-extra \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5168\u3066\u306e\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u3001HeteroDB\u793e\u304c\u63d0\u4f9b\u3059\u308b\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u6709\u52b9\u5316\u304c\u5fc5\u8981\u3067\u3059\u3002\u30e9\u30a4\u30bb\u30f3\u30b9\u306a\u3057\u3067\u904b\u7528\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001\u305d\u306e\u5834\u5408\u3001\u4e0b\u8a18\u306e\u6a5f\u80fd\u304c\u5236\u9650\u3092\u53d7\u3051\u307e\u3059\u3002 \u30de\u30eb\u30c1GPU\u306e\u5229\u7528 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306b\u304a\u3051\u308b\u8907\u6570NVME-SSD\u306b\u3088\u308b\u30b9\u30c8\u30e9\u30a4\u30d4\u30f3\u30b0(md-raid0) GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306b\u304a\u3051\u308bNVME-oF\u30c7\u30d0\u30a4\u30b9\u306e\u5229\u7528 GPU\u7248PostGIS\u306b\u304a\u3051\u308bGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u5229\u7528 \u30e9\u30a4\u30bb\u30f3\u30b9\u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5f62\u5f0f\u3067HeteroDB\u793e\u304b\u3089\u5165\u624b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 IAgIVdKxhe+BSer3Y67jQW0+uTzYh00K6WOSH7xQ26Qcw8aeUNYqJB9YcKJTJb+QQhjmUeQpUnboNxVwLCd3HFuLXeBWMKp11/BgG0FSrkUWu/ZCtDtw0F1hEIUY7m767zAGV8y+i7BuNXGJFvRlAkxdVO3/K47ocIgoVkuzBfLvN/h9LffOydUnHPzrFHfLc0r3nNNgtyTrfvoZiXegkGM9GBTAKyq8uWu/OGonh9ybzVKOgofhDLk0rVbLohOXDhMlwDl2oMGIr83tIpCWG+BGE+TDwsJ4n71Sv6n4bi/ZBXBS498qShNHDGrbz6cNcDVBa+EuZc6HzZoF6UrljEcl= ---- VERSION:2 SERIAL_NR:HDB-TRIAL ISSUED_AT:2019-05-09 EXPIRED_AT:2019-06-08 GPU_UUID:GPU-a137b1df-53c9-197f-2801-f2dccaf9d42f \u3053\u308c\u3092 /etc/heterodb.license \u306b\u30b3\u30d4\u30fc\u3057\u3001PostgreSQL\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306bPostgreSQL\u306e\u8d77\u52d5\u30ed\u30b0\u306b\u30e9\u30a4\u30bb\u30f3\u30b9\u60c5\u5831\u304c\u51fa\u529b\u3055\u308c\u3001\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u6709\u52b9\u5316\u304c\u884c\u308f\u308c\u305f\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 : LOG: HeteroDB Extra module loaded [api_version=20231105,cufile=on,nvme_strom=off,githash=9ca2fe4d2fbb795ad2d741dcfcb9f2fe499a5bdf] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2022-11-19\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} LOG: PG-Strom version 5.0.1 built for PostgreSQL 15 (githash: 972441dbafed6679af86af40bc8613be2d73c4fd) :","title":"\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u6709\u52b9\u5316"},{"location":"install/#postgresql","text":"\u672c\u7bc0\u3067\u306fRPM\u306b\u3088\u308bPostgreSQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u30bd\u30fc\u30b9\u304b\u3089\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u95a2\u3057\u3066\u306f\u65e2\u306b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u6570\u591a\u304f\u5b58\u5728\u3057\u3001 ./configure \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u591a\u5c90\u306b\u308f\u305f\u308b\u4e8b\u304b\u3089\u3001\u3053\u3053\u3067\u306f\u7d39\u4ecb\u3057\u307e\u305b\u3093\u3002 Linux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u914d\u5e03\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3082PostgreSQL\u306f\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u5fc5\u305a\u3057\u3082\u6700\u65b0\u3067\u306f\u306a\u304f\u3001PG-Strom\u306e\u5bfe\u5fdc\u30d0\u30fc\u30b8\u30e7\u30f3\u3088\u308a\u3082\u53e4\u3044\u3082\u306e\u3067\u3042\u308b\u4e8b\u304c\u591a\u3005\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001Red Hat Enterprise Linux 7.x\u3067\u914d\u5e03\u3055\u308c\u3066\u3044\u308bPostgreSQL\u306fv9.2.x\u3067\u3059\u304c\u3001\u3053\u308c\u306fPostgreSQL\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3068\u3057\u3066\u65e2\u306bEOL\u3068\u306a\u3063\u3066\u3044\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3059\u3002 PostgreSQL Global Development Group\u306f\u3001\u6700\u65b0\u306ePostgreSQL\u304a\u3088\u3073\u95a2\u9023\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u914d\u5e03\u306e\u305f\u3081\u306byum\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002 EPEL\u306e\u8a2d\u5b9a\u306e\u3088\u3046\u306b\u3001yum\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u3060\u3051\u306e\u5c0f\u3055\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u305d\u306e\u5f8c\u3001PostgreSQL\u3084\u305d\u306e\u4ed6\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 yum\u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u306e\u4e00\u89a7\u306f http://yum.postgresql.org/repopackages.php \u3067\u3059\u3002 PostgreSQL\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u3068Linux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3054\u3068\u306b\u591a\u304f\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u5b9a\u7fa9\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3042\u306a\u305f\u306eLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u5411\u3051\u306ePostgreSQL 15\u4ee5\u964d\u306e\u3082\u306e\u3092\u9078\u629e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30b9\u30c6\u30c3\u30d7\u3067 PostgreSQL \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3044\u307e\u3059\u3002 yum\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u5b9a\u7fa9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb OS\u6a19\u6e96\u306ePostgreSQL\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u7121\u52b9\u5316 PostgreSQL\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u4f8b\u3048\u3070PostgreSQL v16\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001PG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u306f postgresql16-server \u304a\u3088\u3073 postgresql16-devel \u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4ee5\u4e0b\u306f\u3001RHEL9\u306b\u304a\u3044\u3066PostgreSQL v16\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u624b\u9806\u306e\u4f8b\u3067\u3059\u3002 # dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm # dnf -y module disable postgresql # dnf install -y postgresql16-devel postgresql16-server Note Red Hat Enterprise Linux\u306e\u5834\u5408\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u540d postgresql \u304c\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u6a19\u6e96\u306e\u3082\u306e\u3068\u7af6\u5408\u3057\u3066\u3057\u307e\u3044\u3001PGDG\u63d0\u4f9b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001 dnf -y module disable postgresql \u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u3066\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u6a19\u6e96\u306e postgresql \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u7121\u52b9\u5316\u3057\u307e\u3059\u3002","title":"PostgreSQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#pg-strom","text":"\u672c\u7bc0\u3067\u306fPG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u63a8\u5968\u306fRPM\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u3059\u304c\u3001\u958b\u767a\u8005\u5411\u3051\u306b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u306e\u30d3\u30eb\u30c9\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3082\u7d39\u4ecb\u3057\u307e\u3059\u3002","title":"PG-Strom\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#rpm","text":"PG-Strom\u304a\u3088\u3073\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8\u306f HeteroDB Software Distribution Center \u3088\u308a\u914d\u5e03\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u65e2\u306byum\u30b7\u30b9\u30c6\u30e0\u3078\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u6e08\u307f\u3067\u3042\u308c\u3070\u3001\u305d\u308c\u307b\u3069\u4f5c\u696d\u306f\u591a\u304f\u3042\u308a\u307e\u305b\u3093\u3002 \u57fa\u76e4\u3068\u306a\u308bPostgreSQL\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3054\u3068\u306b\u5225\u500b\u306ePG-Strom\u306eRPM\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u6e96\u5099\u3055\u308c\u3066\u304a\u308a\u3001PostgreSQL v15\u7528\u3067\u3042\u308c\u3070 pg_strom-PG15 \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u3001PostgreSQL v16\u7528\u3067\u3042\u308c\u3070 pg_strom-PG16 \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u3001PostgreSQL\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30d0\u30a4\u30ca\u30ea\u4e92\u63db\u6027\u306b\u4f34\u3046\u5236\u7d04\u3067\u3059\u3002 # dnf install -y pg_strom-PG16 \u4ee5\u4e0a\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5b8c\u4e86\u3067\u3059\u3002","title":"RPM\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#_6","text":"\u958b\u767a\u8005\u5411\u3051\u306b\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089PG-Strom\u3092\u30d3\u30eb\u30c9\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3082\u7d39\u4ecb\u3057\u307e\u3059\u3002","title":"\u30bd\u30fc\u30b9\u304b\u3089\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"install/#_7","text":"RPM\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u540c\u69d8\u306b\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306etarball\u3092 HeteroDB Software Distribution Center \u304b\u3089\u5165\u624b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u305f\u3060\u3001tarball\u306e\u30ea\u30ea\u30fc\u30b9\u306b\u306f\u3042\u308b\u7a0b\u5ea6\u306e\u30bf\u30a4\u30e0\u30e9\u30b0\u304c\u751f\u3058\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u6700\u65b0\u306e\u958b\u767a\u7248\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306b\u306f PG-Strom\u306eGitHub\u30ea\u30dd\u30b8\u30c8\u30ea \u306e master \u30d6\u30e9\u30f3\u30c1\u3092\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3059\u308b\u65b9\u6cd5\u306e\u65b9\u304c\u597d\u307e\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 $ git clone https://github.com/heterodb/pg-strom.git Cloning into 'pg-strom'... remote: Counting objects: 13797, done. remote: Compressing objects: 100% (215/215), done. remote: Total 13797 (delta 208), reused 339 (delta 167), pack-reused 13400 Receiving objects: 100% (13797/13797), 11.81 MiB | 1.76 MiB/s, done. Resolving deltas: 100% (10504/10504), done.","title":"\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u5165\u624b"},{"location":"install/#pg-strom_1","text":"PG-Strom\u3092\u30d3\u30eb\u30c9\u3059\u308b\u6642\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u306f\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u306ePostgreSQL\u3068\u53b3\u5bc6\u306b\u4e00\u81f4\u3057\u3066\u3044\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070\u3001\u540c\u3058\u69cb\u9020\u4f53\u304c\u30d3\u30eb\u30c9\u6642\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u306b\u3088\u308aPostgreSQL\u3068PG-Strom\u3067\u7570\u306a\u3063\u305f\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u6301\u3063\u3066\u3057\u307e\u3063\u305f\u3068\u3059\u308c\u3070\u3001\u975e\u5e38\u306b\u767a\u898b\u306e\u96e3\u3057\u3044\u30d0\u30b0\u3092\u751f\u307f\u51fa\u3057\u3066\u3057\u307e\u3046\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 \u3057\u305f\u304c\u3063\u3066\u3001\uff08\u4e00\u8cab\u6027\u306e\u306a\u3044\u72b6\u614b\u3092\u907f\u3051\u308b\u305f\u3081\uff09PG-Strom\u306f\u72ec\u81ea\u306bconfigure\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8d70\u3089\u305b\u305f\u308a\u306f\u305b\u305a\u3001 pg_config \u3092\u4f7f\u3063\u3066PostgreSQL\u306e\u30d3\u30eb\u30c9\u6642\u8a2d\u5b9a\u3092\u53c2\u7167\u3057\u307e\u3059\u3002 pg_config \u306b\u30d1\u30b9\u304c\u901a\u3063\u3066\u304a\u308a\u3001\u305d\u308c\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u306ePostgreSQL\u306e\u3082\u306e\u3067\u3042\u308c\u3070\u3001\u305d\u306e\u307e\u307e make \u3001 make install \u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 \u76f4\u63a5\u30d1\u30b9\u304c\u901a\u3063\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001 make \u30b3\u30de\u30f3\u30c9\u306b PG_CONFIG=... \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4e0e\u3048\u3001 pg_config \u306e\u30d5\u30eb\u30d1\u30b9\u3092\u6e21\u3057\u307e\u3059\u3002 $ cd pg-strom/src $ make PG_CONFIG=/usr/pgsql-16/bin/pg_config $ sudo make install PG_CONFIG=/usr/pgsql-16/bin/pg_config","title":"PG-Strom\u306e\u30d3\u30eb\u30c9"},{"location":"install/#_8","text":"","title":"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306e\u8a2d\u5b9a"},{"location":"install/#_9","text":"\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u306e\u4f5c\u6210\u304c\u6e08\u3093\u3067\u3044\u306a\u3044\u5834\u5408\u306f\u3001 initdb \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066PostgreSQL\u306e\u521d\u671f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 RPM\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u304a\u3051\u308b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u306e\u30d1\u30b9\u306f /var/lib/pgsql//data \u3067\u3059\u3002 postgresql-alternatives \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001PostgreSQL\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u62e0\u3089\u305a /var/lib/pgdata \u3067\u53c2\u7167\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 # su - postgres $ /usr/pgsql-16/bin/initdb -D /var/lib/pgdata/ The files belonging to this database system will be owned by user \"postgres\". This user must also own the server process. The database cluster will be initialized with locale \"en_US.UTF-8\". The default database encoding has accordingly been set to \"UTF8\". The default text search configuration will be set to \"english\". Data page checksums are disabled. fixing permissions on existing directory /var/lib/pgdata ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Tokyo creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling \"trust\" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D /var/lib/pgdata/ -l logfile start","title":"\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u306e\u4f5c\u6210"},{"location":"install/#postgresqlconf","text":"\u7d9a\u3044\u3066\u3001PostgreSQL\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308b postgresql.conf \u3092\u7de8\u96c6\u3057\u307e\u3059\u3002 PG-Strom\u3092\u52d5\u4f5c\u3055\u305b\u308b\u305f\u3081\u306b\u306f\u3001\u6700\u4f4e\u9650\u3001\u4ee5\u4e0b\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002 \u3053\u308c\u4ee5\u5916\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3064\u3044\u3066\u3082\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u7528\u9014\u3084\u60f3\u5b9a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u8e0f\u307e\u3048\u3066\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 shared_preload_libraries PG-Strom\u30e2\u30b8\u30e5\u30fc\u30eb\u306f shared_preload_libraries \u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308apostmaster\u30d7\u30ed\u30bb\u30b9\u306e\u8d77\u52d5\u6642\u306b\u30ed\u30fc\u30c9\u3055\u308c\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30aa\u30f3\u30c7\u30de\u30f3\u30c9\u3067\u306e\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30ed\u30fc\u30c9\u306f\u30b5\u30dd\u30fc\u30c8\u5bfe\u8c61\u5916\u3067\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u9805\u76ee\u306f\u5fc5\u9808\u3067\u3059\u3002 shared_preload_libraries = '$libdir/pg_strom' max_worker_processes PG-Strom\u306f\u6570\u500b\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u3092\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3067\u3042\u308b 8 \u3067\u306f\u3001\u305d\u308c\u4ee5\u5916\u306e\u51e6\u7406\u306b\u5229\u7528\u3067\u304d\u308b\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u6570\u304c\u3042\u307e\u308a\u306b\u3082\u5c11\u306a\u3059\u304e\u3066\u3057\u307e\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u305f\u5024\u3092\u8a2d\u5b9a\u3059\u3079\u304d\u3067\u3059\u3002 max_worker_processes = 100 shared_buffers \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u3088\u308a\u307e\u3059\u304c\u3001 shared_buffers \u306e\u521d\u671f\u8a2d\u5b9a\u306f\u975e\u5e38\u306b\u5c0f\u3055\u3044\u305f\u3081\u3001PG-Strom\u304c\u6709\u52b9\u306b\u6a5f\u80fd\u3059\u308b\u6c34\u6e96\u306e\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u306b\u5bfe\u3057\u3066\u306f\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3078\u306e\u8aad\u307f\u66f8\u304d\u304c\u5f8b\u901f\u8981\u56e0\u3068\u306a\u3063\u3066\u3057\u307e\u3044\u3001GPU\u306e\u4e26\u5217\u8a08\u7b97\u6a5f\u80fd\u3092\u6709\u52b9\u306b\u5229\u7528\u3067\u304d\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u305f\u5024\u3092\u8a2d\u5b9a\u3059\u3079\u304d\u3067\u3059\u3002 shared_buffers = 10GB \u660e\u3089\u304b\u306b\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u3088\u308a\u3082\u5927\u304d\u306a\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306f\u3001SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306e\u5229\u7528\u3092\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 work_mem \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u3088\u308a\u307e\u3059\u304c\u3001 work_mem \u306e\u521d\u671f\u8a2d\u5b9a\u306f\u975e\u5e38\u306b\u5c0f\u3055\u3044\u305f\u3081\u3001\u89e3\u6790\u7cfb\u30af\u30a8\u30ea\u3067\u6700\u9069\u306a\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u304c\u9078\u629e\u3055\u308c\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u5178\u578b\u7684\u306a\u4f8b\u306f\u3001\u30bd\u30fc\u30c8\u51e6\u7406\u306b\u30aa\u30f3\u30e1\u30e2\u30ea\u306e\u30af\u30a4\u30c3\u30af\u30bd\u30fc\u30c8\u3067\u306f\u306a\u304f\u3001\u30c7\u30a3\u30b9\u30af\u30d9\u30fc\u30b9\u306e\u30de\u30fc\u30b8\u30bd\u30fc\u30c8\u3092\u9078\u629e\u3059\u308b\u3068\u3044\u3063\u305f\u3082\u306e\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u4f59\u88d5\u3092\u6301\u3063\u305f\u5024\u3092\u8a2d\u5b9a\u3059\u3079\u304d\u3067\u3059\u3002 work_mem = 1GB","title":"postgresql.conf\u306e\u7de8\u96c6"},{"location":"install/#os_1","text":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u7279\u306b\u3001\u540c\u6642\u306b\u5927\u91cf\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30aa\u30fc\u30d7\u30f3\u3059\u308b\u4e8b\u304c\u3042\u308b\u305f\u3081\u3001\u30d7\u30ed\u30bb\u30b9\u3042\u305f\u308a\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30b9\u30af\u30ea\u30d7\u30bf\u6570\u306e\u4e0a\u9650\u3092\u62e1\u5927\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u307e\u305f\u3001PostgreSQL\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u6642\u306b\u78ba\u5b9f\u306b\u30b3\u30a2\u30c0\u30f3\u30d7\u3092\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u3001\u30b3\u30a2\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u4e0a\u9650\u3092\u5236\u9650\u3057\u306a\u3044\u3053\u3068\u3092\u63a8\u5968\u3057\u307e\u3059\u3002 PostgreSQL\u3092systemd\u7d4c\u7531\u3067\u8d77\u52d5\u3059\u308b\u5834\u5408\u3001\u30ea\u30bd\u30fc\u30b9\u5236\u9650\u306b\u95a2\u3059\u308b\u8a2d\u5b9a\u306f /etc/systemd/system/postgresql-XX.service.d/pg_strom.conf \u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002 RPM\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u5834\u5408\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4ee5\u4e0b\u306e\u5185\u5bb9\u304c\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002 \u74b0\u5883\u5909\u6570 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u306b\u95a2\u3059\u308b\u8a2d\u5b9a\u304c\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u958b\u767a\u8005\u5411\u3051\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3001\u3053\u308c\u3092\u6709\u52b9\u306b\u3057\u3066\u8d77\u52d5\u3059\u308b\u3068\u3001GPU\u5074\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306bGPU\u306e\u30b3\u30a2\u30c0\u30f3\u30d7\u3092\u751f\u6210\u3055\u305b\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u8a73\u3057\u304f\u306f CUDA-GDB:GPU core dump support \u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1","title":"OS\u306e\u30ea\u30bd\u30fc\u30b9\u5236\u9650\u306e\u62e1\u5f35"},{"location":"install/#postgresql_1","text":"PostgreSQL\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002 \u6b63\u5e38\u306b\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u304c\u5b8c\u4e86\u3057\u3066\u3044\u308c\u3070\u3001\u30ed\u30b0\u306bPG-Strom\u304cGPU\u3092\u8a8d\u8b58\u3057\u305f\u4e8b\u3092\u793a\u3059\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8a18\u9332\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001NVIDIA A100 (PCIE\u7248; 40GB) \u3092\u8a8d\u8b58\u3057\u3066\u304a\u308a\u3001\u307e\u305f\u3001NVME-SSD\u3054\u3068\u306b\u8fd1\u508d\u306eGPU\u304c\u3069\u3061\u3089\u3067\u3042\u308b\u306e\u304b\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002 # systemctl start postgresql-16 # journalctl -u postgresql-16 Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB Extra module loaded [api_version=20240418,cufile=off,nvme_strom=off,githash=3ffc65428c07bb3c9d0e5c75a2973389f91dfcd4] Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2024-06-02\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: PG-Strom version 5.12.el9 built for PostgreSQL 16 (githash: ) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom binary built for CUDA 12.4 (CUDA runtime 12.5) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] WARNING: The CUDA version where this PG-Strom module binary was built for (12.4) is newer than the CUDA runtime version on this platform (12.5). It may lead unexpected behavior, and upgrade of CUDA toolkit is recommended. Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78979c134606) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:81:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:82:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c2:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c6:00:0] nvme4 (Corsair MP600 CORE) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c3:00:0] nvme5 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c1:00:0] nvme0 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c4:00:0] nvme2 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] LOG: redirecting log output to logging collector process Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] HINT: Future log output will appear in directory \"log\". Jun 02 17:28:48 buri.heterodb.com systemd[1]: Started PostgreSQL 16 database server.","title":"PostgreSQL\u306e\u8d77\u52d5"},{"location":"install/#pg-strom_2","text":"\u6700\u5f8c\u306b\u3001PG-Strom\u306b\u95a2\u9023\u3059\u308bSQL\u95a2\u6570\u306a\u3069\u306eDB\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u3053\u306e\u624b\u9806\u306fPostgreSQL\u306eEXTENSION\u6a5f\u80fd\u3092\u7528\u3044\u3066\u30d1\u30c3\u30b1\u30fc\u30b8\u5316\u3055\u308c\u3066\u304a\u308a\u3001SQL\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067 CREATE EXTENSION \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u3059\u3002 \u306a\u304a\u3001\u3053\u306e\u624b\u9806\u306f\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u305f\u3073\u306b\u5fc5\u8981\u306b\u306a\u308b\u4e8b\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u305f\u6642\u70b9\u3067\u65e2\u306bPG-Strom\u95a2\u9023\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u3066\u307b\u3057\u3044\u5834\u5408\u306f\u3001\u4e88\u3081 template1 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067PG-Strom\u30a8\u30af\u30b9\u30c6\u30f3\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3066\u304a\u3051\u3070\u3001 CREATE DATABASE \u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u6642\u306b\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u8a2d\u5b9a\u304c\u30b3\u30d4\u30fc\u3055\u308c\u307e\u3059\u3002 $ psql -U postgres psql (16.3) Type \"help\" for help. postgres=# CREATE EXTENSION pg_strom ; CREATE EXTENSION \u4ee5\u4e0a\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4f5c\u696d\u306f\u5b8c\u4e86\u3067\u3059\u3002","title":"PG-Strom\u30a8\u30af\u30b9\u30c6\u30f3\u30b7\u30e7\u30f3\u306e\u4f5c\u6210"},{"location":"install/#postgis","text":"PG-Strom\u306f\u4e00\u90e8\u306ePostGIS\u95a2\u6570\u306eGPU\u51e6\u7406\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002 \u672c\u7bc0\u3067\u306fPostGIS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306b\u3064\u3044\u3066\u8aac\u660e\u3092\u884c\u3044\u307e\u3059\u304c\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u8aad\u307f\u98db\u3070\u3057\u3066\u304f\u3060\u3055\u3044\u3002 PostgreSQL\u3068\u540c\u69d8\u306b\u3001PostgreSQL Global Development Group\u306eyum\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089PostGIS\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001PostgreSQL v16\u5411\u3051\u306b\u30d3\u30eb\u30c9\u3055\u308c\u305fPostGIS v3.4\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3082\u306e\u3067\u3059\u3002 # dnf install postgis34_16 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u3092\u4f5c\u6210\u3057\u3066PostgreSQL\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3057\u3001SQL\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089 CREATE EXTENSION \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066Geometry\u30c7\u30fc\u30bf\u578b\u3084\u5730\u7406\u60c5\u5831\u5206\u6790\u306e\u305f\u3081\u306eSQL\u95a2\u6570\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u3053\u308c\u3067PostGIS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5b8c\u4e86\u3067\u3059\u3002 postgres=# CREATE EXTENSION postgis; CREATE EXTENSION","title":"PostGIS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"operations/","text":"\u57fa\u672c\u7684\u306a\u64cd\u4f5c GPU\u30aa\u30d5\u30ed\u30fc\u30c9\u306e\u78ba\u8a8d \u30af\u30a8\u30ea\u304cGPU\u3067\u5b9f\u884c\u3055\u308c\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f EXPLAIN \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 SQL\u51e6\u7406\u306f\u5185\u90e8\u7684\u306b\u3044\u304f\u3064\u304b\u306e\u8981\u7d20\u306b\u5206\u89e3\u3055\u308c\u51e6\u7406\u3055\u308c\u307e\u3059\u304c\u3001PG-Strom\u304cGPU\u3092\u9069\u7528\u3057\u3066\u4e26\u5217\u51e6\u7406\u3092\u884c\u3046\u306e\u306fSCAN\u3001JOIN\u3001GROUP BY\u306e\u5404\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u3002\u6a19\u6e96\u3067PostgreSQL\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b\u5404\u51e6\u7406\u306e\u4ee3\u308f\u308a\u306b\u3001GpuScan\u3001GpuJoin\u3001GpuPreAgg\u304c\u8868\u793a\u3055\u308c\u305f\u5834\u5408\u3001\u305d\u306e\u30af\u30a8\u30ea\u306fGPU\u306b\u3088\u3063\u3066\u51e6\u7406\u3055\u308c\u308b\u4e8b\u3068\u306a\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306f EXPLAIN \u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u4f8b\u3067\u3059\u3002 postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 NATURAL JOIN t2 GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=989186.82..989190.94 rows=27 width=20) Group Key: t0.cat -> Sort (cost=989186.82..989187.29 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=989175.89..989179.67 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=14744.40..875804.46 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1833360.36 rows=99996736 width=12) Depth 1: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) Depth 2: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.bid JoinQuals: (t0.bid = t2.bid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) -> Seq Scan on t2 (cost=0.00..1935.00 rows=100000 width=4) (21 rows) \u5b9f\u884c\u8a08\u753b\u306e\u4e2d\u306b\u898b\u6163\u308c\u306a\u3044\u51e6\u7406\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u4e8b\u306b\u6c17\u304c\u4ed8\u304b\u308c\u305f\u3067\u3057\u3087\u3046\u3002 CustomScan\u6a5f\u69cb\u3092\u7528\u3044\u3066GpuJoin\u304a\u3088\u3073GpuPreAgg\u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u3067GpuJoin\u306f t0 \u3068 t1 \u3001\u304a\u3088\u3073 t2 \u3068\u306eJOIN\u51e6\u7406\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u53d7\u3051\u53d6\u308bGpuPreAgg\u306f\u5217 cat \u306b\u3088\u308bGROUP BY\u51e6\u7406\u3092GPU\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002 PostgreSQL\u304c\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u3092\u69cb\u7bc9\u3059\u308b\u904e\u7a0b\u3067PG-Strom\u306f\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u4ecb\u5165\u3057\u3001SCAN\u3001JOIN\u3001GROUP BY\u306e\u5404\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPU\u3067\u5b9f\u884c\u53ef\u80fd\u3067\u3042\u308b\u5834\u5408\u3001\u305d\u306e\u30b3\u30b9\u30c8\u3092\u7b97\u51fa\u3057\u3066PostgreSQL\u306e\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u5b9f\u884c\u8a08\u753b\u306e\u5019\u88dc\u3092\u63d0\u793a\u3057\u307e\u3059\u3002 \u63a8\u5b9a\u3055\u308c\u305f\u30b3\u30b9\u30c8\u5024\u304cCPU\u3067\u5b9f\u884c\u3059\u308b\u4ed6\u306e\u5b9f\u884c\u8a08\u753b\u3088\u308a\u3082\u5c0f\u3055\u306a\u5024\u3067\u3042\u308b\u5834\u5408\u3001GPU\u3092\u7528\u3044\u305f\u4ee3\u66ff\u306e\u5b9f\u884c\u8a08\u753b\u304c\u63a1\u7528\u3055\u308c\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPU\u3067\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u5c11\u306a\u304f\u3068\u3082\u6f14\u7b97\u5f0f\u307e\u305f\u306f\u95a2\u6570\u3001\u304a\u3088\u3073\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u578b\u304cPG-Strom\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 int \u3084 float \u3068\u3044\u3063\u305f\u6570\u5024\u578b\u3001 date \u3084 timestamp \u3068\u3044\u3063\u305f\u65e5\u4ed8\u6642\u523b\u578b\u3001 text \u306e\u3088\u3046\u306a\u6587\u5b57\u5217\u578b\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\u307e\u305f\u3001\u56db\u5247\u6f14\u7b97\u3084\u5927\u5c0f\u6bd4\u8f03\u3068\u3044\u3063\u305f\u6570\u591a\u304f\u306e\u30d3\u30eb\u30c8\u30a4\u30f3\u6f14\u7b97\u5b50\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u8a73\u7d30\u306a\u4e00\u89a7\u306b\u95a2\u3057\u3066\u306f \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 CPU+GPU\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u4e26\u5217 PG-Strom\u306fPostgreSQL\u306eCPU\u4e26\u5217\u5b9f\u884c\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 PostgreSQL\u306eCPU\u4e26\u5217\u5b9f\u884c\u306f\u3001Gather\u30ce\u30fc\u30c9\u304c\u3044\u304f\u3064\u304b\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30d7\u30ed\u30bb\u30b9\u3092\u8d77\u52d5\u3057\u3001\u5404\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u304c\"\u90e8\u5206\u7684\u306b\"\u5b9f\u884c\u3057\u305f\u30af\u30a8\u30ea\u306e\u7d50\u679c\u3092\u5f8c\u3067\u7d50\u5408\u3059\u308b\u5f62\u3067\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002 GpuJoin\u3084GpuPreAgg\u3068\u3044\u3063\u305fPG-Strom\u306e\u51e6\u7406\u306f\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u5074\u3067\u306e\u5b9f\u884c\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u500b\u3005\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u4e92\u3044\u306bGPU\u3092\u4f7f\u7528\u3057\u3066\u51e6\u7406\u3092\u9032\u3081\u307e\u3059\u3002\u901a\u5e38\u3001GPU\u3078\u30c7\u30fc\u30bf\u3092\u4f9b\u7d66\u3059\u308b\u305f\u3081\u306b\u500b\u3005\u306eCPU\u30b3\u30a2\u304c\u30d0\u30c3\u30d5\u30a1\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u305f\u3081\u306e\u51e6\u7406\u901f\u5ea6\u306f\u3001GPU\u3067\u306eSQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u51e6\u7406\u901f\u5ea6\u306b\u6bd4\u3079\u3066\u305a\u3063\u3068\u9045\u3044\u305f\u3081\u3001CPU\u4e26\u5217\u3068GPU\u4e26\u5217\u3092\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u3067\u5229\u7528\u3059\u308b\u4e8b\u3067\u51e6\u7406\u901f\u5ea6\u306e\u5411\u4e0a\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 \u305f\u3060\u3057\u3001GPU\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306aCUDA\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306f\u5404\u30d7\u30ed\u30bb\u30b9\u3054\u3068\u306b\u4f5c\u6210\u3055\u308c\u3001CUDA\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3092\u751f\u6210\u3059\u308b\u305f\u3073\u306b\u3042\u308b\u7a0b\u5ea6\u306eGPU\u30ea\u30bd\u30fc\u30b9\u304c\u6d88\u8cbb\u3055\u308c\u308b\u305f\u3081\u3001\u5e38\u306bCPU\u4e26\u5217\u5ea6\u304c\u9ad8\u3051\u308c\u3070\u826f\u3044\u3068\u3044\u3046\u8a33\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002 Gather\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u304c\u5b9f\u884c\u53ef\u80fd\u306a\u3082\u306e\u3067\u3059\u30021\u5104\u884c\u3092\u4fdd\u6301\u3059\u308b t0 \u30c6\u30fc\u30d6\u30eb\u30924\u30d7\u30ed\u30bb\u30b9\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u3068\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u30d7\u30ed\u30bb\u30b9\u3067\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u305f\u3081\u3001\u30d7\u30ed\u30bb\u30b9\u3042\u305f\u308a2000\u4e07\u884c\u3092GpuJoin\u304a\u3088\u3073GpuPreAgg\u3067\u51e6\u7406\u3057\u3001\u305d\u306e\u7d50\u679c\u3092Gather\u30ce\u30fc\u30c9\u3067\u7d50\u5408\u3057\u307e\u3059\u3002 # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 GROUP by cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=955705.47..955720.93 rows=27 width=20) Group Key: t0.cat -> Sort (cost=955705.47..955707.36 rows=756 width=44) Sort Key: t0.cat -> Gather (cost=955589.95..955669.33 rows=756 width=44) Workers Planned: 4 -> Parallel Custom Scan (GpuPreAgg) (cost=954589.95..954593.73 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on t0 (cost=27682.82..841218.52 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1083384.84 rows=24999184 width=8) Depth 1: GpuHashJoin (nrows 24999184...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows) \u4e0b\u4f4d\u30d7\u30e9\u30f3\u306e\u5f15\u304d\u4e0a\u3052 \u203b\u672c\u7bc0\u306e\u5185\u5bb9\u306f\u6709\u52b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u6700\u65b0\u306e\u5b9f\u88c5\u3092\u8e0f\u307e\u3048\u305f\u66f8\u304d\u76f4\u3057\u304c\u5fc5\u8981\u3067\u3059\u3002 PG-Strom\u306fSCAN\u3001JOIN\u3001GROUP BY\u306e\u5404\u51e6\u7406\u3092GPU\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u304c\u3001\u3053\u308c\u306b\u5bfe\u5fdc\u3059\u308bPostgreSQL\u6a19\u6e96\u306e\u51e6\u7406\u3092\u5358\u7d14\u306b\u7f6e\u304d\u63db\u3048\u305f\u3060\u3051\u3067\u306f\u56f0\u3063\u305f\u4e8b\u614b\u304c\u767a\u751f\u3057\u307e\u3059\u3002 SCAN\u304c\u7d42\u308f\u3063\u305f\u5f8c\u306e\u30c7\u30fc\u30bf\u3092\u3044\u3063\u305f\u3093\u30db\u30b9\u30c8\u5074\u306e\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u623b\u3057\u3001\u6b21\u306b\u305d\u308c\u3092JOIN\u3059\u308b\u305f\u3081\u306b\u518d\u3073GPU\u3078\u3068\u30b3\u30d4\u30fc\u3057\u3001\u3055\u3089\u306bGROUP BY\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u518d\u3073\u30db\u30b9\u30c8\u5074\u306e\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u623b\u3057\u30fb\u30fb\u30fb\u3068\u3044\u3063\u305f\u5f62\u3067\u3001CPU\u3068GPU\u306e\u9593\u3067\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u304c\u767a\u751f\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u3059\u3002 \u3053\u308c\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u3001PG-Strom\u306f\u4e0b\u4f4d\u30d7\u30e9\u30f3\u3092\u5f15\u304d\u4e0a\u3052\u3066\u4e00\u5ea6\u306eGPU Kernel\u306e\u5b9f\u884c\u3067\u51e6\u7406\u3057\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u30e2\u30fc\u30c9\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u4e0b\u4f4d\u30d7\u30e9\u30f3\u306e\u5f15\u304d\u4e0a\u3052\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 SCAN + JOIN SCAN + GROUP BY SCAN + JOIN + GROUP BY \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u3001\u4e0b\u4f4d\u30d7\u30e9\u30f3\u306e\u5f15\u304d\u4e0a\u3052\u3092\u5168\u304f\u884c\u308f\u306a\u3044\u30b1\u30fc\u30b9\u3067\u3059\u3002 GpuScan\u306e\u5b9f\u884c\u7d50\u679c\u3092GpuJoin\u304c\u53d7\u53d6\u308a\u3001\u3055\u3089\u306b\u305d\u306e\u5b9f\u884c\u7d50\u679c\u3092GpuPreAgg\u304c\u53d7\u3051\u53d6\u3063\u3066\u6700\u7d42\u7d50\u679c\u3092\u751f\u6210\u3059\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=1239991.03..1239995.15 rows=27 width=20) Group Key: t0.cat -> Sort (cost=1239991.03..1239991.50 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=1239980.10..1239983.88 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) -> Custom Scan (GpuJoin) (cost=50776.43..1199522.96 rows=33332245 width=12) GPU Projection: t0.cat, t1.ax Depth 1: GpuHashJoin (nrows 33332245...33332245) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Custom Scan (GpuScan) on t0 (cost=12634.49..1187710.85 rows=33332245 width=8) GPU Projection: cat, aid GPU Filter: (aid < bid) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows) \u3053\u306e\u5834\u5408\u3001\u5404\u5b9f\u884c\u30b9\u30c6\u30fc\u30b8\u306b\u304a\u3044\u3066GPU\u3068\u30db\u30b9\u30c8\u30d0\u30c3\u30d5\u30a1\u306e\u9593\u3067\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u304c\u767a\u751f\u3059\u308b\u305f\u3081\u3001\u5b9f\u884c\u52b9\u7387\u306f\u3088\u304f\u3042\u308a\u307e\u305b\u3093\u3002 \u4e00\u65b9\u3001\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u3001\u4e0b\u4f4d\u30ce\u30fc\u30c9\u306e\u5f15\u304d\u4e0a\u3052\u3092\u884c\u3063\u305f\u3082\u306e\u3067\u3059\u3002 # EXPLAIN ANALYZE SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=903669.50..903673.62 rows=27 width=20) (actual time=7761.630..7761.644 rows=27 loops=1) Group Key: t0.cat -> Sort (cost=903669.50..903669.97 rows=189 width=44) (actual time=7761.621..7761.626 rows=27 loops=1) Sort Key: t0.cat Sort Method: quicksort Memory: 28kB -> Custom Scan (GpuPreAgg) (cost=903658.57..903662.35 rows=189 width=44) (actual time=7761.531..7761.540 rows=27 loops=1) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=12483.41..863201.43 rows=33332245 width=12) (never executed) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=12634.49..1187710.85 rows=33332245 width=8) (actual time=59.623..5557.052 rows=100000000 loops=1) Outer Scan Filter: (aid < bid) Rows Removed by Outer Scan Filter: 50002874 Depth 1: GpuHashJoin (plan nrows: 33332245...33332245, actual nrows: 49997126...49997126) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size plan: 10.39MB, exec: 64.00MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (actual time=0.013..15.303 rows=100000 loops=1) Planning time: 0.506 ms Execution time: 8495.391 ms (21 rows) \u307e\u305a\u3001\u30c6\u30fc\u30d6\u30eb t0 \u3078\u306e\u30b9\u30ad\u30e3\u30f3\u304cGpuJoin\u306e\u5b9f\u884c\u8a08\u753b\u306b\u57cb\u3081\u8fbc\u307e\u308c\u3001GpuScan\u304c\u6d88\u3048\u3066\u3044\u308b\u4e8b\u306b\u304a\u6c17\u4ed8\u304d\u3067\u3057\u3087\u3046\u3002 \u3053\u308c\u306fGpuJoin\u304c\u914d\u4e0b\u306eGpuScan\u3092\u5f15\u304d\u4e0a\u3052\u3001\u4e00\u4f53\u5316\u3057\u305fGPU\u30ab\u30fc\u30cd\u30eb\u95a2\u6570\u3067WHERE\u53e5\u306e\u51e6\u7406\u3082\u884c\u3063\u305f\u4e8b\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002 \u52a0\u3048\u3066\u5947\u5999\u306a\u3053\u3068\u306b\u3001 EXPLAIN ANALYZE \u306e\u7d50\u679c\u306b\u306fGpuJoin\u304c(never executed)\u3068\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u306fGpuPreAgg\u304c\u914d\u4e0b\u306eGpuJoin\u3092\u5f15\u304d\u4e0a\u3052\u3001\u4e00\u4f53\u5316\u3057\u305fGPU\u30ab\u30fc\u30cd\u30eb\u95a2\u6570\u3067JOIN\u3068GROUP BY\u3092\u5b9f\u884c\u3057\u305f\u4e8b\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002 SCAN\u51e6\u7406\u306e\u5f15\u304d\u4e0a\u3052\u306f pg_strom.pullup_outer_scan \u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u3063\u3066\u5236\u5fa1\u3067\u304d\u307e\u3059\u3002 \u307e\u305f\u3001JOIN\u51e6\u7406\u306e\u5f15\u304d\u4e0a\u3052\u306f pg_strom.pullup_outer_join \u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u3063\u3066\u5236\u5fa1\u3067\u304d\u307e\u3059\u3002 \u3044\u305a\u308c\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f on \u306b\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001\u901a\u5e38\u306f\u3053\u308c\u3092\u7121\u52b9\u5316\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u30c8\u30e9\u30d6\u30eb\u6642\u306e\u554f\u984c\u5207\u308a\u5206\u3051\u624b\u6bb5\u306e\u4e00\u3064\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 GpuJoin\u306b\u304a\u3051\u308bInner Pinned Buffer \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002 PG-Strom\u304c\u30c6\u30fc\u30d6\u30eb\u3092\u7d50\u5408\u3059\u308b\u969b\u3001\u901a\u5e38\u306f\u6700\u3082\u30b5\u30a4\u30ba\u306e\u5927\u304d\u306a\u30c6\u30fc\u30d6\u30eb\uff08\u3053\u306e\u5834\u5408\u306f lineorder \u3067\u3001OUTER\u8868\u3068\u547c\u3073\u307e\u3059\uff09\u3092\u975e\u540c\u671f\u7684\u306b\u8aad\u307f\u8fbc\u307f\u306a\u304c\u3089\u3001\u4ed6\u306e\u30c6\u30fc\u30d6\u30eb\u3068\u306e\u7d50\u5408\u51e6\u7406\u304a\u3088\u3073\u96c6\u8a08\u51e6\u7406\u3092\u9032\u3081\u307e\u3059\u3002 JOIN\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5236\u7d04\u4e0a\u3001\u4e88\u3081\u305d\u308c\u4ee5\u5916\u306e\u30c6\u30fc\u30d6\u30eb\uff08\u3053\u306e\u5834\u5408\u306f date1 \u3001 part \u3001 supplier \u3067\u3001INNER\u8868\u3068\u547c\u3073\u307e\u3059\uff09\u3092\u30e1\u30e2\u30ea\u4e0a\u306b\u8aad\u307f\u51fa\u3057\u3001\u307e\u305fJOIN\u30ad\u30fc\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u8a08\u7b97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30c6\u30fc\u30d6\u30eb\u306fOUTER\u8868\u307b\u3069\u5927\u304d\u306a\u30b5\u30a4\u30ba\u3067\u306f\u306a\u3044\u3082\u306e\u306e\u3001\u6570GB\u3092\u8d8a\u3048\u308b\u3088\u3046\u306aINNER\u30d0\u30c3\u30d5\u30a1\u306e\u6e96\u5099\u306f\u76f8\u5fdc\u306b\u91cd\u3044\u51e6\u7406\u3068\u306a\u308a\u307e\u3059\u3002 GpuJoin\u306f\u901a\u5e38\u3001PostgreSQL\u306eAPI\u3092\u901a\u3057\u3066INNER\u8868\u3092\u4e00\u884c\u3054\u3068\u306b\u8aad\u307f\u51fa\u3057\u3001\u305d\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u8a08\u7b97\u3059\u308b\u3068\u3068\u3082\u306b\u5171\u6709\u30e1\u30e2\u30ea\u4e0a\u306eINNER\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002GPU-Service\u30d7\u30ed\u30bb\u30b9\u306f\u3001\u3053\u306eINNER\u30d0\u30c3\u30d5\u30a1\u3092GPU\u30e1\u30e2\u30ea\u306b\u8ee2\u9001\u3057\u3001\u305d\u3053\u3067\u306f\u3058\u3081\u3066OUTER\u8868\u3092\u8aad\u307f\u51fa\u3057\u3066JOIN\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 INNER\u8868\u304c\u76f8\u5fdc\u306b\u5927\u304d\u304fGPU\u3067\u5b9f\u884c\u53ef\u80fd\u306a\u691c\u7d22\u6761\u4ef6\u3092\u542b\u3080\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306e\u3088\u3046\u306b\u3001GpuJoin\u306e\u914d\u4e0b\u306bGpuScan\u304c\u5b58\u5728\u3059\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308a\u5f97\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001INNER\u8868\u306f\u3044\u3063\u305f\u3093GpuScan\u306b\u3088\u3063\u3066GPU\u3067\u51e6\u7406\u3055\u308c\u305f\u5f8c\u3001\u305d\u306e\u5b9f\u884c\u7d50\u679c\u3092CPU\u5074\u306b\u623b\u3057\u3001\u3055\u3089\u306bINNER\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305f\u5f8c\u3067\u3082\u3046\u4e00\u5ea6GPU\u3078\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002\u305a\u3044\u3076\u3093\u3068\u7121\u99c4\u306a\u30c7\u30fc\u30bf\u306e\u6d41\u308c\u304c\u5b58\u5728\u3059\u308b\u3088\u3046\u306b\u898b\u3048\u307e\u3059\u3002 =# explain select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_brand1 between 'MFGR#2221' and 'MFGR#2228' and s_region = 'ASIA' group by d_year, p_brand1; QUERY PLAN --------------------------------------------------------------------------------------------------------------- GroupAggregate (cost=31007186.70..31023043.21 rows=6482 width=46) Group Key: date1.d_year, part.p_brand1 -> Sort (cost=31007186.70..31011130.57 rows=1577548 width=20) Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuJoin) on lineorder (cost=275086.19..30844784.03 rows=1577548 width=20) GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue GPU Join Quals [1]: (part.p_partkey = lineorder.lo_partkey) ... [nrows: 5994236000 -> 7804495] GPU Outer Hash [1]: lineorder.lo_partkey GPU Inner Hash [1]: part.p_partkey GPU Join Quals [2]: (supplier.s_suppkey = lineorder.lo_suppkey) ... [nrows: 7804495 -> 1577548] GPU Outer Hash [2]: lineorder.lo_suppkey GPU Inner Hash [2]: supplier.s_suppkey GPU Join Quals [3]: (date1.d_datekey = lineorder.lo_orderdate) ... [nrows: 1577548 -> 1577548] GPU Outer Hash [3]: lineorder.lo_orderdate GPU Inner Hash [3]: date1.d_datekey GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on part (cost=0.00..59258.00 rows=2604 width=14) Filter: ((p_brand1 >= 'MFGR#2221'::bpchar) AND (p_brand1 <= 'MFGR#2228'::bpchar)) -> Custom Scan (GpuScan) on supplier (cost=100.00..190348.83 rows=2019384 width=6) GPU Projection: s_suppkey GPU Pinned Buffer: enabled GPU Scan Quals: (s_region = 'ASIA'::bpchar) [rows: 9990357 -> 2019384] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=8) (24 rows) \u3053\u306e\u3088\u3046\u306b\u3001INNER\u8868\u306e\u8aad\u51fa\u3057\u3084INNER\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u306e\u969b\u306bCPU\u3068GPU\u306e\u9593\u3067\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u3001 Pinned Inner Buffer \u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u8a2d\u5b9a\u3059\u308b\u4e8b\u3067\u3001GpuJoin\u306e\u5b9f\u884c\u958b\u59cb\u30ea\u30fc\u30c9\u30bf\u30a4\u30e0\u306e\u77ed\u7e2e\u3084\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u524a\u6e1b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4e0a\u306e\u5b9f\u884c\u8a08\u753b\u3067\u306f\u3001 supplier \u8868\u306e\u8aad\u51fa\u3057\u304cGpuScan\u306b\u3088\u308a\u884c\u308f\u308c\u308b\u4e8b\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u7d71\u8a08\u60c5\u5831\u306b\u3088\u308c\u3070\u7d04200\u4e07\u884c\u304c\u8aad\u307f\u51fa\u3055\u308c\u308b\u3068\u63a8\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u4e00\u65b9\u3067\u3001 GPU Pinned Buffer: enabled \u306e\u51fa\u529b\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u3001INNER\u8868\u306e\u63a8\u5b9a\u30b5\u30a4\u30ba\u304c pg_strom.pinned_inner_buffer_threshold \u306e\u8a2d\u5b9a\u5024\u3092\u8d8a\u3048\u308b\u5834\u5408\u3001GpuScan\u306e\u51e6\u7406\u7d50\u679c\u3092\u305d\u306e\u307e\u307eGPU\u30e1\u30e2\u30ea\u306b\u6b8b\u3057\u3066\u304a\u304d\u3001\u305d\u308c\u3092\u6b21\u306eGpuJoin\u3067INNER\u30d0\u30c3\u30d5\u30a1\u306e\u4e00\u90e8\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u3068\u3044\u3046\u6a5f\u80fd\u3067\u3059\uff08\u5fc5\u8981\u3067\u3042\u308c\u3070\u30cf\u30c3\u30b7\u30e5\u5024\u306e\u8a08\u7b97\u3082GPU\u3067\u884c\u3044\u307e\u3059\uff09\u3002 \u305d\u306e\u305f\u3081\u3001 supplier \u8868\u306e\u5185\u5bb9\u306fGPU-Direct SQL\u306b\u3088\u3063\u3066\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089GPU\u3078\u3068\u8aad\u307f\u51fa\u3055\u308c\u305f\u5f8c\u3001CPU\u5074\u306b\u623b\u3055\u308c\u305f\u308a\u3001\u518d\u5ea6GPU\u3078\u30ed\u30fc\u30c9\u3055\u308c\u305f\u308a\u3059\u308b\u3053\u3068\u306a\u304f\u3001\u6b21\u306eGpuJoin\u3067\u5229\u7528\u3055\u308c\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u4e00\u65b9\u3067Pinned Inner Buffer\u306e\u4f7f\u7528\u306b\u306f\u82e5\u5e72\u306e\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5\u3082\u3042\u308b\u305f\u3081\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u7121\u52b9\u5316\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u672c\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u660e\u793a\u7684\u306b pg_strom.pinned_inner_buffer_threshold \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 Pinned Inner Buffer\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u3001CPU\u5074\u306fINNER\u30d0\u30c3\u30d5\u30a1\u306e\u5185\u5bb9\u3092\u5b8c\u5168\u306b\u306f\u4fdd\u6301\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001TOAST\u5316\u3055\u308c\u305f\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u3092GPU\u3067\u53c2\u7167\u3057\u305f\u5834\u5408\u306a\u3069\u3001CPU Fallback\u51e6\u7406\u3092\u884c\u3046\u4e8b\u304c\u3067\u304d\u305a\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305b\u307e\u3059\u3002\u307e\u305f\u3001CPU Fallback\u3092\u5229\u7528\u3057\u3066\u5b9f\u88c5\u3055\u308c\u3066\u3044\u308bRIGHT/FULL OUTER JOIN\u3082\u540c\u69d8\u306e\u7406\u7531\u3067Pinned Inner Buffer\u3068\u5171\u5b58\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002 \u30ca\u30ec\u30c3\u30b8\u30d9\u30fc\u30b9 PG-Strom\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306ewiki\u30b5\u30a4\u30c8\u306b\u306f\u3001\u30ce\u30fc\u30c8\u3068\u547c\u3070\u308c\u308b\u8a73\u7d30\u306a\u6280\u8853\u60c5\u5831\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002 https://github.com/heterodb/pg-strom/wiki","title":"\u57fa\u672c\u7684\u306a\u64cd\u4f5c"},{"location":"operations/#_1","text":"","title":"\u57fa\u672c\u7684\u306a\u64cd\u4f5c"},{"location":"operations/#gpu","text":"\u30af\u30a8\u30ea\u304cGPU\u3067\u5b9f\u884c\u3055\u308c\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f EXPLAIN \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 SQL\u51e6\u7406\u306f\u5185\u90e8\u7684\u306b\u3044\u304f\u3064\u304b\u306e\u8981\u7d20\u306b\u5206\u89e3\u3055\u308c\u51e6\u7406\u3055\u308c\u307e\u3059\u304c\u3001PG-Strom\u304cGPU\u3092\u9069\u7528\u3057\u3066\u4e26\u5217\u51e6\u7406\u3092\u884c\u3046\u306e\u306fSCAN\u3001JOIN\u3001GROUP BY\u306e\u5404\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u3002\u6a19\u6e96\u3067PostgreSQL\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b\u5404\u51e6\u7406\u306e\u4ee3\u308f\u308a\u306b\u3001GpuScan\u3001GpuJoin\u3001GpuPreAgg\u304c\u8868\u793a\u3055\u308c\u305f\u5834\u5408\u3001\u305d\u306e\u30af\u30a8\u30ea\u306fGPU\u306b\u3088\u3063\u3066\u51e6\u7406\u3055\u308c\u308b\u4e8b\u3068\u306a\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306f EXPLAIN \u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u4f8b\u3067\u3059\u3002 postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 NATURAL JOIN t2 GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=989186.82..989190.94 rows=27 width=20) Group Key: t0.cat -> Sort (cost=989186.82..989187.29 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=989175.89..989179.67 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=14744.40..875804.46 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1833360.36 rows=99996736 width=12) Depth 1: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) Depth 2: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.bid JoinQuals: (t0.bid = t2.bid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) -> Seq Scan on t2 (cost=0.00..1935.00 rows=100000 width=4) (21 rows) \u5b9f\u884c\u8a08\u753b\u306e\u4e2d\u306b\u898b\u6163\u308c\u306a\u3044\u51e6\u7406\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u4e8b\u306b\u6c17\u304c\u4ed8\u304b\u308c\u305f\u3067\u3057\u3087\u3046\u3002 CustomScan\u6a5f\u69cb\u3092\u7528\u3044\u3066GpuJoin\u304a\u3088\u3073GpuPreAgg\u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u3067GpuJoin\u306f t0 \u3068 t1 \u3001\u304a\u3088\u3073 t2 \u3068\u306eJOIN\u51e6\u7406\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u53d7\u3051\u53d6\u308bGpuPreAgg\u306f\u5217 cat \u306b\u3088\u308bGROUP BY\u51e6\u7406\u3092GPU\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002 PostgreSQL\u304c\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u3092\u69cb\u7bc9\u3059\u308b\u904e\u7a0b\u3067PG-Strom\u306f\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u4ecb\u5165\u3057\u3001SCAN\u3001JOIN\u3001GROUP BY\u306e\u5404\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPU\u3067\u5b9f\u884c\u53ef\u80fd\u3067\u3042\u308b\u5834\u5408\u3001\u305d\u306e\u30b3\u30b9\u30c8\u3092\u7b97\u51fa\u3057\u3066PostgreSQL\u306e\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u5b9f\u884c\u8a08\u753b\u306e\u5019\u88dc\u3092\u63d0\u793a\u3057\u307e\u3059\u3002 \u63a8\u5b9a\u3055\u308c\u305f\u30b3\u30b9\u30c8\u5024\u304cCPU\u3067\u5b9f\u884c\u3059\u308b\u4ed6\u306e\u5b9f\u884c\u8a08\u753b\u3088\u308a\u3082\u5c0f\u3055\u306a\u5024\u3067\u3042\u308b\u5834\u5408\u3001GPU\u3092\u7528\u3044\u305f\u4ee3\u66ff\u306e\u5b9f\u884c\u8a08\u753b\u304c\u63a1\u7528\u3055\u308c\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPU\u3067\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u5c11\u306a\u304f\u3068\u3082\u6f14\u7b97\u5f0f\u307e\u305f\u306f\u95a2\u6570\u3001\u304a\u3088\u3073\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u578b\u304cPG-Strom\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 int \u3084 float \u3068\u3044\u3063\u305f\u6570\u5024\u578b\u3001 date \u3084 timestamp \u3068\u3044\u3063\u305f\u65e5\u4ed8\u6642\u523b\u578b\u3001 text \u306e\u3088\u3046\u306a\u6587\u5b57\u5217\u578b\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\u307e\u305f\u3001\u56db\u5247\u6f14\u7b97\u3084\u5927\u5c0f\u6bd4\u8f03\u3068\u3044\u3063\u305f\u6570\u591a\u304f\u306e\u30d3\u30eb\u30c8\u30a4\u30f3\u6f14\u7b97\u5b50\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u8a73\u7d30\u306a\u4e00\u89a7\u306b\u95a2\u3057\u3066\u306f \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"GPU\u30aa\u30d5\u30ed\u30fc\u30c9\u306e\u78ba\u8a8d"},{"location":"operations/#cpugpu","text":"PG-Strom\u306fPostgreSQL\u306eCPU\u4e26\u5217\u5b9f\u884c\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 PostgreSQL\u306eCPU\u4e26\u5217\u5b9f\u884c\u306f\u3001Gather\u30ce\u30fc\u30c9\u304c\u3044\u304f\u3064\u304b\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30d7\u30ed\u30bb\u30b9\u3092\u8d77\u52d5\u3057\u3001\u5404\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u304c\"\u90e8\u5206\u7684\u306b\"\u5b9f\u884c\u3057\u305f\u30af\u30a8\u30ea\u306e\u7d50\u679c\u3092\u5f8c\u3067\u7d50\u5408\u3059\u308b\u5f62\u3067\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002 GpuJoin\u3084GpuPreAgg\u3068\u3044\u3063\u305fPG-Strom\u306e\u51e6\u7406\u306f\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u5074\u3067\u306e\u5b9f\u884c\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u500b\u3005\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u4e92\u3044\u306bGPU\u3092\u4f7f\u7528\u3057\u3066\u51e6\u7406\u3092\u9032\u3081\u307e\u3059\u3002\u901a\u5e38\u3001GPU\u3078\u30c7\u30fc\u30bf\u3092\u4f9b\u7d66\u3059\u308b\u305f\u3081\u306b\u500b\u3005\u306eCPU\u30b3\u30a2\u304c\u30d0\u30c3\u30d5\u30a1\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u305f\u3081\u306e\u51e6\u7406\u901f\u5ea6\u306f\u3001GPU\u3067\u306eSQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u51e6\u7406\u901f\u5ea6\u306b\u6bd4\u3079\u3066\u305a\u3063\u3068\u9045\u3044\u305f\u3081\u3001CPU\u4e26\u5217\u3068GPU\u4e26\u5217\u3092\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u3067\u5229\u7528\u3059\u308b\u4e8b\u3067\u51e6\u7406\u901f\u5ea6\u306e\u5411\u4e0a\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 \u305f\u3060\u3057\u3001GPU\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306aCUDA\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306f\u5404\u30d7\u30ed\u30bb\u30b9\u3054\u3068\u306b\u4f5c\u6210\u3055\u308c\u3001CUDA\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3092\u751f\u6210\u3059\u308b\u305f\u3073\u306b\u3042\u308b\u7a0b\u5ea6\u306eGPU\u30ea\u30bd\u30fc\u30b9\u304c\u6d88\u8cbb\u3055\u308c\u308b\u305f\u3081\u3001\u5e38\u306bCPU\u4e26\u5217\u5ea6\u304c\u9ad8\u3051\u308c\u3070\u826f\u3044\u3068\u3044\u3046\u8a33\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002 Gather\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u304c\u5b9f\u884c\u53ef\u80fd\u306a\u3082\u306e\u3067\u3059\u30021\u5104\u884c\u3092\u4fdd\u6301\u3059\u308b t0 \u30c6\u30fc\u30d6\u30eb\u30924\u30d7\u30ed\u30bb\u30b9\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u3068\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u30d7\u30ed\u30bb\u30b9\u3067\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u305f\u3081\u3001\u30d7\u30ed\u30bb\u30b9\u3042\u305f\u308a2000\u4e07\u884c\u3092GpuJoin\u304a\u3088\u3073GpuPreAgg\u3067\u51e6\u7406\u3057\u3001\u305d\u306e\u7d50\u679c\u3092Gather\u30ce\u30fc\u30c9\u3067\u7d50\u5408\u3057\u307e\u3059\u3002 # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 GROUP by cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=955705.47..955720.93 rows=27 width=20) Group Key: t0.cat -> Sort (cost=955705.47..955707.36 rows=756 width=44) Sort Key: t0.cat -> Gather (cost=955589.95..955669.33 rows=756 width=44) Workers Planned: 4 -> Parallel Custom Scan (GpuPreAgg) (cost=954589.95..954593.73 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on t0 (cost=27682.82..841218.52 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1083384.84 rows=24999184 width=8) Depth 1: GpuHashJoin (nrows 24999184...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows)","title":"CPU+GPU\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u4e26\u5217"},{"location":"operations/#_2","text":"\u203b\u672c\u7bc0\u306e\u5185\u5bb9\u306f\u6709\u52b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u6700\u65b0\u306e\u5b9f\u88c5\u3092\u8e0f\u307e\u3048\u305f\u66f8\u304d\u76f4\u3057\u304c\u5fc5\u8981\u3067\u3059\u3002 PG-Strom\u306fSCAN\u3001JOIN\u3001GROUP BY\u306e\u5404\u51e6\u7406\u3092GPU\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u304c\u3001\u3053\u308c\u306b\u5bfe\u5fdc\u3059\u308bPostgreSQL\u6a19\u6e96\u306e\u51e6\u7406\u3092\u5358\u7d14\u306b\u7f6e\u304d\u63db\u3048\u305f\u3060\u3051\u3067\u306f\u56f0\u3063\u305f\u4e8b\u614b\u304c\u767a\u751f\u3057\u307e\u3059\u3002 SCAN\u304c\u7d42\u308f\u3063\u305f\u5f8c\u306e\u30c7\u30fc\u30bf\u3092\u3044\u3063\u305f\u3093\u30db\u30b9\u30c8\u5074\u306e\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u623b\u3057\u3001\u6b21\u306b\u305d\u308c\u3092JOIN\u3059\u308b\u305f\u3081\u306b\u518d\u3073GPU\u3078\u3068\u30b3\u30d4\u30fc\u3057\u3001\u3055\u3089\u306bGROUP BY\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u518d\u3073\u30db\u30b9\u30c8\u5074\u306e\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u623b\u3057\u30fb\u30fb\u30fb\u3068\u3044\u3063\u305f\u5f62\u3067\u3001CPU\u3068GPU\u306e\u9593\u3067\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u304c\u767a\u751f\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u3059\u3002 \u3053\u308c\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u3001PG-Strom\u306f\u4e0b\u4f4d\u30d7\u30e9\u30f3\u3092\u5f15\u304d\u4e0a\u3052\u3066\u4e00\u5ea6\u306eGPU Kernel\u306e\u5b9f\u884c\u3067\u51e6\u7406\u3057\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u30e2\u30fc\u30c9\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u4e0b\u4f4d\u30d7\u30e9\u30f3\u306e\u5f15\u304d\u4e0a\u3052\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 SCAN + JOIN SCAN + GROUP BY SCAN + JOIN + GROUP BY \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u3001\u4e0b\u4f4d\u30d7\u30e9\u30f3\u306e\u5f15\u304d\u4e0a\u3052\u3092\u5168\u304f\u884c\u308f\u306a\u3044\u30b1\u30fc\u30b9\u3067\u3059\u3002 GpuScan\u306e\u5b9f\u884c\u7d50\u679c\u3092GpuJoin\u304c\u53d7\u53d6\u308a\u3001\u3055\u3089\u306b\u305d\u306e\u5b9f\u884c\u7d50\u679c\u3092GpuPreAgg\u304c\u53d7\u3051\u53d6\u3063\u3066\u6700\u7d42\u7d50\u679c\u3092\u751f\u6210\u3059\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=1239991.03..1239995.15 rows=27 width=20) Group Key: t0.cat -> Sort (cost=1239991.03..1239991.50 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=1239980.10..1239983.88 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) -> Custom Scan (GpuJoin) (cost=50776.43..1199522.96 rows=33332245 width=12) GPU Projection: t0.cat, t1.ax Depth 1: GpuHashJoin (nrows 33332245...33332245) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Custom Scan (GpuScan) on t0 (cost=12634.49..1187710.85 rows=33332245 width=8) GPU Projection: cat, aid GPU Filter: (aid < bid) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows) \u3053\u306e\u5834\u5408\u3001\u5404\u5b9f\u884c\u30b9\u30c6\u30fc\u30b8\u306b\u304a\u3044\u3066GPU\u3068\u30db\u30b9\u30c8\u30d0\u30c3\u30d5\u30a1\u306e\u9593\u3067\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u304c\u767a\u751f\u3059\u308b\u305f\u3081\u3001\u5b9f\u884c\u52b9\u7387\u306f\u3088\u304f\u3042\u308a\u307e\u305b\u3093\u3002 \u4e00\u65b9\u3001\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u3001\u4e0b\u4f4d\u30ce\u30fc\u30c9\u306e\u5f15\u304d\u4e0a\u3052\u3092\u884c\u3063\u305f\u3082\u306e\u3067\u3059\u3002 # EXPLAIN ANALYZE SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=903669.50..903673.62 rows=27 width=20) (actual time=7761.630..7761.644 rows=27 loops=1) Group Key: t0.cat -> Sort (cost=903669.50..903669.97 rows=189 width=44) (actual time=7761.621..7761.626 rows=27 loops=1) Sort Key: t0.cat Sort Method: quicksort Memory: 28kB -> Custom Scan (GpuPreAgg) (cost=903658.57..903662.35 rows=189 width=44) (actual time=7761.531..7761.540 rows=27 loops=1) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=12483.41..863201.43 rows=33332245 width=12) (never executed) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=12634.49..1187710.85 rows=33332245 width=8) (actual time=59.623..5557.052 rows=100000000 loops=1) Outer Scan Filter: (aid < bid) Rows Removed by Outer Scan Filter: 50002874 Depth 1: GpuHashJoin (plan nrows: 33332245...33332245, actual nrows: 49997126...49997126) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size plan: 10.39MB, exec: 64.00MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (actual time=0.013..15.303 rows=100000 loops=1) Planning time: 0.506 ms Execution time: 8495.391 ms (21 rows) \u307e\u305a\u3001\u30c6\u30fc\u30d6\u30eb t0 \u3078\u306e\u30b9\u30ad\u30e3\u30f3\u304cGpuJoin\u306e\u5b9f\u884c\u8a08\u753b\u306b\u57cb\u3081\u8fbc\u307e\u308c\u3001GpuScan\u304c\u6d88\u3048\u3066\u3044\u308b\u4e8b\u306b\u304a\u6c17\u4ed8\u304d\u3067\u3057\u3087\u3046\u3002 \u3053\u308c\u306fGpuJoin\u304c\u914d\u4e0b\u306eGpuScan\u3092\u5f15\u304d\u4e0a\u3052\u3001\u4e00\u4f53\u5316\u3057\u305fGPU\u30ab\u30fc\u30cd\u30eb\u95a2\u6570\u3067WHERE\u53e5\u306e\u51e6\u7406\u3082\u884c\u3063\u305f\u4e8b\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002 \u52a0\u3048\u3066\u5947\u5999\u306a\u3053\u3068\u306b\u3001 EXPLAIN ANALYZE \u306e\u7d50\u679c\u306b\u306fGpuJoin\u304c(never executed)\u3068\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u306fGpuPreAgg\u304c\u914d\u4e0b\u306eGpuJoin\u3092\u5f15\u304d\u4e0a\u3052\u3001\u4e00\u4f53\u5316\u3057\u305fGPU\u30ab\u30fc\u30cd\u30eb\u95a2\u6570\u3067JOIN\u3068GROUP BY\u3092\u5b9f\u884c\u3057\u305f\u4e8b\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002 SCAN\u51e6\u7406\u306e\u5f15\u304d\u4e0a\u3052\u306f pg_strom.pullup_outer_scan \u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u3063\u3066\u5236\u5fa1\u3067\u304d\u307e\u3059\u3002 \u307e\u305f\u3001JOIN\u51e6\u7406\u306e\u5f15\u304d\u4e0a\u3052\u306f pg_strom.pullup_outer_join \u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u3063\u3066\u5236\u5fa1\u3067\u304d\u307e\u3059\u3002 \u3044\u305a\u308c\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f on \u306b\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001\u901a\u5e38\u306f\u3053\u308c\u3092\u7121\u52b9\u5316\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u30c8\u30e9\u30d6\u30eb\u6642\u306e\u554f\u984c\u5207\u308a\u5206\u3051\u624b\u6bb5\u306e\u4e00\u3064\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002","title":"\u4e0b\u4f4d\u30d7\u30e9\u30f3\u306e\u5f15\u304d\u4e0a\u3052"},{"location":"operations/#gpujoininner-pinned-buffer","text":"\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002 PG-Strom\u304c\u30c6\u30fc\u30d6\u30eb\u3092\u7d50\u5408\u3059\u308b\u969b\u3001\u901a\u5e38\u306f\u6700\u3082\u30b5\u30a4\u30ba\u306e\u5927\u304d\u306a\u30c6\u30fc\u30d6\u30eb\uff08\u3053\u306e\u5834\u5408\u306f lineorder \u3067\u3001OUTER\u8868\u3068\u547c\u3073\u307e\u3059\uff09\u3092\u975e\u540c\u671f\u7684\u306b\u8aad\u307f\u8fbc\u307f\u306a\u304c\u3089\u3001\u4ed6\u306e\u30c6\u30fc\u30d6\u30eb\u3068\u306e\u7d50\u5408\u51e6\u7406\u304a\u3088\u3073\u96c6\u8a08\u51e6\u7406\u3092\u9032\u3081\u307e\u3059\u3002 JOIN\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u5236\u7d04\u4e0a\u3001\u4e88\u3081\u305d\u308c\u4ee5\u5916\u306e\u30c6\u30fc\u30d6\u30eb\uff08\u3053\u306e\u5834\u5408\u306f date1 \u3001 part \u3001 supplier \u3067\u3001INNER\u8868\u3068\u547c\u3073\u307e\u3059\uff09\u3092\u30e1\u30e2\u30ea\u4e0a\u306b\u8aad\u307f\u51fa\u3057\u3001\u307e\u305fJOIN\u30ad\u30fc\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u8a08\u7b97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30c6\u30fc\u30d6\u30eb\u306fOUTER\u8868\u307b\u3069\u5927\u304d\u306a\u30b5\u30a4\u30ba\u3067\u306f\u306a\u3044\u3082\u306e\u306e\u3001\u6570GB\u3092\u8d8a\u3048\u308b\u3088\u3046\u306aINNER\u30d0\u30c3\u30d5\u30a1\u306e\u6e96\u5099\u306f\u76f8\u5fdc\u306b\u91cd\u3044\u51e6\u7406\u3068\u306a\u308a\u307e\u3059\u3002 GpuJoin\u306f\u901a\u5e38\u3001PostgreSQL\u306eAPI\u3092\u901a\u3057\u3066INNER\u8868\u3092\u4e00\u884c\u3054\u3068\u306b\u8aad\u307f\u51fa\u3057\u3001\u305d\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u8a08\u7b97\u3059\u308b\u3068\u3068\u3082\u306b\u5171\u6709\u30e1\u30e2\u30ea\u4e0a\u306eINNER\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002GPU-Service\u30d7\u30ed\u30bb\u30b9\u306f\u3001\u3053\u306eINNER\u30d0\u30c3\u30d5\u30a1\u3092GPU\u30e1\u30e2\u30ea\u306b\u8ee2\u9001\u3057\u3001\u305d\u3053\u3067\u306f\u3058\u3081\u3066OUTER\u8868\u3092\u8aad\u307f\u51fa\u3057\u3066JOIN\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 INNER\u8868\u304c\u76f8\u5fdc\u306b\u5927\u304d\u304fGPU\u3067\u5b9f\u884c\u53ef\u80fd\u306a\u691c\u7d22\u6761\u4ef6\u3092\u542b\u3080\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306e\u3088\u3046\u306b\u3001GpuJoin\u306e\u914d\u4e0b\u306bGpuScan\u304c\u5b58\u5728\u3059\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308a\u5f97\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001INNER\u8868\u306f\u3044\u3063\u305f\u3093GpuScan\u306b\u3088\u3063\u3066GPU\u3067\u51e6\u7406\u3055\u308c\u305f\u5f8c\u3001\u305d\u306e\u5b9f\u884c\u7d50\u679c\u3092CPU\u5074\u306b\u623b\u3057\u3001\u3055\u3089\u306bINNER\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305f\u5f8c\u3067\u3082\u3046\u4e00\u5ea6GPU\u3078\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002\u305a\u3044\u3076\u3093\u3068\u7121\u99c4\u306a\u30c7\u30fc\u30bf\u306e\u6d41\u308c\u304c\u5b58\u5728\u3059\u308b\u3088\u3046\u306b\u898b\u3048\u307e\u3059\u3002 =# explain select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_brand1 between 'MFGR#2221' and 'MFGR#2228' and s_region = 'ASIA' group by d_year, p_brand1; QUERY PLAN --------------------------------------------------------------------------------------------------------------- GroupAggregate (cost=31007186.70..31023043.21 rows=6482 width=46) Group Key: date1.d_year, part.p_brand1 -> Sort (cost=31007186.70..31011130.57 rows=1577548 width=20) Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuJoin) on lineorder (cost=275086.19..30844784.03 rows=1577548 width=20) GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue GPU Join Quals [1]: (part.p_partkey = lineorder.lo_partkey) ... [nrows: 5994236000 -> 7804495] GPU Outer Hash [1]: lineorder.lo_partkey GPU Inner Hash [1]: part.p_partkey GPU Join Quals [2]: (supplier.s_suppkey = lineorder.lo_suppkey) ... [nrows: 7804495 -> 1577548] GPU Outer Hash [2]: lineorder.lo_suppkey GPU Inner Hash [2]: supplier.s_suppkey GPU Join Quals [3]: (date1.d_datekey = lineorder.lo_orderdate) ... [nrows: 1577548 -> 1577548] GPU Outer Hash [3]: lineorder.lo_orderdate GPU Inner Hash [3]: date1.d_datekey GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on part (cost=0.00..59258.00 rows=2604 width=14) Filter: ((p_brand1 >= 'MFGR#2221'::bpchar) AND (p_brand1 <= 'MFGR#2228'::bpchar)) -> Custom Scan (GpuScan) on supplier (cost=100.00..190348.83 rows=2019384 width=6) GPU Projection: s_suppkey GPU Pinned Buffer: enabled GPU Scan Quals: (s_region = 'ASIA'::bpchar) [rows: 9990357 -> 2019384] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=8) (24 rows) \u3053\u306e\u3088\u3046\u306b\u3001INNER\u8868\u306e\u8aad\u51fa\u3057\u3084INNER\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u306e\u969b\u306bCPU\u3068GPU\u306e\u9593\u3067\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u3001 Pinned Inner Buffer \u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u8a2d\u5b9a\u3059\u308b\u4e8b\u3067\u3001GpuJoin\u306e\u5b9f\u884c\u958b\u59cb\u30ea\u30fc\u30c9\u30bf\u30a4\u30e0\u306e\u77ed\u7e2e\u3084\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u524a\u6e1b\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4e0a\u306e\u5b9f\u884c\u8a08\u753b\u3067\u306f\u3001 supplier \u8868\u306e\u8aad\u51fa\u3057\u304cGpuScan\u306b\u3088\u308a\u884c\u308f\u308c\u308b\u4e8b\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u7d71\u8a08\u60c5\u5831\u306b\u3088\u308c\u3070\u7d04200\u4e07\u884c\u304c\u8aad\u307f\u51fa\u3055\u308c\u308b\u3068\u63a8\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u4e00\u65b9\u3067\u3001 GPU Pinned Buffer: enabled \u306e\u51fa\u529b\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u3001INNER\u8868\u306e\u63a8\u5b9a\u30b5\u30a4\u30ba\u304c pg_strom.pinned_inner_buffer_threshold \u306e\u8a2d\u5b9a\u5024\u3092\u8d8a\u3048\u308b\u5834\u5408\u3001GpuScan\u306e\u51e6\u7406\u7d50\u679c\u3092\u305d\u306e\u307e\u307eGPU\u30e1\u30e2\u30ea\u306b\u6b8b\u3057\u3066\u304a\u304d\u3001\u305d\u308c\u3092\u6b21\u306eGpuJoin\u3067INNER\u30d0\u30c3\u30d5\u30a1\u306e\u4e00\u90e8\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u3068\u3044\u3046\u6a5f\u80fd\u3067\u3059\uff08\u5fc5\u8981\u3067\u3042\u308c\u3070\u30cf\u30c3\u30b7\u30e5\u5024\u306e\u8a08\u7b97\u3082GPU\u3067\u884c\u3044\u307e\u3059\uff09\u3002 \u305d\u306e\u305f\u3081\u3001 supplier \u8868\u306e\u5185\u5bb9\u306fGPU-Direct SQL\u306b\u3088\u3063\u3066\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089GPU\u3078\u3068\u8aad\u307f\u51fa\u3055\u308c\u305f\u5f8c\u3001CPU\u5074\u306b\u623b\u3055\u308c\u305f\u308a\u3001\u518d\u5ea6GPU\u3078\u30ed\u30fc\u30c9\u3055\u308c\u305f\u308a\u3059\u308b\u3053\u3068\u306a\u304f\u3001\u6b21\u306eGpuJoin\u3067\u5229\u7528\u3055\u308c\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u4e00\u65b9\u3067Pinned Inner Buffer\u306e\u4f7f\u7528\u306b\u306f\u82e5\u5e72\u306e\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5\u3082\u3042\u308b\u305f\u3081\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u7121\u52b9\u5316\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u672c\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u660e\u793a\u7684\u306b pg_strom.pinned_inner_buffer_threshold \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 Pinned Inner Buffer\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u3001CPU\u5074\u306fINNER\u30d0\u30c3\u30d5\u30a1\u306e\u5185\u5bb9\u3092\u5b8c\u5168\u306b\u306f\u4fdd\u6301\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001TOAST\u5316\u3055\u308c\u305f\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u3092GPU\u3067\u53c2\u7167\u3057\u305f\u5834\u5408\u306a\u3069\u3001CPU Fallback\u51e6\u7406\u3092\u884c\u3046\u4e8b\u304c\u3067\u304d\u305a\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305b\u307e\u3059\u3002\u307e\u305f\u3001CPU Fallback\u3092\u5229\u7528\u3057\u3066\u5b9f\u88c5\u3055\u308c\u3066\u3044\u308bRIGHT/FULL OUTER JOIN\u3082\u540c\u69d8\u306e\u7406\u7531\u3067Pinned Inner Buffer\u3068\u5171\u5b58\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002","title":"GpuJoin\u306b\u304a\u3051\u308bInner Pinned Buffer"},{"location":"operations/#_3","text":"PG-Strom\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306ewiki\u30b5\u30a4\u30c8\u306b\u306f\u3001\u30ce\u30fc\u30c8\u3068\u547c\u3070\u308c\u308b\u8a73\u7d30\u306a\u6280\u8853\u60c5\u5831\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002 https://github.com/heterodb/pg-strom/wiki","title":"\u30ca\u30ec\u30c3\u30b8\u30d9\u30fc\u30b9"},{"location":"partition/","text":"\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3 \u672c\u7ae0\u3067\u306fPostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u6a5f\u80fd\u3068PG-Strom\u3092\u4f75\u7528\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u306a\u304a\u3001\u672c\u7ae0\u306e\u5185\u5bb9\u306f PostgreSQL v11\u4ee5\u964d \u3067PG-Strom\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u3067\u3059\u3002 PostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u6a5f\u80fd\u306b\u3064\u3044\u3066\u3001\u8a73\u3057\u304f\u306f PostgreSQL\u6587\u66f8\uff1a\u30c6\u30fc\u30d6\u30eb\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u6982\u8981 PostgreSQL v10\u306b\u304a\u3044\u3066\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u6a5f\u80fd\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u3057\u305f\u3002 \u3053\u308c\u306f\u3001\u8ad6\u7406\u7684\u306b\u306f\u4e00\u500b\u306e\u5927\u304d\u306a\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b\u3082\u306e\u3092\u7269\u7406\u7684\u306b\u3088\u308a\u5c0f\u3055\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u5206\u5272\u3057\u3066\u683c\u7d0d\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3001\u691c\u7d22\u6761\u4ef6\u3088\u308a\u660e\u3089\u304b\u306b\u30b9\u30ad\u30e3\u30f3\u306e\u5fc5\u8981\u304c\u306a\u3044\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u305f\u308a\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u7269\u7406\u7684\u306b\u5206\u6563\u3055\u305b\u308b\u4e8b\u3067\u3088\u308a\u5e83\u3044I/O\u5e2f\u57df\u3092\u78ba\u4fdd\u3059\u308b\u306a\u3069\u306e\u5229\u70b9\u304c\u3042\u308a\u307e\u3059\u3002 PostgreSQL v10\u3067\u306f\u7bc4\u56f2\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3001\u30ea\u30b9\u30c8\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u306e2\u7a2e\u985e\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3001\u3055\u3089\u306bPostgreSQL v11\u3067\u306f\u30cf\u30c3\u30b7\u30e5\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u306b\u52a0\u3048\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u540c\u58eb\u306eJOIN\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u56f3\u306f\u3001\u65e5\u4ed8\u578b\uff08DATE\u578b\uff09\u306e\u30ad\u30fc\u5024\u3092\u7528\u3044\u305f\u7bc4\u56f2\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002 \u30ad\u30fc\u5024 2018-05-30 \u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u306f\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb tbl_2018 \u306b\u632f\u308a\u5206\u3051\u3089\u308c\u3001\u540c\u69d8\u306b\u3001\u30ad\u30fc\u5024 2014-03-21 \u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u306f\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb tbl_2014 \u306b\u632f\u308a\u5206\u3051\u3089\u308c\u308b\u30fb\u30fb\u30fb\u3068\u3044\u3063\u305f\u5177\u5408\u3067\u3059\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u6642\u3001\u4f8b\u3048\u3070 WHERE ymd > '2016-07-01'::date \u3068\u3044\u3046\u6761\u4ef6\u53e5\u304c\u4ed8\u52a0\u3055\u308c\u3066\u3044\u308b\u3068\u3001 tbl_2014 \u304a\u3088\u3073 tbl_2015 \u306b\u8a72\u5f53\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u304c\u5b58\u5728\u3057\u306a\u3044\u4e8b\u306f\u81ea\u660e\u3067\u3059\u306e\u3067\u3001PostgreSQL\u306e\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306f tbl_2016 \u3001 tbl_2017 \u3001 tbl_2018 \u3060\u3051\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u7d50\u5408\u3059\u308b Append \u30ce\u30fc\u30c9\u3092\u631f\u3080\u4e8b\u3067\u3001\u3042\u305f\u304b\u3082\u5358\u4e00\u306e\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30ec\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u51fa\u3057\u305f\u304b\u306e\u3088\u3046\u306b\u632f\u821e\u3046\u5b9f\u884c\u8a08\u753b\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 PostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3068PG-Strom\u3092\u4f75\u7528\u3059\u308b\u5834\u5408\u3001\u307e\u305a\u3001\u30b9\u30ad\u30e3\u30f3\u304c\u5fc5\u8981\u3067\u3042\u308b\u3068\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u304c\u5224\u65ad\u3057\u305f\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u5bfe\u3057\u3001\u500b\u3005\u306b\u5b9f\u884c\u30b3\u30b9\u30c8\u3092\u63a8\u5b9a\u3057\u305f\u4e0a\u3067 GpuScan \u304c\u9078\u629e\u3055\u308c\u308b\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001 GpuScan \u306e\u5b9f\u884c\u7d50\u679c\u3092 Append \u30ce\u30fc\u30c9\u3067\u675f\u306d\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u305f\u3060\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u7d9a\u304d\u3001JOIN\u3084GROUP BY\u306a\u3069PG-Strom\u3067\u9ad8\u901f\u5316\u304c\u53ef\u80fd\u306a\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u6700\u9069\u5316\u306e\u89b3\u70b9\u304b\u3089\u691c\u8a0e\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4f8b\u3048\u3070\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u3066\u3044\u306a\u3044\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3066\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u3068JOIN\u3057\u3001GROUP BY\u306b\u3088\u308b\u96c6\u8a08\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\u5834\u5408\u3001\u6761\u4ef6\u304c\u63c3\u3048\u3070\u3001\u5404\u30b9\u30c6\u30c3\u30d7\u9593\u306e\u30c7\u30fc\u30bf\u4ea4\u63db\u306fGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u3067\u884c\u3046\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306fGPU\u3068CPU\u306e\u9593\u306e\u30c7\u30fc\u30bf\u79fb\u52d5\u3092\u6700\u5c0f\u5316\u3059\u308b\u3068\u3044\u3046\u89b3\u70b9\u304b\u3089\u3001\u6700\u3082PG-Strom\u304c\u5f97\u610f\u3068\u3059\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u3002 \u4e00\u65b9\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u540c\u69d8\u306e\u51e6\u7406\u3092\u884c\u3046\u5834\u5408\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u3068JOIN\u3084GROUP BY\u306e\u9593\u306b Append \u51e6\u7406\u304c\u631f\u307e\u3063\u3066\u3057\u307e\u3046\u306e\u304c\u8ab2\u984c\u3067\u3059\u3002\u3053\u306e\u5b9f\u884c\u8a08\u753b\u306e\u4e0b\u3067\u306f\u3001GpuScan\u304c\u51e6\u7406\u3057\u305f\u30c7\u30fc\u30bf\u3092\u4e00\u5ea6\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u3078\u8ee2\u9001\u3057\u3001 Append \u51e6\u7406\u3092\u884c\u3063\u305f\u4e0a\u3067\u3001\u305d\u306e\u5f8c\u306eGpuJoin\u3084GpuPreAgg\u51e6\u7406\u3092\u884c\u3046\u305f\u3081\u306b\u518d\u3073\u30c7\u30fc\u30bf\u3092GPU\u3078\u8ee2\u9001\u3059\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u6c7a\u3057\u3066\u52b9\u7387\u306e\u826f\u3044\u51e6\u7406\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u3053\u306e\u3088\u3046\u306aCPU-GPU\u9593\u306e\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u3092\u907f\u3051\u308b\u305f\u3081\u3001PG-Strom\u306f\u53ef\u80fd\u306a\u9650\u308aJOIN\u3084GROUP BY\u3092 Append \u3088\u308a\u3082\u5148\u306b\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3092\u8a66\u307f\u307e\u3059\u3002 \u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u304c\u6210\u529f\u308c\u3070\u3001\u30c7\u30fc\u30bf\u4ea4\u63db\u3092\u52b9\u7387\u5316\u3067\u304d\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u7279\u306bGROUP BY\u51e6\u7406\u306b\u3088\u3063\u3066\u884c\u6570\u3092\u5927\u5e45\u306b\u524a\u6e1b\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308b\u305f\u3081\u3001 Append \u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u306e\u8ca0\u8377\u3092\u9855\u8457\u306b\u6e1b\u3089\u3059\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u65e5\u4ed8\u578b\uff08date\u578b\uff09\u306e\u30d5\u30a3\u30fc\u30eb\u30c9 ymd \u3092\u30ad\u30fc\u3068\u3057\u3066\u5e74\u5358\u4f4d\u3067\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308b pt \u306b\u5bfe\u3057\u3066\u3001JOIN\u3068GROUP BY\u3092\u542b\u3080\u30af\u30a8\u30ea\u3092\u6295\u5165\u3057\u305f\u6642\u306e\u5b9f\u884c\u8a08\u753b\u3067\u3059\u3002 \u691c\u7d22\u6761\u4ef6\u306b\u3088\u308a2016\u5e74\u4ee5\u524d\u306e\u30c7\u30fc\u30bf\u3092\u542b\u3080\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306f\u81ea\u660e\u306b\u6392\u9664\u3055\u308c\u3001\u3055\u3089\u306b pt_2017 \u3001 pt_2018 \u3001 pt_2019 \u5404\u30c6\u30fc\u30d6\u30eb\u306eJOIN\u3068GROUP BY\u51e6\u7406\u304c\u4e00\u4f53\u3068\u306a\u3063\u3066 Append \u306e\u524d\u306b\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 # EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- HashAggregate (cost=196410.07..196412.57 rows=200 width=48) Group Key: pt_2017.cat -> Gather (cost=66085.69..196389.07 rows=1200 width=72) Workers Planned: 2 -> Parallel Append (cost=65085.69..195269.07 rows=600 width=72) -> Parallel Custom Scan (GpuPreAgg) (cost=65085.69..65089.69 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2017 (cost=32296.64..74474.20 rows=1050772 width=40) Outer Scan: pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050772...2521854) HashKeys: pt_2017.aid JoinQuals: (pt_2017.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65078.35..65082.35 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2018 (cost=32296.65..74465.75 rows=1050649 width=40) Outer Scan: pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050649...2521557) HashKeys: pt_2018.aid JoinQuals: (pt_2018.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65093.03..65097.03 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2019 (cost=32296.65..74482.64 rows=1050896 width=40) Outer Scan: pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050896...2522151) HashKeys: pt_2019.aid JoinQuals: (pt_2019.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (38 rows) \u8a2d\u5b9a\u3068\u904b\u7528 \u4ee5\u4e0b\u306eGUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308a\u3001PG-Strom\u306fJOIN\u3084GROUP BY\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3078\u306e\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 \u30d1\u30e9\u30e1\u30fc\u30bf\u540d \u578b \u521d\u671f\u5024 \u8aac\u660e pg_strom.enable_partitionwise_gpujoin bool on GpuJoin\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002PostgreSQL v10\u4ee5\u964d\u3067\u306e\u307f\u5bfe\u5fdc\u3002 pg_strom.enable_partitionwise_gpupreagg bool on GpuPreAgg\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002PostgreSQL v10\u4ee5\u964d\u3067\u306e\u307f\u5bfe\u5fdc\u3002 \u3053\u308c\u3089\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u521d\u671f\u5024\u306f on \u3067\u3059\u304c\u3001\u3053\u308c\u3092 off \u306b\u3057\u305f\u5834\u5408\u3001\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u51e6\u7406\u306f\u884c\u308f\u308c\u307e\u305b\u3093\u3002 EXPLAIN\u30b3\u30de\u30f3\u30c9\u3067\u524d\u7bc0\u306e\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u8a08\u753b\u3092\u8868\u793a\u3057\u305f\u3068\u3053\u308d\u3001\u5b9f\u884c\u8a08\u753b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u5316\u3057\u3066\u3044\u307e\u3059\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u306f GpuScan \u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u51e6\u7406\u7d50\u679c\u306f\u4e00\u5ea6\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u306b\u8fd4\u3055\u308c\u3001 Append \u306b\u3088\u3063\u3066\u7d50\u5408\u3055\u308c\u305f\u5f8c\u3001\u518d\u3073 GpuJoin \u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306bGPU\u3078\u3068\u8ee2\u9001\u3055\u308c\u307e\u3059\u3002 postgres=# set pg_strom.enable_partitionwise_gpujoin = off; SET postgres=# set pg_strom.enable_partitionwise_gpupreagg = off; SET postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date group by cat; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate (cost=341392.92..341399.42 rows=200 width=48) Group Key: pt.cat -> Sort (cost=341392.92..341393.92 rows=400 width=72) Sort Key: pt.cat -> Gather (cost=341333.63..341375.63 rows=400 width=72) Workers Planned: 2 -> Partial HashAggregate (cost=340333.63..340335.63 rows=200 width=72) Group Key: pt.cat -> Parallel Custom Scan (GpuJoin) (cost=283591.92..283591.92 rows=7565562 width=40) Depth 1: GpuHashJoin (nrows 3152318...7565562) HashKeys: pt.aid JoinQuals: (pt.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Append (cost=28540.80..200673.34 rows=3152318 width=36) -> Parallel Custom Scan (GpuScan) on pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (21 rows) SSD\u3068GPU\u306e\u914d\u7f6e\u306b\u95a2\u3059\u308b\u8003\u616e PostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3068SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3092\u4f75\u7528\u3059\u308b\u5834\u5408\u3001\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u304c\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092\u4fdd\u5b58\u3059\u308bNVMe-SSD\u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u7269\u7406\u7684\u306a\u914d\u7f6e\u306b\u306f\u7279\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002 \u5236\u9650\u4e8b\u9805 \u5b9f\u9a13\u7684\u6a5f\u80fd GpuJoin\u3068GpuPreAgg\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3078\u306e\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u306f\u3001\u73fe\u6642\u70b9\u3067\u306f\u5b9f\u9a13\u7684\u306a\u6a5f\u80fd\u3067\u3042\u308a\u3001\u4e88\u671f\u305b\u306c\u4e0d\u5177\u5408\u3084\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u5834\u5408\u306f pg_strom.enable_partitionwise_gpujoin \u3084 pg_strom.enable_partitionwise_gpupreagg \u3092\u7528\u3044\u3066\u5f53\u8a72\u6a5f\u80fd\u3092\u7121\u52b9\u5316\u3059\u308b\u3068\u5171\u306b\u3001 PG-Strom Issues \u3078\u969c\u5bb3\u30ec\u30dd\u30fc\u30c8\u3092\u304a\u9858\u3044\u3057\u307e\u3059\u3002","title":"\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3"},{"location":"partition/#_1","text":"\u672c\u7ae0\u3067\u306fPostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u6a5f\u80fd\u3068PG-Strom\u3092\u4f75\u7528\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u306a\u304a\u3001\u672c\u7ae0\u306e\u5185\u5bb9\u306f PostgreSQL v11\u4ee5\u964d \u3067PG-Strom\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u3067\u3059\u3002 PostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u6a5f\u80fd\u306b\u3064\u3044\u3066\u3001\u8a73\u3057\u304f\u306f PostgreSQL\u6587\u66f8\uff1a\u30c6\u30fc\u30d6\u30eb\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3"},{"location":"partition/#_2","text":"PostgreSQL v10\u306b\u304a\u3044\u3066\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u6a5f\u80fd\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u3057\u305f\u3002 \u3053\u308c\u306f\u3001\u8ad6\u7406\u7684\u306b\u306f\u4e00\u500b\u306e\u5927\u304d\u306a\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b\u3082\u306e\u3092\u7269\u7406\u7684\u306b\u3088\u308a\u5c0f\u3055\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u5206\u5272\u3057\u3066\u683c\u7d0d\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3001\u691c\u7d22\u6761\u4ef6\u3088\u308a\u660e\u3089\u304b\u306b\u30b9\u30ad\u30e3\u30f3\u306e\u5fc5\u8981\u304c\u306a\u3044\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u305f\u308a\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u7269\u7406\u7684\u306b\u5206\u6563\u3055\u305b\u308b\u4e8b\u3067\u3088\u308a\u5e83\u3044I/O\u5e2f\u57df\u3092\u78ba\u4fdd\u3059\u308b\u306a\u3069\u306e\u5229\u70b9\u304c\u3042\u308a\u307e\u3059\u3002 PostgreSQL v10\u3067\u306f\u7bc4\u56f2\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3001\u30ea\u30b9\u30c8\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u306e2\u7a2e\u985e\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3001\u3055\u3089\u306bPostgreSQL v11\u3067\u306f\u30cf\u30c3\u30b7\u30e5\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u306b\u52a0\u3048\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u540c\u58eb\u306eJOIN\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u56f3\u306f\u3001\u65e5\u4ed8\u578b\uff08DATE\u578b\uff09\u306e\u30ad\u30fc\u5024\u3092\u7528\u3044\u305f\u7bc4\u56f2\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002 \u30ad\u30fc\u5024 2018-05-30 \u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u306f\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb tbl_2018 \u306b\u632f\u308a\u5206\u3051\u3089\u308c\u3001\u540c\u69d8\u306b\u3001\u30ad\u30fc\u5024 2014-03-21 \u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u306f\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb tbl_2014 \u306b\u632f\u308a\u5206\u3051\u3089\u308c\u308b\u30fb\u30fb\u30fb\u3068\u3044\u3063\u305f\u5177\u5408\u3067\u3059\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u6642\u3001\u4f8b\u3048\u3070 WHERE ymd > '2016-07-01'::date \u3068\u3044\u3046\u6761\u4ef6\u53e5\u304c\u4ed8\u52a0\u3055\u308c\u3066\u3044\u308b\u3068\u3001 tbl_2014 \u304a\u3088\u3073 tbl_2015 \u306b\u8a72\u5f53\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u304c\u5b58\u5728\u3057\u306a\u3044\u4e8b\u306f\u81ea\u660e\u3067\u3059\u306e\u3067\u3001PostgreSQL\u306e\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306f tbl_2016 \u3001 tbl_2017 \u3001 tbl_2018 \u3060\u3051\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u7d50\u5408\u3059\u308b Append \u30ce\u30fc\u30c9\u3092\u631f\u3080\u4e8b\u3067\u3001\u3042\u305f\u304b\u3082\u5358\u4e00\u306e\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30ec\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u51fa\u3057\u305f\u304b\u306e\u3088\u3046\u306b\u632f\u821e\u3046\u5b9f\u884c\u8a08\u753b\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 PostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3068PG-Strom\u3092\u4f75\u7528\u3059\u308b\u5834\u5408\u3001\u307e\u305a\u3001\u30b9\u30ad\u30e3\u30f3\u304c\u5fc5\u8981\u3067\u3042\u308b\u3068\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u304c\u5224\u65ad\u3057\u305f\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u5bfe\u3057\u3001\u500b\u3005\u306b\u5b9f\u884c\u30b3\u30b9\u30c8\u3092\u63a8\u5b9a\u3057\u305f\u4e0a\u3067 GpuScan \u304c\u9078\u629e\u3055\u308c\u308b\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001 GpuScan \u306e\u5b9f\u884c\u7d50\u679c\u3092 Append \u30ce\u30fc\u30c9\u3067\u675f\u306d\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u305f\u3060\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u7d9a\u304d\u3001JOIN\u3084GROUP BY\u306a\u3069PG-Strom\u3067\u9ad8\u901f\u5316\u304c\u53ef\u80fd\u306a\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u6700\u9069\u5316\u306e\u89b3\u70b9\u304b\u3089\u691c\u8a0e\u304c\u5fc5\u8981\u3067\u3059\u3002 \u4f8b\u3048\u3070\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u3066\u3044\u306a\u3044\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3066\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u3068JOIN\u3057\u3001GROUP BY\u306b\u3088\u308b\u96c6\u8a08\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\u5834\u5408\u3001\u6761\u4ef6\u304c\u63c3\u3048\u3070\u3001\u5404\u30b9\u30c6\u30c3\u30d7\u9593\u306e\u30c7\u30fc\u30bf\u4ea4\u63db\u306fGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u3067\u884c\u3046\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306fGPU\u3068CPU\u306e\u9593\u306e\u30c7\u30fc\u30bf\u79fb\u52d5\u3092\u6700\u5c0f\u5316\u3059\u308b\u3068\u3044\u3046\u89b3\u70b9\u304b\u3089\u3001\u6700\u3082PG-Strom\u304c\u5f97\u610f\u3068\u3059\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u3002 \u4e00\u65b9\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u540c\u69d8\u306e\u51e6\u7406\u3092\u884c\u3046\u5834\u5408\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u3068JOIN\u3084GROUP BY\u306e\u9593\u306b Append \u51e6\u7406\u304c\u631f\u307e\u3063\u3066\u3057\u307e\u3046\u306e\u304c\u8ab2\u984c\u3067\u3059\u3002\u3053\u306e\u5b9f\u884c\u8a08\u753b\u306e\u4e0b\u3067\u306f\u3001GpuScan\u304c\u51e6\u7406\u3057\u305f\u30c7\u30fc\u30bf\u3092\u4e00\u5ea6\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u3078\u8ee2\u9001\u3057\u3001 Append \u51e6\u7406\u3092\u884c\u3063\u305f\u4e0a\u3067\u3001\u305d\u306e\u5f8c\u306eGpuJoin\u3084GpuPreAgg\u51e6\u7406\u3092\u884c\u3046\u305f\u3081\u306b\u518d\u3073\u30c7\u30fc\u30bf\u3092GPU\u3078\u8ee2\u9001\u3059\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u6c7a\u3057\u3066\u52b9\u7387\u306e\u826f\u3044\u51e6\u7406\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u3053\u306e\u3088\u3046\u306aCPU-GPU\u9593\u306e\u30c7\u30fc\u30bf\u306e\u30d4\u30f3\u30dd\u30f3\u3092\u907f\u3051\u308b\u305f\u3081\u3001PG-Strom\u306f\u53ef\u80fd\u306a\u9650\u308aJOIN\u3084GROUP BY\u3092 Append \u3088\u308a\u3082\u5148\u306b\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3092\u8a66\u307f\u307e\u3059\u3002 \u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u304c\u6210\u529f\u308c\u3070\u3001\u30c7\u30fc\u30bf\u4ea4\u63db\u3092\u52b9\u7387\u5316\u3067\u304d\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u7279\u306bGROUP BY\u51e6\u7406\u306b\u3088\u3063\u3066\u884c\u6570\u3092\u5927\u5e45\u306b\u524a\u6e1b\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308b\u305f\u3081\u3001 Append \u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u306e\u8ca0\u8377\u3092\u9855\u8457\u306b\u6e1b\u3089\u3059\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u65e5\u4ed8\u578b\uff08date\u578b\uff09\u306e\u30d5\u30a3\u30fc\u30eb\u30c9 ymd \u3092\u30ad\u30fc\u3068\u3057\u3066\u5e74\u5358\u4f4d\u3067\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308b pt \u306b\u5bfe\u3057\u3066\u3001JOIN\u3068GROUP BY\u3092\u542b\u3080\u30af\u30a8\u30ea\u3092\u6295\u5165\u3057\u305f\u6642\u306e\u5b9f\u884c\u8a08\u753b\u3067\u3059\u3002 \u691c\u7d22\u6761\u4ef6\u306b\u3088\u308a2016\u5e74\u4ee5\u524d\u306e\u30c7\u30fc\u30bf\u3092\u542b\u3080\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306f\u81ea\u660e\u306b\u6392\u9664\u3055\u308c\u3001\u3055\u3089\u306b pt_2017 \u3001 pt_2018 \u3001 pt_2019 \u5404\u30c6\u30fc\u30d6\u30eb\u306eJOIN\u3068GROUP BY\u51e6\u7406\u304c\u4e00\u4f53\u3068\u306a\u3063\u3066 Append \u306e\u524d\u306b\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 # EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- HashAggregate (cost=196410.07..196412.57 rows=200 width=48) Group Key: pt_2017.cat -> Gather (cost=66085.69..196389.07 rows=1200 width=72) Workers Planned: 2 -> Parallel Append (cost=65085.69..195269.07 rows=600 width=72) -> Parallel Custom Scan (GpuPreAgg) (cost=65085.69..65089.69 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2017 (cost=32296.64..74474.20 rows=1050772 width=40) Outer Scan: pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050772...2521854) HashKeys: pt_2017.aid JoinQuals: (pt_2017.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65078.35..65082.35 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2018 (cost=32296.65..74465.75 rows=1050649 width=40) Outer Scan: pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050649...2521557) HashKeys: pt_2018.aid JoinQuals: (pt_2018.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65093.03..65097.03 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2019 (cost=32296.65..74482.64 rows=1050896 width=40) Outer Scan: pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050896...2522151) HashKeys: pt_2019.aid JoinQuals: (pt_2019.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (38 rows)","title":"\u6982\u8981"},{"location":"partition/#_3","text":"\u4ee5\u4e0b\u306eGUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308a\u3001PG-Strom\u306fJOIN\u3084GROUP BY\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3078\u306e\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 \u30d1\u30e9\u30e1\u30fc\u30bf\u540d \u578b \u521d\u671f\u5024 \u8aac\u660e pg_strom.enable_partitionwise_gpujoin bool on GpuJoin\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002PostgreSQL v10\u4ee5\u964d\u3067\u306e\u307f\u5bfe\u5fdc\u3002 pg_strom.enable_partitionwise_gpupreagg bool on GpuPreAgg\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002PostgreSQL v10\u4ee5\u964d\u3067\u306e\u307f\u5bfe\u5fdc\u3002 \u3053\u308c\u3089\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u521d\u671f\u5024\u306f on \u3067\u3059\u304c\u3001\u3053\u308c\u3092 off \u306b\u3057\u305f\u5834\u5408\u3001\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u51e6\u7406\u306f\u884c\u308f\u308c\u307e\u305b\u3093\u3002 EXPLAIN\u30b3\u30de\u30f3\u30c9\u3067\u524d\u7bc0\u306e\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u8a08\u753b\u3092\u8868\u793a\u3057\u305f\u3068\u3053\u308d\u3001\u5b9f\u884c\u8a08\u753b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u5316\u3057\u3066\u3044\u307e\u3059\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u306f GpuScan \u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u51e6\u7406\u7d50\u679c\u306f\u4e00\u5ea6\u30db\u30b9\u30c8\u30b7\u30b9\u30c6\u30e0\u306b\u8fd4\u3055\u308c\u3001 Append \u306b\u3088\u3063\u3066\u7d50\u5408\u3055\u308c\u305f\u5f8c\u3001\u518d\u3073 GpuJoin \u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306bGPU\u3078\u3068\u8ee2\u9001\u3055\u308c\u307e\u3059\u3002 postgres=# set pg_strom.enable_partitionwise_gpujoin = off; SET postgres=# set pg_strom.enable_partitionwise_gpupreagg = off; SET postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date group by cat; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate (cost=341392.92..341399.42 rows=200 width=48) Group Key: pt.cat -> Sort (cost=341392.92..341393.92 rows=400 width=72) Sort Key: pt.cat -> Gather (cost=341333.63..341375.63 rows=400 width=72) Workers Planned: 2 -> Partial HashAggregate (cost=340333.63..340335.63 rows=200 width=72) Group Key: pt.cat -> Parallel Custom Scan (GpuJoin) (cost=283591.92..283591.92 rows=7565562 width=40) Depth 1: GpuHashJoin (nrows 3152318...7565562) HashKeys: pt.aid JoinQuals: (pt.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Append (cost=28540.80..200673.34 rows=3152318 width=36) -> Parallel Custom Scan (GpuScan) on pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (21 rows)","title":"\u8a2d\u5b9a\u3068\u904b\u7528"},{"location":"partition/#ssdgpu","text":"PostgreSQL\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30cb\u30f3\u30b0\u3068SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3092\u4f75\u7528\u3059\u308b\u5834\u5408\u3001\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u304c\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092\u4fdd\u5b58\u3059\u308bNVMe-SSD\u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u7269\u7406\u7684\u306a\u914d\u7f6e\u306b\u306f\u7279\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002","title":"SSD\u3068GPU\u306e\u914d\u7f6e\u306b\u95a2\u3059\u308b\u8003\u616e"},{"location":"partition/#_4","text":"\u5b9f\u9a13\u7684\u6a5f\u80fd GpuJoin\u3068GpuPreAgg\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3078\u306e\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u306f\u3001\u73fe\u6642\u70b9\u3067\u306f\u5b9f\u9a13\u7684\u306a\u6a5f\u80fd\u3067\u3042\u308a\u3001\u4e88\u671f\u305b\u306c\u4e0d\u5177\u5408\u3084\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u5834\u5408\u306f pg_strom.enable_partitionwise_gpujoin \u3084 pg_strom.enable_partitionwise_gpupreagg \u3092\u7528\u3044\u3066\u5f53\u8a72\u6a5f\u80fd\u3092\u7121\u52b9\u5316\u3059\u308b\u3068\u5171\u306b\u3001 PG-Strom Issues \u3078\u969c\u5bb3\u30ec\u30dd\u30fc\u30c8\u3092\u304a\u9858\u3044\u3057\u307e\u3059\u3002","title":"\u5236\u9650\u4e8b\u9805"},{"location":"postgis/","text":"GPU\u7248PostGIS \u672c\u7ae0\u3067\u306fGPU\u7248PostGIS\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u6982\u8981 PostGIS\u3068\u306f\u3001\u5730\u7406\u7a7a\u9593\u60c5\u5831\u3092\u53d6\u308a\u6271\u3046\u305f\u3081\u306ePostgreSQL\u5411\u3051\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3059\u3002 \u70b9\u3001\u7dda\u5206\u3001\u30dd\u30ea\u30b4\u30f3\u306a\u3069\u5730\u7406\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u6271\u3046\u305f\u3081\u306e\u30c7\u30fc\u30bf\u578b\uff08 Geometry \uff09\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u307b\u304b\u3001\u8ddd\u96e2\u306e\u8a08\u7b97\u3084\u5305\u542b\u3001\u4ea4\u5dee\u95a2\u4fc2\u306e\u5224\u5b9a\u306a\u3069\u3001\u5730\u7406\u30c7\u30fc\u30bf\u8981\u7d20\u3092\u8a55\u4fa1\u3059\u308b\u305f\u3081\u306e\u95a2\u6570\u3084\u6f14\u7b97\u5b50\u3092\u6570\u591a\u304f\u53d6\u308a\u63c3\u3048\u3066\u3044\u307e\u3059\u3002 \u307e\u305f\u3001\u4e00\u90e8\u306e\u6f14\u7b97\u5b50\u306b\u3064\u3044\u3066\u306fPostgreSQL\u306eGiST(Generalized Search Tree)\u306e\u4ed5\u7d44\u307f\u3092\u7528\u3044\u3066R\u6728\u306b\u3088\u308b\u9ad8\u901f\u306a\u691c\u7d22\u3082\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 2001\u5e74\u306b\u6700\u521d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u516c\u958b\u3055\u308c\u3066\u4ee5\u964d\u300120\u5e74\u4ee5\u4e0a\u306b\u308f\u305f\u308a\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306b\u3088\u3063\u3066\u6a5f\u80fd\u5f37\u5316\u3084\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u304c\u884c\u308f\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089PostGIS\u306e\u63d0\u4f9b\u3059\u308b\u95a2\u6570\u3084\u6f14\u7b97\u5b50\u306f\u3001\u7dcf\u6570\u3067500\u3092\u8d85\u3048\u308b\u975e\u5e38\u306b\u5927\u898f\u6a21\u306a\u3082\u306e\u3067\u3059\u3002 \u305d\u306e\u305f\u3081\u3001PG-Strom\u3067\u306f\u6bd4\u8f03\u7684\u5229\u7528\u983b\u5ea6\u306e\u9ad8\u3044\u3044\u304f\u3064\u304b\u306ePostGIS\u95a2\u6570\u3060\u3051\u3092GPU\u7528\u306b\u79fb\u690d\u3057\u3066\u3044\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306aPostGIS\u95a2\u6570\u304c\u305d\u308c\u306b\u8a72\u5f53\u3057\u307e\u3059\u3002 geometry st_point(float8 lon,float8 lat) \u7d4c\u5ea6\u7def\u5ea6\u304b\u3089\u3001\u70b9\uff08Point\uff09\u3067\u3042\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u578b\u3092\u751f\u6210\u3059\u308b\u3002 bool st_contains(geometry a,geometry b) \u30b8\u30aa\u30e1\u30c8\u30eaa\u304c\u30b8\u30aa\u30e1\u30c8\u30eab\u304c\u5305\u542b\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u3002 bool st_crosses(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u304c\u4ea4\u5dee\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u3002 text st_relate(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u306e\u95a2\u4fc2\u3092 DE-9IM(Dimensionally Extended 9-Intersection Model) \u306e\u884c\u5217\u8868\u73fe\u3068\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002 \u307e\u305f\u3001\u30c6\u30fc\u30d6\u30eb\u540c\u58eb\u306e\u7d50\u5408\u6761\u4ef6\u304cGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u306e\u5229\u7528\u306b\u9069\u3059\u308b\u5834\u5408\u3001GpuJoin\u306fGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u3092GPU\u5074\u306b\u30ed\u30fc\u30c9\u3057\u3001\u7d50\u5408\u3059\u3079\u304d\u884c\u306e\u7d5e\u308a\u8fbc\u307f\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u3053\u308c\u306f\u4f8b\u3048\u3070\u3001GPS\u304b\u3089\u53d6\u5f97\u3057\u305f\u30e2\u30d0\u30a4\u30eb\u6a5f\u5668\u306e\u4f4d\u7f6e\uff08\u70b9\uff09\u3068\u30a8\u30ea\u30a2\u5b9a\u7fa9\u30c7\u30fc\u30bf\uff08\u30dd\u30ea\u30b4\u30f3\uff09\u3092\u7a81\u304d\u5408\u308f\u305b\u308b\u3068\u3044\u3063\u305f\u51e6\u7406\u306e\u9ad8\u901f\u5316\u306b\u5bc4\u4e0e\u3057\u307e\u3059\u3002 PostGIS\u306e\u5229\u7528 GPU\u7248PostGIS\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u7279\u5225\u306a\u8a2d\u5b9a\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002 PostGIS\u3092\u30d1\u30c3\u30b1\u30fc\u30b8\u53c8\u306f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001 CREATE EXTENSION \u69cb\u6587\u3092\u7528\u3044\u3066\u30b8\u30aa\u30e1\u30c8\u30ea\u30c7\u30fc\u30bf\u578b\u3084PostGIS\u95a2\u6570\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308c\u3070\u3001PG-Strom\u306f\u30af\u30a8\u30ea\u306b\u51fa\u73fe\u3057\u305fPostGIS\u95a2\u6570\u304cGPU\u3067\u5b9f\u884c\u53ef\u80fd\u304b\u3069\u3046\u304b\u3092\u81ea\u52d5\u7684\u306b\u5224\u5b9a\u3057\u307e\u3059\u3002 PostGIS\u81ea\u4f53\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u306f\u3001 PostGIS\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u306b\u306fGPU\u5b9f\u884c\u53ef\u80fd\u306aPostGIS\u95a2\u6570\u3067\u3042\u308b st_contains() \u3068 st_makepoint() \u3092\u4f7f\u7528\u3057\u3066\u304a\u308a\u3001\u30b8\u30aa\u30e1\u30c8\u30ea\u578b\u306e\u5b9a\u6570 'polygon ((10 10,30 10,30 20,10 20,10 10))' \u306e\u7bc4\u56f2\u5185\u306b\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u4e8c\u6b21\u5143\u306e\u70b9\u304c\u542b\u307e\u308c\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u95a2\u6570\u304c GPU Filter: \u306e\u4e00\u90e8\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u4e8b\u304b\u3089\u3082\u5206\u304b\u308b\u3088\u3046\u306b\u3001PG-Strom\u306f\u5bfe\u5fdc\u6e08\u307f\u306ePostGIS\u95a2\u6570\u3092\u81ea\u52d5\u7684\u306b\u691c\u51fa\u3057\u3001\u53ef\u80fd\u306a\u9650\u308aGPU\u3067\u5b9f\u884c\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002 =# explain select * from dpoints where st_contains('polygon ((10 10,30 10,30 20,10 20,10 10))', st_makepoint(x,y)); QUERY PLAN ------------------------------------------------------------------------------------------ Custom Scan (GpuScan) on dpoints (cost=1397205.10..12627630.76 rows=800 width=28) GPU Filter: st_contains('01030000000100000005000000000000000000244000000000000024400000000000003E4000000000000024400000000000003E4000000000000034400000000000002440000000000000344000000000000024400000000000002440'::geometry, st_makepoint(x, y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) (3 rows) GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9 st_contains() \u3084 st_crosses() \u306a\u3069\u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u306e\u95a2\u4fc2\u6027\u3092\u8a55\u4fa1\u3059\u308bPostGIS\u95a2\u6570\u306e\u4e00\u90e8\u306f\u3001GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001CPU\u3060\u3051\u3092\u7528\u3044\u3066\u691c\u7d22\u3092\u884c\u3046\u5834\u5408\u306b\u3082\u9ad8\u901f\u306a\u7d5e\u308a\u8fbc\u307f\u3092\u884c\u3046\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 PG-Strom\u306eGpuJoin\u3067\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u540c\u58eb\u306e\u7d50\u5408\u6761\u4ef6\u304cGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u3067\u9ad8\u901f\u5316\u53ef\u80fd\u306a\u5834\u5408\u3001\u7d50\u5408\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u306e\u4e2d\u8eab\u3060\u3051\u3067\u306a\u304f\u3001GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3082\u540c\u6642\u306bGPU\u5074\u3078\u8ee2\u9001\u3057\u3001\u7d50\u5408\u5bfe\u8c61\u306e\u884c\u3092\u9ad8\u901f\u306b\u7d5e\u308a\u8fbc\u3080\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u306e\u51e6\u7406\u306f\u901a\u5e38\u3001CPU\u3088\u308a\u3082\u9065\u304b\u306b\u9ad8\u3044\u4e26\u5217\u5ea6\u3067\u5b9f\u884c\u3055\u308c\u308b\u305f\u3081\u3001\u304b\u306a\u308a\u306e\u9ad8\u901f\u5316\u3092\u671f\u5f85\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4e00\u65b9\u3001GpuScan\u306f\u30c6\u30fc\u30d6\u30eb\u5358\u4f53\u306e\u30b9\u30ad\u30e3\u30f3\u306bGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001CPU\u306b\u3088\u308bIndexScan\u3067\u306e\u7d5e\u308a\u8fbc\u307f\u306e\u65b9\u304c\u9ad8\u901f\u3067\u3042\u308b\u4e8b\u304c\u591a\u3044\u304b\u3089\u3067\u3059\u3002 \u30b8\u30aa\u30e1\u30c8\u30ea\u30c7\u30fc\u30bf\u306bGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u3001 CREATE INDEX \u69cb\u6587\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u5e02\u753a\u6751\u306e\u5883\u754c\u7dda\u30c7\u30fc\u30bf\uff08giscity\u30c6\u30fc\u30d6\u30eb\u306egeom\u5217\uff09\u306b\u5bfe\u3057\u3066GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u3082\u306e\u3067\u3059\u3002 =# CREATE INDEX on giscity USING gist (geom); CREATE INDEX \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u3001\u5e02\u753a\u6751\u306e\u5883\u754c\u7dda\u30c7\u30fc\u30bf\uff08giscity\u30c6\u30fc\u30d6\u30eb\uff09\u3068\u7def\u5ea6\u7d4c\u5ea6\u30c7\u30fc\u30bf\uff08dpoints\u30c6\u30fc\u30d6\u30eb\uff09\u3092\u7a81\u304d\u5408\u308f\u305b\u3001\u30dd\u30ea\u30b4\u30f3\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u305f\u5e02\u753a\u6751\u306e\u9818\u57df\u5185\u306b\u542b\u307e\u308c\u308b\u7def\u5ea6\u7d4c\u5ea6\u30c7\u30fc\u30bf\uff08\u70b9\uff09\u306e\u6570\u3092\u5e02\u753a\u6751\u3054\u3068\u306b\u51fa\u529b\u3059\u308b\u3082\u306e\u3067\u3059\u3002 \u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u3088\u308aGpuJoin\u304c\u9078\u629e\u3055\u308c\u3001giscity\u30c6\u30fc\u30d6\u30eb\u3068dpoints\u30c6\u30fc\u30d6\u30eb\u306e\u7d50\u5408\u306b\u306fGpuGiSTJoin\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u3059\u3002 IndexFilter:\u306e\u884c\u306b\u306f\u3001GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308b\u7d5e\u308a\u8fbc\u307f\u6761\u4ef6\u304c (g.geom ~ st_makepoint(d.x, d.y)) \u3067\u3042\u308a\u3001\u4f7f\u7528\u3059\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c giscity_geom_idx \u3067\u3042\u308b\u4e8b\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u4f7f\u7528\u306b\u3088\u308a\u3001GPU\u3067\u3042\u3063\u3066\u3082\u6bd4\u8f03\u7684\u300c\u91cd\u3044\u300d\u51e6\u7406\u3067\u3042\u308bPostGIS\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u3001\u660e\u3089\u304b\u306b\u6761\u4ef6\u306b\u30de\u30c3\u30c1\u3057\u306a\u3044\u7d44\u307f\u5408\u308f\u305b\u3092\u6392\u9664\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u305f\u3081\u3001\u5927\u5e45\u306a\u691c\u7d22\u51e6\u7406\u306e\u9ad8\u901f\u5316\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 =# EXPLAIN SELECT pref, city, count(*) FROM giscity g, dpoints d WHERE pref = 'Tokyo' AND st_contains(g.geom,st_makepoint(d.x, d.y)) GROUP BY pref, city; QUERY PLAN ----------------------------------------------------------------------------------------------------------- GroupAggregate (cost=5700646.35..5700759.39 rows=5024 width=29) Group Key: g.n03_001, g.n03_004 -> Sort (cost=5700646.35..5700658.91 rows=5024 width=29) Sort Key: g.n03_004 -> Custom Scan (GpuPreAgg) (cost=5700274.71..5700337.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=638671.58..5668511.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (17 rows)","title":"GPU\u7248PostGIS"},{"location":"postgis/#gpupostgis","text":"\u672c\u7ae0\u3067\u306fGPU\u7248PostGIS\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"GPU\u7248PostGIS"},{"location":"postgis/#_1","text":"PostGIS\u3068\u306f\u3001\u5730\u7406\u7a7a\u9593\u60c5\u5831\u3092\u53d6\u308a\u6271\u3046\u305f\u3081\u306ePostgreSQL\u5411\u3051\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3059\u3002 \u70b9\u3001\u7dda\u5206\u3001\u30dd\u30ea\u30b4\u30f3\u306a\u3069\u5730\u7406\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u6271\u3046\u305f\u3081\u306e\u30c7\u30fc\u30bf\u578b\uff08 Geometry \uff09\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u307b\u304b\u3001\u8ddd\u96e2\u306e\u8a08\u7b97\u3084\u5305\u542b\u3001\u4ea4\u5dee\u95a2\u4fc2\u306e\u5224\u5b9a\u306a\u3069\u3001\u5730\u7406\u30c7\u30fc\u30bf\u8981\u7d20\u3092\u8a55\u4fa1\u3059\u308b\u305f\u3081\u306e\u95a2\u6570\u3084\u6f14\u7b97\u5b50\u3092\u6570\u591a\u304f\u53d6\u308a\u63c3\u3048\u3066\u3044\u307e\u3059\u3002 \u307e\u305f\u3001\u4e00\u90e8\u306e\u6f14\u7b97\u5b50\u306b\u3064\u3044\u3066\u306fPostgreSQL\u306eGiST(Generalized Search Tree)\u306e\u4ed5\u7d44\u307f\u3092\u7528\u3044\u3066R\u6728\u306b\u3088\u308b\u9ad8\u901f\u306a\u691c\u7d22\u3082\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 2001\u5e74\u306b\u6700\u521d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u516c\u958b\u3055\u308c\u3066\u4ee5\u964d\u300120\u5e74\u4ee5\u4e0a\u306b\u308f\u305f\u308a\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306b\u3088\u3063\u3066\u6a5f\u80fd\u5f37\u5316\u3084\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u304c\u884c\u308f\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089PostGIS\u306e\u63d0\u4f9b\u3059\u308b\u95a2\u6570\u3084\u6f14\u7b97\u5b50\u306f\u3001\u7dcf\u6570\u3067500\u3092\u8d85\u3048\u308b\u975e\u5e38\u306b\u5927\u898f\u6a21\u306a\u3082\u306e\u3067\u3059\u3002 \u305d\u306e\u305f\u3081\u3001PG-Strom\u3067\u306f\u6bd4\u8f03\u7684\u5229\u7528\u983b\u5ea6\u306e\u9ad8\u3044\u3044\u304f\u3064\u304b\u306ePostGIS\u95a2\u6570\u3060\u3051\u3092GPU\u7528\u306b\u79fb\u690d\u3057\u3066\u3044\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306aPostGIS\u95a2\u6570\u304c\u305d\u308c\u306b\u8a72\u5f53\u3057\u307e\u3059\u3002 geometry st_point(float8 lon,float8 lat) \u7d4c\u5ea6\u7def\u5ea6\u304b\u3089\u3001\u70b9\uff08Point\uff09\u3067\u3042\u308b\u30b8\u30aa\u30e1\u30c8\u30ea\u578b\u3092\u751f\u6210\u3059\u308b\u3002 bool st_contains(geometry a,geometry b) \u30b8\u30aa\u30e1\u30c8\u30eaa\u304c\u30b8\u30aa\u30e1\u30c8\u30eab\u304c\u5305\u542b\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u3002 bool st_crosses(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u304c\u4ea4\u5dee\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u3002 text st_relate(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u306e\u95a2\u4fc2\u3092 DE-9IM(Dimensionally Extended 9-Intersection Model) \u306e\u884c\u5217\u8868\u73fe\u3068\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002 \u307e\u305f\u3001\u30c6\u30fc\u30d6\u30eb\u540c\u58eb\u306e\u7d50\u5408\u6761\u4ef6\u304cGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u306e\u5229\u7528\u306b\u9069\u3059\u308b\u5834\u5408\u3001GpuJoin\u306fGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u3092GPU\u5074\u306b\u30ed\u30fc\u30c9\u3057\u3001\u7d50\u5408\u3059\u3079\u304d\u884c\u306e\u7d5e\u308a\u8fbc\u307f\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u3053\u308c\u306f\u4f8b\u3048\u3070\u3001GPS\u304b\u3089\u53d6\u5f97\u3057\u305f\u30e2\u30d0\u30a4\u30eb\u6a5f\u5668\u306e\u4f4d\u7f6e\uff08\u70b9\uff09\u3068\u30a8\u30ea\u30a2\u5b9a\u7fa9\u30c7\u30fc\u30bf\uff08\u30dd\u30ea\u30b4\u30f3\uff09\u3092\u7a81\u304d\u5408\u308f\u305b\u308b\u3068\u3044\u3063\u305f\u51e6\u7406\u306e\u9ad8\u901f\u5316\u306b\u5bc4\u4e0e\u3057\u307e\u3059\u3002","title":"\u6982\u8981"},{"location":"postgis/#postgis","text":"GPU\u7248PostGIS\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u7279\u5225\u306a\u8a2d\u5b9a\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002 PostGIS\u3092\u30d1\u30c3\u30b1\u30fc\u30b8\u53c8\u306f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001 CREATE EXTENSION \u69cb\u6587\u3092\u7528\u3044\u3066\u30b8\u30aa\u30e1\u30c8\u30ea\u30c7\u30fc\u30bf\u578b\u3084PostGIS\u95a2\u6570\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308c\u3070\u3001PG-Strom\u306f\u30af\u30a8\u30ea\u306b\u51fa\u73fe\u3057\u305fPostGIS\u95a2\u6570\u304cGPU\u3067\u5b9f\u884c\u53ef\u80fd\u304b\u3069\u3046\u304b\u3092\u81ea\u52d5\u7684\u306b\u5224\u5b9a\u3057\u307e\u3059\u3002 PostGIS\u81ea\u4f53\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u306f\u3001 PostGIS\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u306b\u306fGPU\u5b9f\u884c\u53ef\u80fd\u306aPostGIS\u95a2\u6570\u3067\u3042\u308b st_contains() \u3068 st_makepoint() \u3092\u4f7f\u7528\u3057\u3066\u304a\u308a\u3001\u30b8\u30aa\u30e1\u30c8\u30ea\u578b\u306e\u5b9a\u6570 'polygon ((10 10,30 10,30 20,10 20,10 10))' \u306e\u7bc4\u56f2\u5185\u306b\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u4e8c\u6b21\u5143\u306e\u70b9\u304c\u542b\u307e\u308c\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u95a2\u6570\u304c GPU Filter: \u306e\u4e00\u90e8\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u4e8b\u304b\u3089\u3082\u5206\u304b\u308b\u3088\u3046\u306b\u3001PG-Strom\u306f\u5bfe\u5fdc\u6e08\u307f\u306ePostGIS\u95a2\u6570\u3092\u81ea\u52d5\u7684\u306b\u691c\u51fa\u3057\u3001\u53ef\u80fd\u306a\u9650\u308aGPU\u3067\u5b9f\u884c\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002 =# explain select * from dpoints where st_contains('polygon ((10 10,30 10,30 20,10 20,10 10))', st_makepoint(x,y)); QUERY PLAN ------------------------------------------------------------------------------------------ Custom Scan (GpuScan) on dpoints (cost=1397205.10..12627630.76 rows=800 width=28) GPU Filter: st_contains('01030000000100000005000000000000000000244000000000000024400000000000003E4000000000000024400000000000003E4000000000000034400000000000002440000000000000344000000000000024400000000000002440'::geometry, st_makepoint(x, y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) (3 rows)","title":"PostGIS\u306e\u5229\u7528"},{"location":"postgis/#gist","text":"st_contains() \u3084 st_crosses() \u306a\u3069\u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u306e\u95a2\u4fc2\u6027\u3092\u8a55\u4fa1\u3059\u308bPostGIS\u95a2\u6570\u306e\u4e00\u90e8\u306f\u3001GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001CPU\u3060\u3051\u3092\u7528\u3044\u3066\u691c\u7d22\u3092\u884c\u3046\u5834\u5408\u306b\u3082\u9ad8\u901f\u306a\u7d5e\u308a\u8fbc\u307f\u3092\u884c\u3046\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 PG-Strom\u306eGpuJoin\u3067\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u540c\u58eb\u306e\u7d50\u5408\u6761\u4ef6\u304cGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08R\u6728\uff09\u3067\u9ad8\u901f\u5316\u53ef\u80fd\u306a\u5834\u5408\u3001\u7d50\u5408\u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u306e\u4e2d\u8eab\u3060\u3051\u3067\u306a\u304f\u3001GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3082\u540c\u6642\u306bGPU\u5074\u3078\u8ee2\u9001\u3057\u3001\u7d50\u5408\u5bfe\u8c61\u306e\u884c\u3092\u9ad8\u901f\u306b\u7d5e\u308a\u8fbc\u3080\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u306e\u51e6\u7406\u306f\u901a\u5e38\u3001CPU\u3088\u308a\u3082\u9065\u304b\u306b\u9ad8\u3044\u4e26\u5217\u5ea6\u3067\u5b9f\u884c\u3055\u308c\u308b\u305f\u3081\u3001\u304b\u306a\u308a\u306e\u9ad8\u901f\u5316\u3092\u671f\u5f85\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4e00\u65b9\u3001GpuScan\u306f\u30c6\u30fc\u30d6\u30eb\u5358\u4f53\u306e\u30b9\u30ad\u30e3\u30f3\u306bGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001CPU\u306b\u3088\u308bIndexScan\u3067\u306e\u7d5e\u308a\u8fbc\u307f\u306e\u65b9\u304c\u9ad8\u901f\u3067\u3042\u308b\u4e8b\u304c\u591a\u3044\u304b\u3089\u3067\u3059\u3002 \u30b8\u30aa\u30e1\u30c8\u30ea\u30c7\u30fc\u30bf\u306bGiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u3001 CREATE INDEX \u69cb\u6587\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u5e02\u753a\u6751\u306e\u5883\u754c\u7dda\u30c7\u30fc\u30bf\uff08giscity\u30c6\u30fc\u30d6\u30eb\u306egeom\u5217\uff09\u306b\u5bfe\u3057\u3066GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u3082\u306e\u3067\u3059\u3002 =# CREATE INDEX on giscity USING gist (geom); CREATE INDEX \u4ee5\u4e0b\u306e\u5b9f\u884c\u8a08\u753b\u306f\u3001\u5e02\u753a\u6751\u306e\u5883\u754c\u7dda\u30c7\u30fc\u30bf\uff08giscity\u30c6\u30fc\u30d6\u30eb\uff09\u3068\u7def\u5ea6\u7d4c\u5ea6\u30c7\u30fc\u30bf\uff08dpoints\u30c6\u30fc\u30d6\u30eb\uff09\u3092\u7a81\u304d\u5408\u308f\u305b\u3001\u30dd\u30ea\u30b4\u30f3\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u305f\u5e02\u753a\u6751\u306e\u9818\u57df\u5185\u306b\u542b\u307e\u308c\u308b\u7def\u5ea6\u7d4c\u5ea6\u30c7\u30fc\u30bf\uff08\u70b9\uff09\u306e\u6570\u3092\u5e02\u753a\u6751\u3054\u3068\u306b\u51fa\u529b\u3059\u308b\u3082\u306e\u3067\u3059\u3002 \u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u3088\u308aGpuJoin\u304c\u9078\u629e\u3055\u308c\u3001giscity\u30c6\u30fc\u30d6\u30eb\u3068dpoints\u30c6\u30fc\u30d6\u30eb\u306e\u7d50\u5408\u306b\u306fGpuGiSTJoin\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u3059\u3002 IndexFilter:\u306e\u884c\u306b\u306f\u3001GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3088\u308b\u7d5e\u308a\u8fbc\u307f\u6761\u4ef6\u304c (g.geom ~ st_makepoint(d.x, d.y)) \u3067\u3042\u308a\u3001\u4f7f\u7528\u3059\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c giscity_geom_idx \u3067\u3042\u308b\u4e8b\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u4f7f\u7528\u306b\u3088\u308a\u3001GPU\u3067\u3042\u3063\u3066\u3082\u6bd4\u8f03\u7684\u300c\u91cd\u3044\u300d\u51e6\u7406\u3067\u3042\u308bPostGIS\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u3001\u660e\u3089\u304b\u306b\u6761\u4ef6\u306b\u30de\u30c3\u30c1\u3057\u306a\u3044\u7d44\u307f\u5408\u308f\u305b\u3092\u6392\u9664\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u305f\u3081\u3001\u5927\u5e45\u306a\u691c\u7d22\u51e6\u7406\u306e\u9ad8\u901f\u5316\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 =# EXPLAIN SELECT pref, city, count(*) FROM giscity g, dpoints d WHERE pref = 'Tokyo' AND st_contains(g.geom,st_makepoint(d.x, d.y)) GROUP BY pref, city; QUERY PLAN ----------------------------------------------------------------------------------------------------------- GroupAggregate (cost=5700646.35..5700759.39 rows=5024 width=29) Group Key: g.n03_001, g.n03_004 -> Sort (cost=5700646.35..5700658.91 rows=5024 width=29) Sort Key: g.n03_004 -> Custom Scan (GpuPreAgg) (cost=5700274.71..5700337.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=638671.58..5668511.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (17 rows)","title":"GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9"},{"location":"ref_devfuncs/","text":"\u95a2\u6570\u3068\u6f14\u7b97\u5b50 \u672c\u7ae0\u3067\u306fGPU\u30c7\u30d0\u30a4\u30b9\u4e0a\u3067\u5b9f\u884c\u53ef\u80fd\u306a\u95a2\u6570\u3068\u6f14\u7b97\u5b50\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u578b\u30ad\u30e3\u30b9\u30c8 bool <-- int4 int1 <-- int2 , int4 , int8 , float2 , float4 , float8 , numeric int2 <-- int1 , int4 , int8 , float2 , float4 , float8 , numeric int4 <-- bool , int1 , int2 , int8 , float2 , float4 , float8 , numeric int8 <-- int1 , int2 , int4 , float2 , float4 , float8 , numeric float2 <-- int1 , int2 , int4 , int8 , float4 , float8 , numeric float4 <-- int1 , int2 , int4 , int8 , float2 , float8 , numeric float8 <-- int1 , int2 , int4 , int8 , float2 , float4 , numeric numeric <-- int1 , int2 , int4 , int8 , float2 , float4 , float8 money <-- int4 , int8 , numeric date <-- timestamp , timestamptz time <-- timetz , timestamp , timestamptz timetz <-- time , timestamptz timestamp <-- date , timestamptz timestamptz <-- date , timestamp \u6570\u5024\u578b\u6f14\u7b97\u5b50 bool COMP bool \u8ad6\u7406\u5024\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT COMP INT \u6574\u6570\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6574\u6570\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} FP COMP FP \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 FP \u306f float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} numeric COMP numeric \u5b9f\u6570\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT OP INT \u6574\u6570\u578b\u306e\u7b97\u8853\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6574\u6570\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 OP \u306f +,-,*,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} FP OP FP \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306e\u7b97\u8853\u6f14\u7b97\u5b50\u3002 FP \u306f float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 COMP \u306f +,-,*,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} numeric OP numeric \u5b9f\u6570\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 OP \u306f +,-,*,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT % INT \u5270\u4f59\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT & INT \u8ad6\u7406\u7a4d\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT | INT \u8ad6\u7406\u548c\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT # INT \u6392\u4ed6\u7684\u8ad6\u7406\u548c\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} ~ INT \u8ad6\u7406\u5426\u5b9a\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT >> int4 \u53f3\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT << int4 \u5de6\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} + TYPE \u5358\u9805\u30d7\u30e9\u30b9\u6f14\u7b97\u5b50\u3002 TYPE \u306f int1,int2,int4,int8,float2,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} - TYPE \u5358\u9805\u30de\u30a4\u30ca\u30b9\u6f14\u7b97\u5b50\u3002 TYPE \u306f int1,int2,int4,int8,float2,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} @ TYPE \u7d76\u5bfe\u5024\u3002 TYPE \u306f int1,int2,int4,int8,float2,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} \u6570\u5b66\u95a2\u6570 float8 cbrt(float8) float8 dcbrt(float8) \u7acb\u65b9\u6839 float8 ceil(float8) float8 ceiling(float8) \u5f15\u6570\u3088\u308a\u5927\u304d\u3044\u304b\u7b49\u3057\u304f\u3001\u5f15\u6570\u306b\u6700\u3082\u8fd1\u3044\u6574\u6570 float8 exp(float8) float8 dexp(float8) \u6307\u6570\uff08e\u3092\u5e95\u3068\u3059\u308b\u6307\u5b9a\u306e\u3079\u304d\u4e57\uff09 float8 floor(float8) \u5f15\u6570\u3088\u308a\u5c0f\u3055\u3044\u304b\u7b49\u3057\u304f\u3001\u5f15\u6570\u306b\u6700\u3082\u8fd1\u3044\u6574\u6570 float8 ln(float8) float8 dlog1(float8) \u81ea\u7136\u5bfe\u6570 float8 log(float8) float8 dlog10(float8) 10\u3092\u5e95\u3068\u3057\u305f\u5bfe\u6570 float8 pi() \u5186\u5468\u7387 float8 power(float8,float8) float8 pow(float8,float8) float8 dpow(float8,float8) \u3079\u304d\u4e57 float8 round(float8) float8 dround(float8) \u6700\u3082\u8fd1\u3044\u6574\u6570\u3078\u306e\u4e38\u3081 float8 sign(float8) \u7b26\u53f7 float8 sqrt(float8) float8 dsqrt(float8) \u5e73\u65b9\u6839 float8 trunc(float8) float8 dtrunc(float8) \u6574\u6570\u3078\u306e\u5207\u6368\u3066 \u4e09\u89d2\u95a2\u6570 float8 degrees(float8) \u30e9\u30b8\u30a2\u30f3\u306b\u5bfe\u5fdc\u3059\u308b\u5ea6} float8 radians(float8) \u5ea6\u306b\u5bfe\u5fdc\u3059\u308b\u30e9\u30b8\u30a2\u30f3} float8 acos(float8) \u9006\u4f59\u5f26\u95a2\u6570} float8 asin(float8) \u9006\u6b63\u5f26\u95a2\u6570} float8 atan(float8) \u9006\u6b63\u63a5\u95a2\u6570} float8 atan2(float8,float8) arg1 / arg2 \u306e\u9006\u6b63\u63a5\u95a2\u6570} float8 cos(float8) \u4f59\u5f26\u95a2\u6570} float8 cot(float8) \u4f59\u63a5\u95a2\u6570} float8 sin(float8) \u6b63\u5f26\u95a2\u6570} float8 tan(float8) \u6b63\u63a5\u95a2\u6570} \u65e5\u4ed8/\u6642\u523b\u578b\u6f14\u7b97\u5b50 date COMP date date \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} date COMP timestamp timestamp COMP date date \u578b\u3068 timestamp \u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} date COMP timestamptz timestamptz COMP date date \u578b\u3068 timestamptz \u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} time COMP time time \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timetz COMP timetz timetz \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timestamp COMP timestamp timestamp \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timestamptz COMP timestamptz timestamptz \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timestamp COMP timestamptz timestamptz COMP timestamp timestamp \u578b\u3068 timestamptz \u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} interval COMP interval interval \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} date + int4 int4 + date date \u578b\u306e\u52a0\u7b97\u6f14\u7b97\u5b50} date - int4 date \u578b\u306e\u6e1b\u7b97\u6f14\u7b97\u5b50} date - date date \u578b\u540c\u58eb\u306e\u5dee\u5206} date + time time + date date \u3068 time \u304b\u3089 timestamp \u3092\u751f\u6210\u3057\u307e\u3059} date + timetz date \u3068 timetz \u304b\u3089 timestamptz \u3092\u751f\u6210\u3057\u307e\u3059} time - time time \u578b\u540c\u58eb\u306e\u5dee\u5206} timestamp - timestamp timestamp \u578b\u540c\u58eb\u306e\u5dee\u5206} timetz + interval timetz - interval timetz \u3068 interval \u3092\u52a0\u7b97\u3001\u307e\u305f\u306f\u6e1b\u7b97\u3057\u307e\u3059\u3002} timestamptz + interval timestamptz - interval timestamptz \u3068 interval \u3092\u52a0\u7b97\u3001\u307e\u305f\u306f\u6e1b\u7b97\u3057\u307e\u3059\u3002} overlaps(TYPE,TYPE,TYPE,TYPE) 2\u3064\u306e\u6642\u9593\u9593\u9694\u304c\u91cd\u306a\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002 TYPE \u306f time,timetz,timestamp,timestamptz \u306e\u3044\u305a\u308c\u304b\u4e00\u3064\u3067\u3059\u3002} extract(text FROM TYPE) day \u3084 hour \u306a\u3069\u65e5\u4ed8\u6642\u523b\u578b\u306e\u90e8\u5206\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u62bd\u51fa\u3002 TYPE \u306f time,timetz,timestamp,timestamptz,interval \u306e\u3044\u305a\u308c\u304b\u4e00\u3064\u3067\u3059\u3002} now() \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u73fe\u5728\u6642\u523b} - interval interval \u578b\u306e\u5358\u9805\u30de\u30a4\u30ca\u30b9\u6f14\u7b97\u5b50} interval + interval interval \u578b\u306e\u52a0\u7b97\u6f14\u7b97\u5b50} interval - interval interval \u578b\u306e\u6e1b\u7b97\u6f14\u7b97\u5b50} \u6587\u5b57\u5217\u95a2\u6570/\u6f14\u7b97\u5b50 {text,bpchar} COMP {text,bpchar} \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002 \u306a\u304a\u3001 <,<=,>=,> \u6f14\u7b97\u5b50\u306f\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u304cUTF-8\u307e\u305f\u306fC(\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u306a\u3057)\u306e\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u3067\u3059\u3002} substring(text,int4) substring(text,int4,int4) substr(text,int4) substr(text,int4,int4) \u90e8\u5206\u6587\u5b57\u5217\u306e\u5207\u308a\u51fa\u3057} length({text,bpchar}) \u6587\u5b57\u5217\u9577} {text,bpchar} [NOT] LIKE text LIKE\u8868\u73fe\u3092\u7528\u3044\u305f\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0} {text,bpchar} [NOT] ILIKE text LIKE\u8868\u73fe\u3092\u7528\u3044\u305f\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3002 \u306a\u304a\u3001 ILIKE \u6f14\u7b97\u5b50\u306f\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u304cUTF-8\u307e\u305f\u306fC(\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u306a\u3057)\u306e\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u3067\u3059\u3002} \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u95a2\u6570/\u6f14\u7b97\u5b50 macaddr COMP macaddr \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} macaddr & macaddr \u30d3\u30c3\u30c8\u7a4d\u6f14\u7b97\u5b50} macaddr | macaddr \u30d3\u30c3\u30c8\u548c\u6f14\u7b97\u5b50} ~ macaddr \u30d3\u30c3\u30c8\u5426\u5b9a\u6f14\u7b97\u5b50} trunc(macaddr) \u672b\u5c3e\u306e3\u30d0\u30a4\u30c8\u3092\u30bc\u30ed\u306b\u8a2d\u5b9a\u3059\u308b} inet COMP inet \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} inet << inet \u5de6\u8fba\u306f\u53f3\u8fba\u306b\u5185\u5305\u3055\u308c\u308b\u3002} inet <<= inet \u5de6\u8fba\u306f\u53f3\u8fba\u306b\u5185\u5305\u3055\u308c\u308b\u304b\u7b49\u3057\u3044\u3002} inet >> inet \u5de6\u8fba\u306f\u53f3\u8fba\u3092\u5185\u5305\u3059\u308b\u3002} inet >>= inet \u5de6\u8fba\u306f\u53f3\u8fba\u3092\u5185\u5305\u3059\u308b\u304b\u7b49\u3057\u3044\u3002} inet && inet \u5de6\u8fba\u306f\u53f3\u8fba\u3092\u5185\u5305\u3059\u308b\u304b\u5185\u5305\u3055\u308c\u308b} ~ inet \u30d3\u30c3\u30c8\u5426\u5b9a\u6f14\u7b97\u5b50} inet & inet \u30d3\u30c3\u30c8\u7a4d\u6f14\u7b97\u5b50} inet | inet \u30d3\u30c3\u30c8\u548c\u6f14\u7b97\u5b50} inet + int8 \u52a0\u7b97\u6f14\u7b97\u5b50} inet - int8 \u6e1b\u7b97\u6f14\u7b97\u5b50} inet - inet \u6e1b\u7b97\u6f14\u7b97\u5b50} broadcast(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8\u30a2\u30c9\u30ec\u30b9\u3092\u8fd4\u3059} family(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30a2\u30c9\u30ec\u30b9\u30d5\u30a1\u30df\u30ea\u3092\u8fd4\u3059\u3002IPv4\u306e\u5834\u5408\u306f 4 \u3001IPv6\u306e\u5834\u5408\u306f 6 } hostmask(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30db\u30b9\u30c8\u30de\u30b9\u30af\u3092\u8fd4\u3059} masklen(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30de\u30b9\u30af\u9577\u3092\u8fd4\u3059} netmask(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30cd\u30c3\u30c8\u30de\u30b9\u30af\u3092\u8fd4\u3059} network(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u90e8\u3092\u8fd4\u3059} set_masklen(NETADDR,int) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30cd\u30c3\u30c8\u30de\u30b9\u30af\u9577\u3092\u8a2d\u5b9a\u3059\u308b\u3002 NETADDR \u306f inet \u304b cidr \u306e\u3069\u3061\u3089\u304b\u3002} inet_merge(inet,inet) \u4e21\u65b9\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u542b\u3080\u6700\u5c0f\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u8fd4\u3059} \u901a\u8ca8\u578b\u6f14\u7b97\u5b50 money COMP money \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money OP money \u7b97\u8853\u6f14\u7b97\u5b50\u3002 OP \u306f +,-,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money * TYPE TYPE * money \u901a\u8ca8\u578b\u3068\u6570\u5024\u578b\u306e\u4e57\u7b97\u3002 TYPE \u306f int1,int2,int4,float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money / TYPE \u901a\u8ca8\u578b\u306e\u6570\u5024\u578b\u306b\u3088\u308b\u9664\u7b97\u3002 TYPE \u306f int1,int2,int4,float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money / money \u901a\u8ca8\u578b\u540c\u58eb\u306e\u9664\u7b97\u3002} uuid\u578b\u6f14\u7b97\u5b50 uuid COMP uuid \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} JSONB\u578b\u6f14\u7b97\u5b50 jsonb -> KEY KEY \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53d6\u5f97\u3059\u308b} jsonb -> NUM \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7 NUM \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53d6\u5f97\u3059\u308b} jsonb ->> KEY KEY \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30c6\u30ad\u30b9\u30c8\u5024\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b} jsonb ->> NUM \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7 NUM \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30c6\u30ad\u30b9\u30c8\u5024\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b} (jsonb ->> KEY)::TYPE TYPE \u304c int2,int4,int8,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3042\u308b\u5834\u5408\u3001 KEY \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6570\u5024\u578b\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b\u3002\u4e0b\u8a18\u306e\u88dc\u8db3\u3082\u53c2\u7167\u3002} (jsonb ->> NUM)::TYPE TYPE \u304c int2,int4,int8,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3042\u308b\u5834\u5408\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7 NUM \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6570\u5024\u578b\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b\u3002\u4e0b\u8a18\u306e\u88dc\u8db3\u3082\u53c2\u7167\u3002} jsonb ? KEY jsonb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u6307\u5b9a\u3055\u308c\u305f KEY \u3092\u542b\u3080\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b} Note jsonb ->> KEY \u6f14\u7b97\u5b50\u306b\u3088\u3063\u3066\u53d6\u308a\u51fa\u3057\u305f\u6570\u5024\u30c7\u30fc\u30bf\u3092 float \u3084 numeric \u306a\u3069\u6570\u5024\u578b\u306b\u5909\u63db\u3059\u308b\u6642\u3001\u901a\u5e38\u3001PostgreSQL\u306fjsonb\u5185\u90e8\u8868\u73fe\u3092\u30c6\u30ad\u30b9\u30c8\u3068\u3057\u3066\u51fa\u529b\u3057\u3001\u305d\u308c\u3092\u6570\u5024\u8868\u73fe\u306b\u5909\u63db\u3059\u308b\u3068\u3044\u30462\u30b9\u30c6\u30c3\u30d7\u306e\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002 PG-Strom\u306f jsonb ->> KEY \u6f14\u7b97\u5b50\u306b\u3088\u308b\u53c2\u7167\u3068\u30c6\u30ad\u30b9\u30c8\u21d2\u6570\u5024\u8868\u73fe\u3078\u306e\u30ad\u30e3\u30b9\u30c8\u304c\u9023\u7d9a\u3057\u3066\u3044\u308b\u6642\u3001jsonb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089\u6570\u5024\u8868\u73fe\u3092\u53d6\u308a\u51fa\u3059\u305f\u3081\u306e\u7279\u5225\u306a\u30c7\u30d0\u30a4\u30b9\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u3067\u6700\u9069\u5316\u3092\u884c\u3044\u307e\u3059\u3002 PostGIS\u95a2\u6570 geometry st_makepoint(float8,float8) geometry st_point(float8,float8) 2\u6b21\u5143\u5ea7\u6a19\u3092\u542b\u3080POINT\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8fd4\u3059 geometry st_makepoint(float8,float8,float8) 3\u6b21\u5143\u5ea7\u6a19\u3092\u542b\u3080POINT\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8fd4\u3059 geometry st_makepoint(float8,float8,float8,float8) ZM\u5ea7\u6a19\u3092\u542b\u3080POINT\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8fd4\u3059 geometry st_setsrid(geometry,int4) \u30b8\u30aa\u30e1\u30c8\u30ea\u306bSRID\u3092\u8a2d\u5b9a\u3059\u308b float8 st_distance(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u8ddd\u96e2\u3092 float8 \u3067\u8fd4\u3059 bool st_dwithin(geometry,geometry,float8) \u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u8ddd\u96e2\u304c\u6307\u5b9a\u5024\u4ee5\u5185\u306a\u3089\u771f\u3092\u8fd4\u3059\u3002 st_distance \u3068\u6bd4\u8f03\u6f14\u7b97\u5b50\u306e\u7d44\u307f\u5408\u308f\u305b\u3088\u308a\u3082\u9ad8\u901f\u306a\u5834\u5408\u304c\u3042\u308b\u3002 text st_relate(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u4ea4\u5dee\u72b6\u614b\u3092\u5224\u5b9a\u3057\u3001DE9-IM(Dimensionally Extended Nine-Intersection Matrix)\u66f8\u5f0f\u3092\u8fd4\u3059\u3002 bool st_contains(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea1\u304c\u30b8\u30aa\u30e1\u30c8\u30ea2\u3092\u5305\u542b\u3059\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 bool st_crosses(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u304c\u7a7a\u9593\u7684\u306b\u4ea4\u5dee\u3059\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 int4 st_linecrossingdirection(geometry,geometry) 2\u3064\u306eLINESTRING\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u304c\u3069\u306e\u3088\u3046\u306b\u4ea4\u5dee\u3059\u308b\u304b\uff08\u3057\u306a\u3044\u304b\uff09\u3092\u8fd4\u3059\u3002 CUBE\u578b\u95a2\u6570 cube COMP cube \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} bool cube_contains(cube, cube) \u7b2c\u4e00\u5f15\u6570\u306e\u7acb\u4f53\u304c\u7b2c\u4e8c\u5f15\u6570\u306e\u7acb\u4f53\u3092\u5305\u542b\u3057\u3066\u3044\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 bool cube_contained(cube, cube) \u7b2c\u4e00\u5f15\u6570\u306e\u7acb\u4f53\u304c\u7b2c\u4e8c\u5f15\u6570\u306e\u7acb\u4f53\u306b\u5305\u542b\u3055\u308c\u3066\u3044\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 float8 cube_ll_coord(cube, int4) \u7acb\u4f53\u306e\u5de6\u4e0b\u9685\u306en\u6b21\u5ea7\u6a19\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002","title":"\u95a2\u6570\u3068\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#_1","text":"\u672c\u7ae0\u3067\u306fGPU\u30c7\u30d0\u30a4\u30b9\u4e0a\u3067\u5b9f\u884c\u53ef\u80fd\u306a\u95a2\u6570\u3068\u6f14\u7b97\u5b50\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"\u95a2\u6570\u3068\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#_2","text":"bool <-- int4 int1 <-- int2 , int4 , int8 , float2 , float4 , float8 , numeric int2 <-- int1 , int4 , int8 , float2 , float4 , float8 , numeric int4 <-- bool , int1 , int2 , int8 , float2 , float4 , float8 , numeric int8 <-- int1 , int2 , int4 , float2 , float4 , float8 , numeric float2 <-- int1 , int2 , int4 , int8 , float4 , float8 , numeric float4 <-- int1 , int2 , int4 , int8 , float2 , float8 , numeric float8 <-- int1 , int2 , int4 , int8 , float2 , float4 , numeric numeric <-- int1 , int2 , int4 , int8 , float2 , float4 , float8 money <-- int4 , int8 , numeric date <-- timestamp , timestamptz time <-- timetz , timestamp , timestamptz timetz <-- time , timestamptz timestamp <-- date , timestamptz timestamptz <-- date , timestamp","title":"\u578b\u30ad\u30e3\u30b9\u30c8"},{"location":"ref_devfuncs/#_3","text":"bool COMP bool \u8ad6\u7406\u5024\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT COMP INT \u6574\u6570\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6574\u6570\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} FP COMP FP \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 FP \u306f float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} numeric COMP numeric \u5b9f\u6570\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT OP INT \u6574\u6570\u578b\u306e\u7b97\u8853\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6574\u6570\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 OP \u306f +,-,*,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} FP OP FP \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306e\u7b97\u8853\u6f14\u7b97\u5b50\u3002 FP \u306f float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3001\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7570\u306a\u308b\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3042\u3063\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002 COMP \u306f +,-,*,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} numeric OP numeric \u5b9f\u6570\u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 OP \u306f +,-,*,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT % INT \u5270\u4f59\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT & INT \u8ad6\u7406\u7a4d\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT | INT \u8ad6\u7406\u548c\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT # INT \u6392\u4ed6\u7684\u8ad6\u7406\u548c\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} ~ INT \u8ad6\u7406\u5426\u5b9a\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT >> int4 \u53f3\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} INT << int4 \u5de6\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50\u3002 INT \u306f int1,int2,int4,int8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} + TYPE \u5358\u9805\u30d7\u30e9\u30b9\u6f14\u7b97\u5b50\u3002 TYPE \u306f int1,int2,int4,int8,float2,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} - TYPE \u5358\u9805\u30de\u30a4\u30ca\u30b9\u6f14\u7b97\u5b50\u3002 TYPE \u306f int1,int2,int4,int8,float2,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} @ TYPE \u7d76\u5bfe\u5024\u3002 TYPE \u306f int1,int2,int4,int8,float2,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002}","title":"\u6570\u5024\u578b\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#_4","text":"float8 cbrt(float8) float8 dcbrt(float8) \u7acb\u65b9\u6839 float8 ceil(float8) float8 ceiling(float8) \u5f15\u6570\u3088\u308a\u5927\u304d\u3044\u304b\u7b49\u3057\u304f\u3001\u5f15\u6570\u306b\u6700\u3082\u8fd1\u3044\u6574\u6570 float8 exp(float8) float8 dexp(float8) \u6307\u6570\uff08e\u3092\u5e95\u3068\u3059\u308b\u6307\u5b9a\u306e\u3079\u304d\u4e57\uff09 float8 floor(float8) \u5f15\u6570\u3088\u308a\u5c0f\u3055\u3044\u304b\u7b49\u3057\u304f\u3001\u5f15\u6570\u306b\u6700\u3082\u8fd1\u3044\u6574\u6570 float8 ln(float8) float8 dlog1(float8) \u81ea\u7136\u5bfe\u6570 float8 log(float8) float8 dlog10(float8) 10\u3092\u5e95\u3068\u3057\u305f\u5bfe\u6570 float8 pi() \u5186\u5468\u7387 float8 power(float8,float8) float8 pow(float8,float8) float8 dpow(float8,float8) \u3079\u304d\u4e57 float8 round(float8) float8 dround(float8) \u6700\u3082\u8fd1\u3044\u6574\u6570\u3078\u306e\u4e38\u3081 float8 sign(float8) \u7b26\u53f7 float8 sqrt(float8) float8 dsqrt(float8) \u5e73\u65b9\u6839 float8 trunc(float8) float8 dtrunc(float8) \u6574\u6570\u3078\u306e\u5207\u6368\u3066","title":"\u6570\u5b66\u95a2\u6570"},{"location":"ref_devfuncs/#_5","text":"float8 degrees(float8) \u30e9\u30b8\u30a2\u30f3\u306b\u5bfe\u5fdc\u3059\u308b\u5ea6} float8 radians(float8) \u5ea6\u306b\u5bfe\u5fdc\u3059\u308b\u30e9\u30b8\u30a2\u30f3} float8 acos(float8) \u9006\u4f59\u5f26\u95a2\u6570} float8 asin(float8) \u9006\u6b63\u5f26\u95a2\u6570} float8 atan(float8) \u9006\u6b63\u63a5\u95a2\u6570} float8 atan2(float8,float8) arg1 / arg2 \u306e\u9006\u6b63\u63a5\u95a2\u6570} float8 cos(float8) \u4f59\u5f26\u95a2\u6570} float8 cot(float8) \u4f59\u63a5\u95a2\u6570} float8 sin(float8) \u6b63\u5f26\u95a2\u6570} float8 tan(float8) \u6b63\u63a5\u95a2\u6570}","title":"\u4e09\u89d2\u95a2\u6570"},{"location":"ref_devfuncs/#_6","text":"date COMP date date \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} date COMP timestamp timestamp COMP date date \u578b\u3068 timestamp \u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} date COMP timestamptz timestamptz COMP date date \u578b\u3068 timestamptz \u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} time COMP time time \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timetz COMP timetz timetz \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timestamp COMP timestamp timestamp \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timestamptz COMP timestamptz timestamptz \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} timestamp COMP timestamptz timestamptz COMP timestamp timestamp \u578b\u3068 timestamptz \u578b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} interval COMP interval interval \u578b\u540c\u58eb\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3002} date + int4 int4 + date date \u578b\u306e\u52a0\u7b97\u6f14\u7b97\u5b50} date - int4 date \u578b\u306e\u6e1b\u7b97\u6f14\u7b97\u5b50} date - date date \u578b\u540c\u58eb\u306e\u5dee\u5206} date + time time + date date \u3068 time \u304b\u3089 timestamp \u3092\u751f\u6210\u3057\u307e\u3059} date + timetz date \u3068 timetz \u304b\u3089 timestamptz \u3092\u751f\u6210\u3057\u307e\u3059} time - time time \u578b\u540c\u58eb\u306e\u5dee\u5206} timestamp - timestamp timestamp \u578b\u540c\u58eb\u306e\u5dee\u5206} timetz + interval timetz - interval timetz \u3068 interval \u3092\u52a0\u7b97\u3001\u307e\u305f\u306f\u6e1b\u7b97\u3057\u307e\u3059\u3002} timestamptz + interval timestamptz - interval timestamptz \u3068 interval \u3092\u52a0\u7b97\u3001\u307e\u305f\u306f\u6e1b\u7b97\u3057\u307e\u3059\u3002} overlaps(TYPE,TYPE,TYPE,TYPE) 2\u3064\u306e\u6642\u9593\u9593\u9694\u304c\u91cd\u306a\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002 TYPE \u306f time,timetz,timestamp,timestamptz \u306e\u3044\u305a\u308c\u304b\u4e00\u3064\u3067\u3059\u3002} extract(text FROM TYPE) day \u3084 hour \u306a\u3069\u65e5\u4ed8\u6642\u523b\u578b\u306e\u90e8\u5206\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u62bd\u51fa\u3002 TYPE \u306f time,timetz,timestamp,timestamptz,interval \u306e\u3044\u305a\u308c\u304b\u4e00\u3064\u3067\u3059\u3002} now() \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u73fe\u5728\u6642\u523b} - interval interval \u578b\u306e\u5358\u9805\u30de\u30a4\u30ca\u30b9\u6f14\u7b97\u5b50} interval + interval interval \u578b\u306e\u52a0\u7b97\u6f14\u7b97\u5b50} interval - interval interval \u578b\u306e\u6e1b\u7b97\u6f14\u7b97\u5b50}","title":"\u65e5\u4ed8/\u6642\u523b\u578b\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#_7","text":"{text,bpchar} COMP {text,bpchar} \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002 \u306a\u304a\u3001 <,<=,>=,> \u6f14\u7b97\u5b50\u306f\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u304cUTF-8\u307e\u305f\u306fC(\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u306a\u3057)\u306e\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u3067\u3059\u3002} substring(text,int4) substring(text,int4,int4) substr(text,int4) substr(text,int4,int4) \u90e8\u5206\u6587\u5b57\u5217\u306e\u5207\u308a\u51fa\u3057} length({text,bpchar}) \u6587\u5b57\u5217\u9577} {text,bpchar} [NOT] LIKE text LIKE\u8868\u73fe\u3092\u7528\u3044\u305f\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0} {text,bpchar} [NOT] ILIKE text LIKE\u8868\u73fe\u3092\u7528\u3044\u305f\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3002 \u306a\u304a\u3001 ILIKE \u6f14\u7b97\u5b50\u306f\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u304cUTF-8\u307e\u305f\u306fC(\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u306a\u3057)\u306e\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u3067\u3059\u3002}","title":"\u6587\u5b57\u5217\u95a2\u6570/\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#_8","text":"macaddr COMP macaddr \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} macaddr & macaddr \u30d3\u30c3\u30c8\u7a4d\u6f14\u7b97\u5b50} macaddr | macaddr \u30d3\u30c3\u30c8\u548c\u6f14\u7b97\u5b50} ~ macaddr \u30d3\u30c3\u30c8\u5426\u5b9a\u6f14\u7b97\u5b50} trunc(macaddr) \u672b\u5c3e\u306e3\u30d0\u30a4\u30c8\u3092\u30bc\u30ed\u306b\u8a2d\u5b9a\u3059\u308b} inet COMP inet \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} inet << inet \u5de6\u8fba\u306f\u53f3\u8fba\u306b\u5185\u5305\u3055\u308c\u308b\u3002} inet <<= inet \u5de6\u8fba\u306f\u53f3\u8fba\u306b\u5185\u5305\u3055\u308c\u308b\u304b\u7b49\u3057\u3044\u3002} inet >> inet \u5de6\u8fba\u306f\u53f3\u8fba\u3092\u5185\u5305\u3059\u308b\u3002} inet >>= inet \u5de6\u8fba\u306f\u53f3\u8fba\u3092\u5185\u5305\u3059\u308b\u304b\u7b49\u3057\u3044\u3002} inet && inet \u5de6\u8fba\u306f\u53f3\u8fba\u3092\u5185\u5305\u3059\u308b\u304b\u5185\u5305\u3055\u308c\u308b} ~ inet \u30d3\u30c3\u30c8\u5426\u5b9a\u6f14\u7b97\u5b50} inet & inet \u30d3\u30c3\u30c8\u7a4d\u6f14\u7b97\u5b50} inet | inet \u30d3\u30c3\u30c8\u548c\u6f14\u7b97\u5b50} inet + int8 \u52a0\u7b97\u6f14\u7b97\u5b50} inet - int8 \u6e1b\u7b97\u6f14\u7b97\u5b50} inet - inet \u6e1b\u7b97\u6f14\u7b97\u5b50} broadcast(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8\u30a2\u30c9\u30ec\u30b9\u3092\u8fd4\u3059} family(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30a2\u30c9\u30ec\u30b9\u30d5\u30a1\u30df\u30ea\u3092\u8fd4\u3059\u3002IPv4\u306e\u5834\u5408\u306f 4 \u3001IPv6\u306e\u5834\u5408\u306f 6 } hostmask(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30db\u30b9\u30c8\u30de\u30b9\u30af\u3092\u8fd4\u3059} masklen(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30de\u30b9\u30af\u9577\u3092\u8fd4\u3059} netmask(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30cd\u30c3\u30c8\u30de\u30b9\u30af\u3092\u8fd4\u3059} network(inet) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u90e8\u3092\u8fd4\u3059} set_masklen(NETADDR,int) \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u306e\u30cd\u30c3\u30c8\u30de\u30b9\u30af\u9577\u3092\u8a2d\u5b9a\u3059\u308b\u3002 NETADDR \u306f inet \u304b cidr \u306e\u3069\u3061\u3089\u304b\u3002} inet_merge(inet,inet) \u4e21\u65b9\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u542b\u3080\u6700\u5c0f\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u8fd4\u3059}","title":"\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u95a2\u6570/\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#_9","text":"money COMP money \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money OP money \u7b97\u8853\u6f14\u7b97\u5b50\u3002 OP \u306f +,-,/ \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money * TYPE TYPE * money \u901a\u8ca8\u578b\u3068\u6570\u5024\u578b\u306e\u4e57\u7b97\u3002 TYPE \u306f int1,int2,int4,float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money / TYPE \u901a\u8ca8\u578b\u306e\u6570\u5024\u578b\u306b\u3088\u308b\u9664\u7b97\u3002 TYPE \u306f int1,int2,int4,float2,float4,float8 \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} money / money \u901a\u8ca8\u578b\u540c\u58eb\u306e\u9664\u7b97\u3002}","title":"\u901a\u8ca8\u578b\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#uuid","text":"uuid COMP uuid \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002}","title":"uuid\u578b\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#jsonb","text":"jsonb -> KEY KEY \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53d6\u5f97\u3059\u308b} jsonb -> NUM \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7 NUM \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53d6\u5f97\u3059\u308b} jsonb ->> KEY KEY \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30c6\u30ad\u30b9\u30c8\u5024\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b} jsonb ->> NUM \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7 NUM \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30c6\u30ad\u30b9\u30c8\u5024\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b} (jsonb ->> KEY)::TYPE TYPE \u304c int2,int4,int8,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3042\u308b\u5834\u5408\u3001 KEY \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6570\u5024\u578b\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b\u3002\u4e0b\u8a18\u306e\u88dc\u8db3\u3082\u53c2\u7167\u3002} (jsonb ->> NUM)::TYPE TYPE \u304c int2,int4,int8,float4,float8,numeric \u306e\u3044\u305a\u308c\u304b\u3067\u3042\u308b\u5834\u5408\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7 NUM \u3067\u6307\u5b9a\u3055\u308c\u305fJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6570\u5024\u578b\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b\u3002\u4e0b\u8a18\u306e\u88dc\u8db3\u3082\u53c2\u7167\u3002} jsonb ? KEY jsonb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u6307\u5b9a\u3055\u308c\u305f KEY \u3092\u542b\u3080\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b} Note jsonb ->> KEY \u6f14\u7b97\u5b50\u306b\u3088\u3063\u3066\u53d6\u308a\u51fa\u3057\u305f\u6570\u5024\u30c7\u30fc\u30bf\u3092 float \u3084 numeric \u306a\u3069\u6570\u5024\u578b\u306b\u5909\u63db\u3059\u308b\u6642\u3001\u901a\u5e38\u3001PostgreSQL\u306fjsonb\u5185\u90e8\u8868\u73fe\u3092\u30c6\u30ad\u30b9\u30c8\u3068\u3057\u3066\u51fa\u529b\u3057\u3001\u305d\u308c\u3092\u6570\u5024\u8868\u73fe\u306b\u5909\u63db\u3059\u308b\u3068\u3044\u30462\u30b9\u30c6\u30c3\u30d7\u306e\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002 PG-Strom\u306f jsonb ->> KEY \u6f14\u7b97\u5b50\u306b\u3088\u308b\u53c2\u7167\u3068\u30c6\u30ad\u30b9\u30c8\u21d2\u6570\u5024\u8868\u73fe\u3078\u306e\u30ad\u30e3\u30b9\u30c8\u304c\u9023\u7d9a\u3057\u3066\u3044\u308b\u6642\u3001jsonb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089\u6570\u5024\u8868\u73fe\u3092\u53d6\u308a\u51fa\u3059\u305f\u3081\u306e\u7279\u5225\u306a\u30c7\u30d0\u30a4\u30b9\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u3067\u6700\u9069\u5316\u3092\u884c\u3044\u307e\u3059\u3002","title":"JSONB\u578b\u6f14\u7b97\u5b50"},{"location":"ref_devfuncs/#postgis","text":"geometry st_makepoint(float8,float8) geometry st_point(float8,float8) 2\u6b21\u5143\u5ea7\u6a19\u3092\u542b\u3080POINT\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8fd4\u3059 geometry st_makepoint(float8,float8,float8) 3\u6b21\u5143\u5ea7\u6a19\u3092\u542b\u3080POINT\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8fd4\u3059 geometry st_makepoint(float8,float8,float8,float8) ZM\u5ea7\u6a19\u3092\u542b\u3080POINT\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u3092\u8fd4\u3059 geometry st_setsrid(geometry,int4) \u30b8\u30aa\u30e1\u30c8\u30ea\u306bSRID\u3092\u8a2d\u5b9a\u3059\u308b float8 st_distance(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u8ddd\u96e2\u3092 float8 \u3067\u8fd4\u3059 bool st_dwithin(geometry,geometry,float8) \u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u8ddd\u96e2\u304c\u6307\u5b9a\u5024\u4ee5\u5185\u306a\u3089\u771f\u3092\u8fd4\u3059\u3002 st_distance \u3068\u6bd4\u8f03\u6f14\u7b97\u5b50\u306e\u7d44\u307f\u5408\u308f\u305b\u3088\u308a\u3082\u9ad8\u901f\u306a\u5834\u5408\u304c\u3042\u308b\u3002 text st_relate(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u9593\u306e\u4ea4\u5dee\u72b6\u614b\u3092\u5224\u5b9a\u3057\u3001DE9-IM(Dimensionally Extended Nine-Intersection Matrix)\u66f8\u5f0f\u3092\u8fd4\u3059\u3002 bool st_contains(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea1\u304c\u30b8\u30aa\u30e1\u30c8\u30ea2\u3092\u5305\u542b\u3059\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 bool st_crosses(geometry,geometry) \u30b8\u30aa\u30e1\u30c8\u30ea\u540c\u58eb\u304c\u7a7a\u9593\u7684\u306b\u4ea4\u5dee\u3059\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 int4 st_linecrossingdirection(geometry,geometry) 2\u3064\u306eLINESTRING\u578b\u30b8\u30aa\u30e1\u30c8\u30ea\u304c\u3069\u306e\u3088\u3046\u306b\u4ea4\u5dee\u3059\u308b\u304b\uff08\u3057\u306a\u3044\u304b\uff09\u3092\u8fd4\u3059\u3002","title":"PostGIS\u95a2\u6570"},{"location":"ref_devfuncs/#cube","text":"cube COMP cube \u6bd4\u8f03\u6f14\u7b97\u5b50\u3002 COMP \u306f =,<>,<,<=,>=,> \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002} bool cube_contains(cube, cube) \u7b2c\u4e00\u5f15\u6570\u306e\u7acb\u4f53\u304c\u7b2c\u4e8c\u5f15\u6570\u306e\u7acb\u4f53\u3092\u5305\u542b\u3057\u3066\u3044\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 bool cube_contained(cube, cube) \u7b2c\u4e00\u5f15\u6570\u306e\u7acb\u4f53\u304c\u7b2c\u4e8c\u5f15\u6570\u306e\u7acb\u4f53\u306b\u5305\u542b\u3055\u308c\u3066\u3044\u308b\u6642\u3001\u771f\u3092\u8fd4\u3059\u3002 float8 cube_ll_coord(cube, int4) \u7acb\u4f53\u306e\u5de6\u4e0b\u9685\u306en\u6b21\u5ea7\u6a19\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002","title":"CUBE\u578b\u95a2\u6570"},{"location":"ref_params/","text":"GUC\u30d1\u30e9\u30e1\u30fc\u30bf \u672c\u7bc0\u3067\u306fPG-Strom\u306e\u63d0\u4f9b\u3059\u308b\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u6a5f\u80fd\u5358\u4f4d\u306e\u6709\u52b9\u5316/\u7121\u52b9\u5316 pg_strom.enabled [\u578b: bool / \u521d\u671f\u5024: on] PG-Strom\u6a5f\u80fd\u5168\u4f53\u3092\u4e00\u62ec\u3057\u3066\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpuscan [\u578b: bool / \u521d\u671f\u5024: on] GpuScan\u306b\u3088\u308b\u30b9\u30ad\u30e3\u30f3\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpuhashjoin [\u578b: bool / \u521d\u671f\u5024: on] GpuHashJoin\u306b\u3088\u308bJOIN\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpugistindex [\u578b: bool / \u521d\u671f\u5024: on] GpuGiSTIndex\u306b\u3088\u308bJOIN\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpujoin [\u578b: bool / \u521d\u671f\u5024: on] GpuJoin\u306b\u3088\u308bJOIN\u3092\u4e00\u62ec\u3067\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002\uff08GpuHashJoin\u3068GpuGiSTIndex\u3092\u542b\u3080\uff09 pg_strom.enable_gpupreagg [\u578b: bool / \u521d\u671f\u5024: on] GpuPreAgg\u306b\u3088\u308b\u96c6\u7d04\u51e6\u7406\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_numeric_aggfuncs [\u578b: bool / \u521d\u671f\u5024: on] numeric \u30c7\u30fc\u30bf\u578b\u3092\u5f15\u6570\u306b\u53d6\u308b\u96c6\u7d04\u6f14\u7b97\u3092GPU\u3067\u51e6\u7406\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 GPU\u3067\u306e\u96c6\u7d04\u6f14\u7b97\u306b\u304a\u3044\u3066 numeric \u30c7\u30fc\u30bf\u578b\u306f\u500d\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3055\u308c\u308b\u305f\u3081\u3001\u8a08\u7b97\u8aa4\u5dee\u306b\u30bb\u30f3\u30b7\u30c6\u30a3\u30d6\u306a\u7528\u9014\u306e\u5834\u5408\u306f\u3001\u3053\u306e\u8a2d\u5b9a\u5024\u3092 off \u306b\u3057\u3066CPU\u3067\u96c6\u7d04\u6f14\u7b97\u3092\u5b9f\u884c\u3057\u3001\u8a08\u7b97\u8aa4\u5dee\u306e\u767a\u751f\u3092\u6291\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 pg_strom.enable_brin [\u578b: bool / \u521d\u671f\u5024: on] BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u3063\u305f\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.cpu_fallback [\u578b: enum / \u521d\u671f\u5024: notice ] GPU\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\"CPU\u518d\u5b9f\u884c\"\u30a8\u30e9\u30fc\u3092\u8fd4\u3057\u305f\u3068\u304d\u306b\u3001\u5b9f\u969b\u306bCPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u8a66\u307f\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 notice ... \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3057\u305f\u4e0a\u3067CPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u884c\u3046 on , true ... \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u305b\u305aCPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u884c\u3046 off , false ... \u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305bCPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u884c\u308f\u306a\u3044 pg_strom.regression_test_mode [\u578b: bool / \u521d\u671f\u5024: off] GPU\u30e2\u30c7\u30eb\u540d\u306a\u3069\u3001\u5b9f\u884c\u74b0\u5883\u306b\u4f9d\u5b58\u3057\u3066\u8868\u793a\u304c\u5909\u308f\u308b\u53ef\u80fd\u6027\u306e\u3042\u308b EXPLAIN \u30b3\u30de\u30f3\u30c9\u306e\u51fa\u529b\u3092\u6291\u5236\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u306b\u304a\u3051\u308b\u507d\u967d\u6027\u3092\u9632\u3050\u305f\u3081\u306e\u8a2d\u5b9a\u3067\u3001\u901a\u5e38\u306f\u5229\u7528\u8005\u304c\u64cd\u4f5c\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u95a2\u3059\u308b\u8a2d\u5b9a pg_strom.gpu_setup_cost [\u578b: real / \u521d\u671f\u5024: 100 * DEFAULT_SEQ_PAGE_COST ] GPU\u30c7\u30d0\u30a4\u30b9\u306e\u521d\u671f\u5316\u306b\u8981\u3059\u308b\u30b3\u30b9\u30c8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5024\u3002 pg_strom.gpu_tuple_cost [\u578b: real / \u521d\u671f\u5024: DEFAULT_CPU_TUPLE_COST ] GPU\u3078\u9001\u51fa\u3059\u308b\uff0f\u53d7\u3051\u53d6\u308b\u30bf\u30d7\u30eb\u4e00\u500b\u3042\u305f\u308a\u306e\u30b3\u30b9\u30c8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5024\u3002 pg_strom.gpu_operator_cost [\u578b: real / \u521d\u671f\u5024: DEFAULT_CPU_OPERATOR_COST / 16 ] GPU\u306e\u6f14\u7b97\u5f0f\u3042\u305f\u308a\u306e\u51e6\u7406\u30b3\u30b9\u30c8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5024\u3002 cpu_operator_cost \u3088\u308a\u3082\u5927\u304d\u306a\u5024\u3092\u8a2d\u5b9a\u3057\u3066\u3057\u307e\u3046\u3068\u3001\u3044\u304b\u306a\u308b\u30b5\u30a4\u30ba\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u3082PG-Strom\u304c\u9078\u629e\u3055\u308c\u308b\u3053\u3068\u306f\u306a\u304f\u306a\u308b\u3002 pg_strom.enable_partitionwise_gpujoin [\u578b: bool / \u521d\u671f\u5024: on] GpuJoin\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 pg_strom.enable_partitionwise_gpupreagg [\u578b: bool / \u521d\u671f\u5024: on] GpuPreAgg\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 pg_strom.pinned_inner_buffer_threshold [\u578b: int / \u521d\u671f\u5024: 0 ] GpuJoin\u306eINNER\u8868\u304cGpuScan\u307e\u305f\u306fGpuJoin\u3067\u3042\u308b\u5834\u5408\u3001\u51e6\u7406\u7d50\u679c\u306e\u63a8\u5b9a\u30b5\u30a4\u30ba\u304c\u3053\u306e\u8a2d\u5b9a\u5024\u3088\u308a\u3082\u5927\u304d\u3051\u308c\u3070\u3001\u7d50\u679c\u3092\u3044\u3063\u305f\u3093CPU\u306b\u623b\u3059\u3053\u3068\u306a\u304f\u3001\u305d\u306e\u307e\u307eGPU\u5074\u306b\u4fdd\u6301\u3057\u305f\u4e0a\u3067\u3001\u7d9a\u304fGpuJoin\u306eINNER\u30d0\u30c3\u30d5\u30a1\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u3002 \u8a2d\u5b9a\u5024\u304c 0 \u306e\u5834\u5408\u3001\u672c\u6a5f\u80fd\u306f\u7121\u52b9\u3068\u306a\u308b\u3002 \u30a8\u30b0\u30bc\u30ad\u30e5\u30fc\u30bf\u306b\u95a2\u3059\u308b\u8a2d\u5b9a pg_strom.max_async_tasks [\u578b: int / \u521d\u671f\u5024: 12 ] PG-Strom\u304cGPU\u5b9f\u884c\u30ad\u30e5\u30fc\u306b\u6295\u5165\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u975e\u540c\u671f\u30bf\u30b9\u30af\u306eGPU\u30c7\u30d0\u30a4\u30b9\u6bce\u306e\u6700\u5927\u5024\u3067\u3001GPU Service\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u6570\u3067\u3082\u3042\u308a\u307e\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306e\u8a2d\u5b9a pg_strom.gpudirect_driver [\u578b: text ] GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306e\u30c9\u30e9\u30a4\u30d0\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u540d\u3092\u793a\u3059\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3059\u3002 cufile \u3001 nvme-strom \u3001\u3082\u3057\u304f\u306f vfs \u306e\u3069\u308c\u304b\u3067\u3059\u3002 pg_strom.gpudirect_enabled [\u578b: bool / \u521d\u671f\u5024: on ] GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.gpu_direct_seq_page_cost [\u578b: real / \u521d\u671f\u5024: DEFAULT_SEQ_PAGE_COST / 4 ] \u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u304c\u5b9f\u884c\u30d7\u30e9\u30f3\u306e\u30b3\u30b9\u30c8\u3092\u8a08\u7b97\u3059\u308b\u969b\u306b\u3001GPU-Direct SQL\u3092\u7528\u3044\u3066\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u5834\u5408\u306e\u30b3\u30b9\u30c8\u3068\u3057\u3066 seq_page_cost \u306e\u4ee3\u308f\u308a\u306b\u4f7f\u7528\u3055\u308c\u308b\u5024\u3002 pg_strom.gpudirect_threshold [\u578b: int / \u521d\u671f\u5024: \u81ea\u52d5] GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u3092\u767a\u52d5\u3055\u305b\u308b\u30c6\u30fc\u30d6\u30eb\u30b5\u30a4\u30ba\u306e\u95be\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u3002 \u521d\u671f\u5024\u306f\u81ea\u52d5\u8a2d\u5b9a\u3067\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u7269\u7406\u30e1\u30e2\u30ea\u3068 shared_buffers \u8a2d\u5b9a\u5024\u304b\u3089\u8a08\u7b97\u3057\u305f\u95be\u5024\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 pg_strom.manual_optimal_gpus [\u578b: text / \u521d\u671f\u5024: \u306a\u3057] NVME\u30c7\u30d0\u30a4\u30b9\u3084NFS\u533a\u753b\u306a\u3069\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u533a\u753b\u3054\u3068\u306b\u6700\u3082\u8fd1\u508d\u3068\u5224\u5b9a\u3055\u308c\u308bGPU\u3092\u624b\u52d5\u3067\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u66f8\u5f0f\u306f {|/path/to/tablespace}=gpuX[:gpuX...] \u3067\u3001NVME\u30c7\u30d0\u30a4\u30b9\u307e\u305f\u306f\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306e\u30d1\u30b9\u3068\u3001\u305d\u306e\u8fd1\u508d\u3067\u3042\u308bGPU\uff08\u8907\u6570\u53ef\uff09\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002\u30ab\u30f3\u30de\u3067\u533a\u5207\u3063\u3066\u8907\u6570\u306e\u8a2d\u5b9a\u3092\u8a18\u8ff0\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002 \u4f8b: pg_strom.manual_optimal_gpus = 'nvme1=gpu0,nvme2=gpu1,/mnt/nfsroot=gpu0' \u306f\u30c7\u30d0\u30a4\u30b9\u756a\u53f7X\u3092\u6301\u3064GPU\u3067\u3059\u3002 \u306f\u30ed\u30fc\u30ab\u30eb\u306eNVME-SSD\u307e\u305f\u306f\u30ea\u30e2\u30fc\u30c8\u306eNVME-oF\u30c7\u30d0\u30a4\u30b9\u3092\u610f\u5473\u3057\u307e\u3059\u3002 /path/to/tablespace \u306f\u3001\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306b\u7d10\u3065\u3044\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d5\u30eb\u30d1\u30b9\u3067\u3059\u3002 \u30ed\u30fc\u30ab\u30eb\u306eNVME-SSD\u306b\u5bfe\u3057\u3066\u306f\u591a\u304f\u306e\u5834\u5408\u81ea\u52d5\u8a2d\u5b9a\u3067\u5341\u5206\u3067\u3059\u304c\u3001NVME-oF\u30c7\u30d0\u30a4\u30b9\u3084NFS-over-RDMA\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u6a5f\u68b0\u7684\u306b\u8fd1\u508d\u306eGPU\u3092\u7279\u5b9a\u3059\u308b\u4e8b\u304c\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u624b\u52d5\u3067\u8fd1\u508d\u306eGPU\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 Arrow_Fdw\u95a2\u9023\u306e\u8a2d\u5b9a arrow_fdw.enabled [\u578b: bool / \u521d\u671f\u5024: on ] \u63a8\u5b9a\u30b3\u30b9\u30c8\u5024\u3092\u8abf\u6574\u3057\u3001Arrow_Fdw\u306e\u6709\u52b9/\u7121\u52b9\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002\u305f\u3060\u3057\u3001GpuScan\u304c\u5229\u7528\u3067\u304d\u306a\u3044\u5834\u5408\u306b\u306f\u3001Arrow_Fdw\u306b\u3088\u308bForeign Scan\u3060\u3051\u304cArrow\u30d5\u30a1\u30a4\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3067\u304d\u308b\u3068\u3044\u3046\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 arrow_fdw.stats_hint_enabled [\u578b: bool / \u521d\u671f\u5024: on ] Arrow\u30d5\u30a1\u30a4\u30eb\u304cmin/max\u7d71\u8a08\u60c5\u5831\u3092\u6301\u3063\u3066\u304a\u308a\u3001\u305d\u308c\u3092\u7528\u3044\u3066\u4e0d\u5fc5\u8981\u306arecord-batch\u3092\u8aad\u307f\u98db\u3070\u3059\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 arrow_fdw.metadata_cache_size [\u578b: int / \u521d\u671f\u5024: 512MB ] Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30e1\u30bf\u60c5\u5831\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u5171\u6709\u30e1\u30e2\u30ea\u9818\u57df\u306e\u5927\u304d\u3055\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u5171\u6709\u30e1\u30e2\u30ea\u306e\u6d88\u8cbb\u91cf\u304c\u3053\u306e\u30b5\u30a4\u30ba\u3092\u8d8a\u3048\u308b\u3068\u3001\u53e4\u3044\u30e1\u30bf\u60c5\u5831\u304b\u3089\u9806\u306b\u89e3\u653e\u3055\u308c\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u8a2d\u5b9a pg_strom.enable_gpucache [\u578b: bool / \u521d\u671f\u5024: on ] \u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 \u306a\u304a\u3001\u3053\u306e\u8a2d\u5b9a\u5024\u3092 off \u306b\u3057\u3066\u3082\u30c8\u30ea\u30ac\u95a2\u6570\u306f\u5f15\u304d\u7d9a\u304dREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u66f4\u65b0\u3057\u7d9a\u3051\u307e\u3059\u3002 pg_strom.gpucache_auto_preload [\u578b: text / \u521d\u671f\u5024: null ] PostgreSQL\u306e\u8d77\u52d5\u76f4\u5f8c\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30ed\u30fc\u30c9\u3059\u3079\u304d\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u66f8\u5f0f\u306f DATABASE_NAME.SCHEMA_NAME.TABLE_NAME \u3067\u3001\u8907\u6570\u500b\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3053\u308c\u3092\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u4e26\u3079\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u521d\u56de\u30ed\u30fc\u30c9\u306f\u76f8\u5fdc\u306b\u6642\u9593\u306e\u304b\u304b\u308b\u51e6\u7406\u3067\u3059\u304c\u3001\u4e8b\u524d\u306b\u521d\u56de\u30ed\u30fc\u30c9\u3092\u6e08\u307e\u305b\u3066\u304a\u304f\u4e8b\u3067\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u521d\u56de\u5b9f\u884c\u6642\u306b\u5fdc\u7b54\u901f\u5ea6\u304c\u9045\u5ef6\u3059\u308b\u306e\u3092\u907f\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u306a\u304a\u3001\u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u3092 '*' \u306b\u8a2d\u5b9a\u3059\u308b\u3068\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6301\u3064\u5168\u3066\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092\u9806\u306bGPU\u3078\u30ed\u30fc\u30c9\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u306b\u95a2\u9023\u3059\u308b\u8a2d\u5b9a pg_strom.gpu_mempool_segment_sz [\u578b: int / \u521d\u671f\u5024: 1GB ] GPU Service\u304c\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u7528\u306bGPU\u30e1\u30e2\u30ea\u3092\u78ba\u4fdd\u3059\u308b\u969b\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u30b5\u30a4\u30ba\u3067\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5f53\u3066\u306f\u6bd4\u8f03\u7684\u30d8\u30d3\u30fc\u306a\u51e6\u7406\u3067\u3042\u308b\u305f\u3081\u3001\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30e1\u30e2\u30ea\u3092\u4f7f\u3044\u56de\u3059\u4e8b\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u3002 pg_strom.gpu_mempool_max_ratio [\u578b: real / \u521d\u671f\u5024: 50% ] GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u7528\u306b\u4f7f\u7528\u3059\u308b\u4e8b\u306e\u3067\u304d\u308b\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5408\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u306b\u3088\u308b\u904e\u5270\u306aGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u6d88\u8cbb\u3092\u6291\u5236\u3057\u3001\u30ef\u30fc\u30ad\u30f3\u30b0\u30e1\u30e2\u30ea\u3092\u5341\u5206\u306b\u78ba\u4fdd\u3059\u308b\u4e8b\u304c\u76ee\u7684\u3067\u3059\u3002 pg_strom.gpu_mempool_min_ratio [\u578b: real / \u521d\u671f\u5024: 5% ] \u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u306b\u78ba\u4fdd\u3057\u305fGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u3046\u3061\u3001\u5229\u7528\u7d42\u4e86\u5f8c\u3082\u89e3\u653e\u305b\u305a\u306b\u78ba\u4fdd\u3057\u305f\u307e\u307e\u306b\u3057\u3066\u304a\u304f\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5408\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u6700\u5c0f\u9650\u5ea6\u306e\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u3092\u4fdd\u6301\u3057\u3066\u304a\u304f\u3053\u3068\u306b\u3088\u308a\u3001\u6b21\u306e\u30af\u30a8\u30ea\u3092\u901f\u3084\u304b\u306b\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 pg_strom.gpu_mempool_release_delay [\u578b: int / \u521d\u671f\u5024: 5000 ] GPU Service\u306f\u3001\u3042\u308b\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u4e0a\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u304c\u7a7a\u306b\u306a\u3063\u3066\u3082\u3001\u3053\u308c\u3092\u76f4\u3061\u306b\u958b\u653e\u3057\u307e\u305b\u3093\u3002\u305d\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u304c\u6700\u5f8c\u306b\u5229\u7528\u3055\u308c\u3066\u304b\u3089\u3001\u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u6307\u5b9a\u3055\u308c\u305f\u6642\u9593\uff08\u30df\u30ea\u79d2\u5358\u4f4d\uff09\u3092\u7d4c\u904e\u3059\u308b\u3068\u3001\u3053\u308c\u3092\u958b\u653e\u3057\u3066\u30b7\u30b9\u30c6\u30e0\u306b\u8fd4\u5374\u3057\u307e\u3059\u3002 \u4e00\u5b9a\u306e\u9045\u5ef6\u3092\u631f\u3080\u4e8b\u3067\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5f53/\u89e3\u653e\u306e\u983b\u5ea6\u3092\u6e1b\u3089\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 pg_strom.gpuserv_debug_output [\u578b: bool / \u521d\u671f\u5024: false ] GPU Service\u306e\u30c7\u30d0\u30c3\u30b0\u30e1\u30c3\u30bb\u30fc\u30b8\u51fa\u529b\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3057\u307e\u3059\u3002\u3053\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u30c7\u30d0\u30c3\u30b0\u306b\u304a\u3044\u3066\u6709\u52b9\u3067\u3042\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u901a\u5e38\u306f\u521d\u671f\u5024\u306e\u307e\u307e\u5909\u66f4\u3057\u306a\u3044\u3067\u4e0b\u3055\u3044\u3002 pg_strom.cuda_visible_devices [\u578b: text / \u521d\u671f\u5024: null ] PostgreSQL\u306e\u8d77\u52d5\u6642\u306b\u7279\u5b9a\u306eGPU\u30c7\u30d0\u30a4\u30b9\u3060\u3051\u3092\u8a8d\u8b58\u3055\u305b\u3066\u3044\u5834\u5408\u306f\u3001\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067GPU\u30c7\u30d0\u30a4\u30b9\u756a\u53f7\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u74b0\u5883\u5909\u6570 CUDA_VISIBLE_DEVICES \u3092\u8a2d\u5b9a\u3059\u308b\u306e\u3068\u540c\u7b49\u3067\u3059\u3002","title":"GUC\u30d1\u30e9\u30e1\u30fc\u30bf"},{"location":"ref_params/#guc","text":"\u672c\u7bc0\u3067\u306fPG-Strom\u306e\u63d0\u4f9b\u3059\u308b\u8a2d\u5b9a\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"GUC\u30d1\u30e9\u30e1\u30fc\u30bf"},{"location":"ref_params/#_1","text":"pg_strom.enabled [\u578b: bool / \u521d\u671f\u5024: on] PG-Strom\u6a5f\u80fd\u5168\u4f53\u3092\u4e00\u62ec\u3057\u3066\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpuscan [\u578b: bool / \u521d\u671f\u5024: on] GpuScan\u306b\u3088\u308b\u30b9\u30ad\u30e3\u30f3\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpuhashjoin [\u578b: bool / \u521d\u671f\u5024: on] GpuHashJoin\u306b\u3088\u308bJOIN\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpugistindex [\u578b: bool / \u521d\u671f\u5024: on] GpuGiSTIndex\u306b\u3088\u308bJOIN\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_gpujoin [\u578b: bool / \u521d\u671f\u5024: on] GpuJoin\u306b\u3088\u308bJOIN\u3092\u4e00\u62ec\u3067\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002\uff08GpuHashJoin\u3068GpuGiSTIndex\u3092\u542b\u3080\uff09 pg_strom.enable_gpupreagg [\u578b: bool / \u521d\u671f\u5024: on] GpuPreAgg\u306b\u3088\u308b\u96c6\u7d04\u51e6\u7406\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.enable_numeric_aggfuncs [\u578b: bool / \u521d\u671f\u5024: on] numeric \u30c7\u30fc\u30bf\u578b\u3092\u5f15\u6570\u306b\u53d6\u308b\u96c6\u7d04\u6f14\u7b97\u3092GPU\u3067\u51e6\u7406\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 GPU\u3067\u306e\u96c6\u7d04\u6f14\u7b97\u306b\u304a\u3044\u3066 numeric \u30c7\u30fc\u30bf\u578b\u306f\u500d\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3055\u308c\u308b\u305f\u3081\u3001\u8a08\u7b97\u8aa4\u5dee\u306b\u30bb\u30f3\u30b7\u30c6\u30a3\u30d6\u306a\u7528\u9014\u306e\u5834\u5408\u306f\u3001\u3053\u306e\u8a2d\u5b9a\u5024\u3092 off \u306b\u3057\u3066CPU\u3067\u96c6\u7d04\u6f14\u7b97\u3092\u5b9f\u884c\u3057\u3001\u8a08\u7b97\u8aa4\u5dee\u306e\u767a\u751f\u3092\u6291\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 pg_strom.enable_brin [\u578b: bool / \u521d\u671f\u5024: on] BRIN\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u3063\u305f\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.cpu_fallback [\u578b: enum / \u521d\u671f\u5024: notice ] GPU\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\"CPU\u518d\u5b9f\u884c\"\u30a8\u30e9\u30fc\u3092\u8fd4\u3057\u305f\u3068\u304d\u306b\u3001\u5b9f\u969b\u306bCPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u8a66\u307f\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 notice ... \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3057\u305f\u4e0a\u3067CPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u884c\u3046 on , true ... \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u305b\u305aCPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u884c\u3046 off , false ... \u30a8\u30e9\u30fc\u3092\u767a\u751f\u3055\u305bCPU\u3067\u306e\u518d\u5b9f\u884c\u3092\u884c\u308f\u306a\u3044 pg_strom.regression_test_mode [\u578b: bool / \u521d\u671f\u5024: off] GPU\u30e2\u30c7\u30eb\u540d\u306a\u3069\u3001\u5b9f\u884c\u74b0\u5883\u306b\u4f9d\u5b58\u3057\u3066\u8868\u793a\u304c\u5909\u308f\u308b\u53ef\u80fd\u6027\u306e\u3042\u308b EXPLAIN \u30b3\u30de\u30f3\u30c9\u306e\u51fa\u529b\u3092\u6291\u5236\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u306b\u304a\u3051\u308b\u507d\u967d\u6027\u3092\u9632\u3050\u305f\u3081\u306e\u8a2d\u5b9a\u3067\u3001\u901a\u5e38\u306f\u5229\u7528\u8005\u304c\u64cd\u4f5c\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002","title":"\u6a5f\u80fd\u5358\u4f4d\u306e\u6709\u52b9\u5316/\u7121\u52b9\u5316"},{"location":"ref_params/#_2","text":"pg_strom.gpu_setup_cost [\u578b: real / \u521d\u671f\u5024: 100 * DEFAULT_SEQ_PAGE_COST ] GPU\u30c7\u30d0\u30a4\u30b9\u306e\u521d\u671f\u5316\u306b\u8981\u3059\u308b\u30b3\u30b9\u30c8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5024\u3002 pg_strom.gpu_tuple_cost [\u578b: real / \u521d\u671f\u5024: DEFAULT_CPU_TUPLE_COST ] GPU\u3078\u9001\u51fa\u3059\u308b\uff0f\u53d7\u3051\u53d6\u308b\u30bf\u30d7\u30eb\u4e00\u500b\u3042\u305f\u308a\u306e\u30b3\u30b9\u30c8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5024\u3002 pg_strom.gpu_operator_cost [\u578b: real / \u521d\u671f\u5024: DEFAULT_CPU_OPERATOR_COST / 16 ] GPU\u306e\u6f14\u7b97\u5f0f\u3042\u305f\u308a\u306e\u51e6\u7406\u30b3\u30b9\u30c8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u5024\u3002 cpu_operator_cost \u3088\u308a\u3082\u5927\u304d\u306a\u5024\u3092\u8a2d\u5b9a\u3057\u3066\u3057\u307e\u3046\u3068\u3001\u3044\u304b\u306a\u308b\u30b5\u30a4\u30ba\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u3082PG-Strom\u304c\u9078\u629e\u3055\u308c\u308b\u3053\u3068\u306f\u306a\u304f\u306a\u308b\u3002 pg_strom.enable_partitionwise_gpujoin [\u578b: bool / \u521d\u671f\u5024: on] GpuJoin\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 pg_strom.enable_partitionwise_gpupreagg [\u578b: bool / \u521d\u671f\u5024: on] GpuPreAgg\u3092\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u3078\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3059\u308b\u3002 pg_strom.pinned_inner_buffer_threshold [\u578b: int / \u521d\u671f\u5024: 0 ] GpuJoin\u306eINNER\u8868\u304cGpuScan\u307e\u305f\u306fGpuJoin\u3067\u3042\u308b\u5834\u5408\u3001\u51e6\u7406\u7d50\u679c\u306e\u63a8\u5b9a\u30b5\u30a4\u30ba\u304c\u3053\u306e\u8a2d\u5b9a\u5024\u3088\u308a\u3082\u5927\u304d\u3051\u308c\u3070\u3001\u7d50\u679c\u3092\u3044\u3063\u305f\u3093CPU\u306b\u623b\u3059\u3053\u3068\u306a\u304f\u3001\u305d\u306e\u307e\u307eGPU\u5074\u306b\u4fdd\u6301\u3057\u305f\u4e0a\u3067\u3001\u7d9a\u304fGpuJoin\u306eINNER\u30d0\u30c3\u30d5\u30a1\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u3002 \u8a2d\u5b9a\u5024\u304c 0 \u306e\u5834\u5408\u3001\u672c\u6a5f\u80fd\u306f\u7121\u52b9\u3068\u306a\u308b\u3002","title":"\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306b\u95a2\u3059\u308b\u8a2d\u5b9a"},{"location":"ref_params/#_3","text":"pg_strom.max_async_tasks [\u578b: int / \u521d\u671f\u5024: 12 ] PG-Strom\u304cGPU\u5b9f\u884c\u30ad\u30e5\u30fc\u306b\u6295\u5165\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u975e\u540c\u671f\u30bf\u30b9\u30af\u306eGPU\u30c7\u30d0\u30a4\u30b9\u6bce\u306e\u6700\u5927\u5024\u3067\u3001GPU Service\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u6570\u3067\u3082\u3042\u308a\u307e\u3059\u3002","title":"\u30a8\u30b0\u30bc\u30ad\u30e5\u30fc\u30bf\u306b\u95a2\u3059\u308b\u8a2d\u5b9a"},{"location":"ref_params/#gpusql","text":"pg_strom.gpudirect_driver [\u578b: text ] GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306e\u30c9\u30e9\u30a4\u30d0\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u540d\u3092\u793a\u3059\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3059\u3002 cufile \u3001 nvme-strom \u3001\u3082\u3057\u304f\u306f vfs \u306e\u3069\u308c\u304b\u3067\u3059\u3002 pg_strom.gpudirect_enabled [\u578b: bool / \u521d\u671f\u5024: on ] GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u3002 pg_strom.gpu_direct_seq_page_cost [\u578b: real / \u521d\u671f\u5024: DEFAULT_SEQ_PAGE_COST / 4 ] \u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u304c\u5b9f\u884c\u30d7\u30e9\u30f3\u306e\u30b3\u30b9\u30c8\u3092\u8a08\u7b97\u3059\u308b\u969b\u306b\u3001GPU-Direct SQL\u3092\u7528\u3044\u3066\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u5834\u5408\u306e\u30b3\u30b9\u30c8\u3068\u3057\u3066 seq_page_cost \u306e\u4ee3\u308f\u308a\u306b\u4f7f\u7528\u3055\u308c\u308b\u5024\u3002 pg_strom.gpudirect_threshold [\u578b: int / \u521d\u671f\u5024: \u81ea\u52d5] GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u3092\u767a\u52d5\u3055\u305b\u308b\u30c6\u30fc\u30d6\u30eb\u30b5\u30a4\u30ba\u306e\u95be\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u3002 \u521d\u671f\u5024\u306f\u81ea\u52d5\u8a2d\u5b9a\u3067\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u7269\u7406\u30e1\u30e2\u30ea\u3068 shared_buffers \u8a2d\u5b9a\u5024\u304b\u3089\u8a08\u7b97\u3057\u305f\u95be\u5024\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 pg_strom.manual_optimal_gpus [\u578b: text / \u521d\u671f\u5024: \u306a\u3057] NVME\u30c7\u30d0\u30a4\u30b9\u3084NFS\u533a\u753b\u306a\u3069\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u533a\u753b\u3054\u3068\u306b\u6700\u3082\u8fd1\u508d\u3068\u5224\u5b9a\u3055\u308c\u308bGPU\u3092\u624b\u52d5\u3067\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u66f8\u5f0f\u306f {|/path/to/tablespace}=gpuX[:gpuX...] \u3067\u3001NVME\u30c7\u30d0\u30a4\u30b9\u307e\u305f\u306f\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306e\u30d1\u30b9\u3068\u3001\u305d\u306e\u8fd1\u508d\u3067\u3042\u308bGPU\uff08\u8907\u6570\u53ef\uff09\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002\u30ab\u30f3\u30de\u3067\u533a\u5207\u3063\u3066\u8907\u6570\u306e\u8a2d\u5b9a\u3092\u8a18\u8ff0\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002 \u4f8b: pg_strom.manual_optimal_gpus = 'nvme1=gpu0,nvme2=gpu1,/mnt/nfsroot=gpu0' \u306f\u30c7\u30d0\u30a4\u30b9\u756a\u53f7X\u3092\u6301\u3064GPU\u3067\u3059\u3002 \u306f\u30ed\u30fc\u30ab\u30eb\u306eNVME-SSD\u307e\u305f\u306f\u30ea\u30e2\u30fc\u30c8\u306eNVME-oF\u30c7\u30d0\u30a4\u30b9\u3092\u610f\u5473\u3057\u307e\u3059\u3002 /path/to/tablespace \u306f\u3001\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306b\u7d10\u3065\u3044\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d5\u30eb\u30d1\u30b9\u3067\u3059\u3002 \u30ed\u30fc\u30ab\u30eb\u306eNVME-SSD\u306b\u5bfe\u3057\u3066\u306f\u591a\u304f\u306e\u5834\u5408\u81ea\u52d5\u8a2d\u5b9a\u3067\u5341\u5206\u3067\u3059\u304c\u3001NVME-oF\u30c7\u30d0\u30a4\u30b9\u3084NFS-over-RDMA\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u6a5f\u68b0\u7684\u306b\u8fd1\u508d\u306eGPU\u3092\u7279\u5b9a\u3059\u308b\u4e8b\u304c\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u624b\u52d5\u3067\u8fd1\u508d\u306eGPU\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002","title":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306e\u8a2d\u5b9a"},{"location":"ref_params/#arrow_fdw","text":"arrow_fdw.enabled [\u578b: bool / \u521d\u671f\u5024: on ] \u63a8\u5b9a\u30b3\u30b9\u30c8\u5024\u3092\u8abf\u6574\u3057\u3001Arrow_Fdw\u306e\u6709\u52b9/\u7121\u52b9\u3092\u5207\u308a\u66ff\u3048\u307e\u3059\u3002\u305f\u3060\u3057\u3001GpuScan\u304c\u5229\u7528\u3067\u304d\u306a\u3044\u5834\u5408\u306b\u306f\u3001Arrow_Fdw\u306b\u3088\u308bForeign Scan\u3060\u3051\u304cArrow\u30d5\u30a1\u30a4\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3067\u304d\u308b\u3068\u3044\u3046\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 arrow_fdw.stats_hint_enabled [\u578b: bool / \u521d\u671f\u5024: on ] Arrow\u30d5\u30a1\u30a4\u30eb\u304cmin/max\u7d71\u8a08\u60c5\u5831\u3092\u6301\u3063\u3066\u304a\u308a\u3001\u305d\u308c\u3092\u7528\u3044\u3066\u4e0d\u5fc5\u8981\u306arecord-batch\u3092\u8aad\u307f\u98db\u3070\u3059\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 arrow_fdw.metadata_cache_size [\u578b: int / \u521d\u671f\u5024: 512MB ] Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30e1\u30bf\u60c5\u5831\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u5171\u6709\u30e1\u30e2\u30ea\u9818\u57df\u306e\u5927\u304d\u3055\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u5171\u6709\u30e1\u30e2\u30ea\u306e\u6d88\u8cbb\u91cf\u304c\u3053\u306e\u30b5\u30a4\u30ba\u3092\u8d8a\u3048\u308b\u3068\u3001\u53e4\u3044\u30e1\u30bf\u60c5\u5831\u304b\u3089\u9806\u306b\u89e3\u653e\u3055\u308c\u307e\u3059\u3002","title":"Arrow_Fdw\u95a2\u9023\u306e\u8a2d\u5b9a"},{"location":"ref_params/#gpu","text":"pg_strom.enable_gpucache [\u578b: bool / \u521d\u671f\u5024: on ] \u691c\u7d22/\u5206\u6790\u7cfb\u306e\u30af\u30a8\u30ea\u3067GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f7f\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002 \u306a\u304a\u3001\u3053\u306e\u8a2d\u5b9a\u5024\u3092 off \u306b\u3057\u3066\u3082\u30c8\u30ea\u30ac\u95a2\u6570\u306f\u5f15\u304d\u7d9a\u304dREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u66f4\u65b0\u3057\u7d9a\u3051\u307e\u3059\u3002 pg_strom.gpucache_auto_preload [\u578b: text / \u521d\u671f\u5024: null ] PostgreSQL\u306e\u8d77\u52d5\u76f4\u5f8c\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30ed\u30fc\u30c9\u3059\u3079\u304d\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u66f8\u5f0f\u306f DATABASE_NAME.SCHEMA_NAME.TABLE_NAME \u3067\u3001\u8907\u6570\u500b\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3053\u308c\u3092\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u4e26\u3079\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u521d\u56de\u30ed\u30fc\u30c9\u306f\u76f8\u5fdc\u306b\u6642\u9593\u306e\u304b\u304b\u308b\u51e6\u7406\u3067\u3059\u304c\u3001\u4e8b\u524d\u306b\u521d\u56de\u30ed\u30fc\u30c9\u3092\u6e08\u307e\u305b\u3066\u304a\u304f\u4e8b\u3067\u3001\u691c\u7d22/\u5206\u6790\u30af\u30a8\u30ea\u306e\u521d\u56de\u5b9f\u884c\u6642\u306b\u5fdc\u7b54\u901f\u5ea6\u304c\u9045\u5ef6\u3059\u308b\u306e\u3092\u907f\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u306a\u304a\u3001\u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u3092 '*' \u306b\u8a2d\u5b9a\u3059\u308b\u3068\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6301\u3064\u5168\u3066\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092\u9806\u306bGPU\u3078\u30ed\u30fc\u30c9\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u8a2d\u5b9a"},{"location":"ref_params/#gpu_1","text":"pg_strom.gpu_mempool_segment_sz [\u578b: int / \u521d\u671f\u5024: 1GB ] GPU Service\u304c\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u7528\u306bGPU\u30e1\u30e2\u30ea\u3092\u78ba\u4fdd\u3059\u308b\u969b\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u30b5\u30a4\u30ba\u3067\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5f53\u3066\u306f\u6bd4\u8f03\u7684\u30d8\u30d3\u30fc\u306a\u51e6\u7406\u3067\u3042\u308b\u305f\u3081\u3001\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30e1\u30e2\u30ea\u3092\u4f7f\u3044\u56de\u3059\u4e8b\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u3002 pg_strom.gpu_mempool_max_ratio [\u578b: real / \u521d\u671f\u5024: 50% ] GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u7528\u306b\u4f7f\u7528\u3059\u308b\u4e8b\u306e\u3067\u304d\u308b\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5408\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u306b\u3088\u308b\u904e\u5270\u306aGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u6d88\u8cbb\u3092\u6291\u5236\u3057\u3001\u30ef\u30fc\u30ad\u30f3\u30b0\u30e1\u30e2\u30ea\u3092\u5341\u5206\u306b\u78ba\u4fdd\u3059\u308b\u4e8b\u304c\u76ee\u7684\u3067\u3059\u3002 pg_strom.gpu_mempool_min_ratio [\u578b: real / \u521d\u671f\u5024: 5% ] \u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u306b\u78ba\u4fdd\u3057\u305fGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u3046\u3061\u3001\u5229\u7528\u7d42\u4e86\u5f8c\u3082\u89e3\u653e\u305b\u305a\u306b\u78ba\u4fdd\u3057\u305f\u307e\u307e\u306b\u3057\u3066\u304a\u304f\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5408\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u6700\u5c0f\u9650\u5ea6\u306e\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u3092\u4fdd\u6301\u3057\u3066\u304a\u304f\u3053\u3068\u306b\u3088\u308a\u3001\u6b21\u306e\u30af\u30a8\u30ea\u3092\u901f\u3084\u304b\u306b\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 pg_strom.gpu_mempool_release_delay [\u578b: int / \u521d\u671f\u5024: 5000 ] GPU Service\u306f\u3001\u3042\u308b\u30e1\u30e2\u30ea\u30d7\u30fc\u30eb\u4e0a\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u304c\u7a7a\u306b\u306a\u3063\u3066\u3082\u3001\u3053\u308c\u3092\u76f4\u3061\u306b\u958b\u653e\u3057\u307e\u305b\u3093\u3002\u305d\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u304c\u6700\u5f8c\u306b\u5229\u7528\u3055\u308c\u3066\u304b\u3089\u3001\u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u6307\u5b9a\u3055\u308c\u305f\u6642\u9593\uff08\u30df\u30ea\u79d2\u5358\u4f4d\uff09\u3092\u7d4c\u904e\u3059\u308b\u3068\u3001\u3053\u308c\u3092\u958b\u653e\u3057\u3066\u30b7\u30b9\u30c6\u30e0\u306b\u8fd4\u5374\u3057\u307e\u3059\u3002 \u4e00\u5b9a\u306e\u9045\u5ef6\u3092\u631f\u3080\u4e8b\u3067\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5272\u5f53/\u89e3\u653e\u306e\u983b\u5ea6\u3092\u6e1b\u3089\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 pg_strom.gpuserv_debug_output [\u578b: bool / \u521d\u671f\u5024: false ] GPU Service\u306e\u30c7\u30d0\u30c3\u30b0\u30e1\u30c3\u30bb\u30fc\u30b8\u51fa\u529b\u3092\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3057\u307e\u3059\u3002\u3053\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u30c7\u30d0\u30c3\u30b0\u306b\u304a\u3044\u3066\u6709\u52b9\u3067\u3042\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u901a\u5e38\u306f\u521d\u671f\u5024\u306e\u307e\u307e\u5909\u66f4\u3057\u306a\u3044\u3067\u4e0b\u3055\u3044\u3002 pg_strom.cuda_visible_devices [\u578b: text / \u521d\u671f\u5024: null ] PostgreSQL\u306e\u8d77\u52d5\u6642\u306b\u7279\u5b9a\u306eGPU\u30c7\u30d0\u30a4\u30b9\u3060\u3051\u3092\u8a8d\u8b58\u3055\u305b\u3066\u3044\u5834\u5408\u306f\u3001\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067GPU\u30c7\u30d0\u30a4\u30b9\u756a\u53f7\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u74b0\u5883\u5909\u6570 CUDA_VISIBLE_DEVICES \u3092\u8a2d\u5b9a\u3059\u308b\u306e\u3068\u540c\u7b49\u3067\u3059\u3002","title":"GPU\u30c7\u30d0\u30a4\u30b9\u306b\u95a2\u9023\u3059\u308b\u8a2d\u5b9a"},{"location":"ref_sqlfuncs/","text":"SQL\u30aa\u30d6\u30b8\u30a7\u30af\u30c8 \u672c\u7ae0\u3067\u306fPG-Strom\u304c\u72ec\u81ea\u306b\u63d0\u4f9b\u3059\u308bSQL\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 \u30b7\u30b9\u30c6\u30e0\u60c5\u5831 pgstrom.device_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc PG-Strom\u7528\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305fGPU\u30c7\u30d0\u30a4\u30b9\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8868\u793a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d3\u30e5\u30fc\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 name type description gpu_id int GPU\u30c7\u30d0\u30a4\u30b9\u756a\u53f7 att_name text \u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u540d att_value text \u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u5024 att_desc text \u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u306e\u8aac\u660e GPU\u30c7\u30d0\u30a4\u30b9\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u975e\u5e38\u306b\u6570\u304c\u591a\u304f\u3001\u307e\u305fCUDA\u30c9\u30e9\u30a4\u30d0\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u6570\u306f\u307e\u3061\u307e\u3061\u3067\u3059\u3002 \u305d\u306e\u305f\u3081\u3001 pgstrom.device_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc\u3067\u306f\u3001GPU\u30c7\u30d0\u30a4\u30b9\u756a\u53f7( gpu_id )\u3068\u3001\u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u540d( att_name )\u306b\u3088\u3063\u3066\u5bfe\u8c61\u3068\u306a\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u7279\u5b9a\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306f pgstrom.device_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc\u306e\u51fa\u529b\u4f8b\u3067\u3059\u3002 postgres=# select * from pgstrom.gpu_device_info limit 10; gpu_id | att_name | att_value | att_desc --------+-----------------------+------------------------------------------+------------------------------------- 0 | DEV_NAME | NVIDIA A100-PCIE-40GB | GPU Device Name 0 | DEV_ID | 0 | GPU Device ID 0 | DEV_UUID | GPU-13943bfd-5b30-38f5-0473-78979c134606 | GPU Device UUID 0 | DEV_TOTAL_MEMSZ | 39.39GB | GPU Total RAM Size 0 | DEV_BAR1_MEMSZ | 64.00GB | GPU PCI Bar1 Size 0 | NUMA_NODE_ID | -1 | GPU NUMA Node Id 0 | MAX_THREADS_PER_BLOCK | 1024 | Maximum number of threads per block 0 | MAX_BLOCK_DIM_X | 1024 | Maximum block dimension X 0 | MAX_BLOCK_DIM_Y | 1024 | Maximum block dimension Y 0 | MAX_BLOCK_DIM_Z | 64 | Maximum block dimension Z (10 rows) Arrow_Fdw fdw_handler pgstrom.arrow_fdw_handler() Arrow_Fdw\u306eFDW\u30cf\u30f3\u30c9\u30e9\u95a2\u6570\u3067\u3059\u3002\u901a\u5e38\u3001\u30e6\u30fc\u30b6\u304c\u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 void pgstrom.arrow_fdw_validator(text[], oid) Arrow_Fdw\u306eFDW\u30aa\u30d7\u30b7\u30e7\u30f3\u691c\u8a3c\u7528\u95a2\u6570\u3067\u3059\u3002\u901a\u5e38\u3001\u30e6\u30fc\u30b6\u304c\u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 event_trigger pgstrom.arrow_fdw_precheck_schema() Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u305f\u3081\u306e\u30a4\u30d9\u30f3\u30c8\u30c8\u30ea\u30ac\u95a2\u6570\u3067\u3059\u3002\u901a\u5e38\u3001\u30e6\u30fc\u30b6\u304c\u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 void pgstrom.arrow_fdw_import_file(text, text, text = null) Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3001\u65b0\u305f\u306b\u5916\u90e8\u30c6\u30fc\u30d6\u30eb(foreign table)\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u7b2c\u4e00\u5f15\u6570\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u540d\u524d\u3001\u7b2c\u4e8c\u5f15\u6570\u306fApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3001\u7701\u7565\u53ef\u80fd\u306a\u7b2c\u4e09\u5f15\u6570\u306f\u30b9\u30ad\u30fc\u30de\u540d\u3067\u3059\u3002 \u3053\u306e\u95a2\u6570\u306f IMPORT FOREIGN SCHEMA \u69cb\u6587\u306b\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001PostgreSQL\u306b\u304a\u3051\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u5217\u6570\u5236\u9650\uff08 MaxTupleAttributeNumber = 1664\uff09\u3092\u8d8a\u3048\u308b\u5217\u304c\u5b9a\u7fa9\u3055\u308c\u305fApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3067\u304d\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u3053\u308c\u306b\u8a72\u5f53\u3057\u306a\u3044\u5927\u534a\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3067\u306f IMPORT FOREIGN SCHEMA \u69cb\u6587\u3092\u5229\u7528\u3059\u3079\u304d\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001 pgstrom.arrow_fdw_import_file \u3092\u7528\u3044\u30662000\u500b\u306eInt16\u5217\u3092\u6301\u3064Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u305f\u3082\u306e\u3067\u3059\u3002 \\d mytest \u306e\u5b9f\u884c\u7d50\u679c\u3088\u308a\u3001\u65b0\u305f\u306b\u4f5c\u6210\u3055\u308c\u305f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb mytest \u304c2000\u500b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6301\u3063\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 PostgreSQL\u5185\u90e8\u8868\u73fe\u306e\u90fd\u5408\u4e0a\u3001\u5168\u3066\u306e\u5217\u3092\u4e00\u5ea6\u306b\u8aad\u307f\u51fa\u3059\u4e8b\u306f\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u6700\u5f8c\u306e\u4f8b\u306e\u3088\u3046\u306b\u4e00\u90e8\u306e\u5217\u3060\u3051\u3092\u53c2\u7167\u3059\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3042\u308c\u3070\u5b9f\u884c\u53ef\u80fd\u3067\u3059\u3002 =# select pgstrom.arrow_fdw_import_file('mytest', '/tmp/wide2000.arrow'); arrow_fdw_import_file ----------------------- (1 row) =# \\d List of relations Schema | Name | Type | Owner --------+--------+---------------+-------- public | mytest | foreign table | kaigai (1 row) =# \\d mytest Foreign table \"public.mytest\" Column | Type | Collation | Nullable | Default | FDW options -----------+----------+-----------+----------+---------+------------- object_id | integer | | | | c000 | smallint | | | | c001 | smallint | | | | c002 | smallint | | | | c003 | smallint | | | | : : : : : : c1997 | smallint | | | | c1998 | smallint | | | | c1999 | smallint | | | | Server: arrow_fdw FDW options: (file '/tmp/wide2000.arrow') =# select * from mytest ; ERROR: target lists can have at most 1664 entries =# select c0010,c1234,c1999 from mytest limit 3; c0010 | c1234 | c1999 -------+-------+------- 232 | 232 | 232 537 | 537 | 537 219 | 219 | 219 (3 rows) GPU\u30ad\u30e3\u30c3\u30b7\u30e5 pgstrom.gpucache_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u73fe\u5728\u306e\u72b6\u614b\u3092\u8868\u793a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d3\u30e5\u30fc\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 name type description database_oid oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eOID\u3067\u3059 database_name text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u540d\u524d\u3067\u3059 table_oid oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306eOID\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 table_name text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u540d\u524d\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 signature int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4e00\u610f\u6027\u3092\u793a\u3059\u30cf\u30c3\u30b7\u30e5\u5024\u3067\u3059\u3002\u4f8b\u3048\u3070 ALTER TABLE \u306e\u524d\u5f8c\u306a\u3069\u3067\u3053\u306e\u5024\u304c\u5909\u308f\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 phase text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u69cb\u7bc9\u306e\u6bb5\u968e\u3092\u793a\u3057\u307e\u3059\u3002 not_built , is_empty , is_loading , is_ready , corrupted \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002 rowid_num_used int8 \u5272\u5f53\u3066\u6e08\u307f\u306e\u884cID\u306e\u6570\u3067\u3059\u3002 rowid_num_free int8 \u672a\u5272\u5f53\u306e\u884cID\u306e\u6570\u3067\u3059\u3002 gpu_main_sz int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u56fa\u5b9a\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_main_nitems int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u30bf\u30d7\u30eb\u6570\u3067\u3059\u3002 gpu_extra_sz int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_extra_usage int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u9818\u57df\u306e\u4f7f\u7528\u6e08\u307f\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_extra_dead int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u9818\u57df\u306e\u672a\u4f7f\u7528\u30b5\u30a4\u30ba\u3067\u3059\u3002 redo_write_ts timestamptz REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u6700\u5f8c\u306b\u66f4\u65b0\u3057\u305f\u6642\u523b\u3067\u3059\u3002 redo_write_nitems int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_write_pos int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_read_nitems int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_read_pos int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_sync_pos int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u3046\u3061\u3001\u65e2\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3078\u306e\u9069\u7528\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u305f\u4f4d\u7f6e\u3067\u3059\u3002REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u6b8b\u308a\u5bb9\u91cf\u304c\u903c\u8feb\u3057\u3066\u304d\u305f\u969b\u306b\u3001\u591a\u6570\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u540c\u6642\u306b\u975e\u540c\u671f\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u767a\u751f\u3055\u305b\u308b\u4e8b\u3092\u907f\u3051\u308b\u305f\u3081\u3001\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002 config_options text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3067\u3059\u3002 \u4ee5\u4e0b\u306f pgstrom.gpucache_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc\u306e\u51fa\u529b\u4f8b\u3067\u3059\u3002 =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | phase | rowid_num_used | rowid_num_free | gpu_main_sz | gpu_main_nitems | gpu_extra_sz | gpu_extra_usage | gpu_extra_dead | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------------+------------+----------+----------------+----------------+-------------+-----------------+--------------+-----------------+----------------+-------------------------------+-------------------+----------------+------------------+---------------+---------------+--------------------------------------------------------------------------------------------------------------------- 193450 | hoge | 603029 | cache_test_table | 4529357070 | is_ready | 4000 | 6000 | 439904 | 4000 | 3200024 | 473848 | 0 | 2023-12-18 01:25:42.850193+09 | 4000 | 603368 | 4000 | 603368 | 603368 | gpu_device_id=0,max_num_rows=10000,redo_buffer_size=157286400,gpu_sync_interval=4000000,gpu_sync_threshold=10485760 (1 row) trigger pgstrom.gpucache_sync_trigger() \u30c6\u30fc\u30d6\u30eb\u66f4\u65b0\u306e\u969b\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u540c\u671f\u3059\u308b\u305f\u3081\u306e\u30c8\u30ea\u30ac\u95a2\u6570\u3067\u3059\u3002\u8a73\u3057\u304f\u306f GPU\u30ad\u30e3\u30c3\u30b7\u30e5 \u306e\u7ae0\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 bigint pgstrom.gpucache_apply_redo(regclass) \u5f15\u6570\u3067\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u3092\u5f37\u5236\u7684\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u9069\u7528\u3057\u307e\u3059\u3002 bigint pgstrom.gpucache_compaction(regclass) \u5f15\u6570\u3067\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u30d0\u30c3\u30d5\u30a1\u3092\u5f37\u5236\u7684\u306b\u30b3\u30f3\u30d1\u30af\u30c8\u5316\u3057\u307e\u3059\u3002 bigint pgstrom.gpucache_recovery(regclass) \u7834\u640d\uff08corrupted\uff09\u72b6\u614b\u3068\u306a\u3063\u305fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5fa9\u5143\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002 \u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u751f\u6210 void pgstrom.random_setseed(int) \u4e71\u6570\u306e\u7cfb\u5217\u3092\u521d\u671f\u5316\u3057\u307e\u3059\u3002 bigint pgstrom.random_int(float=0.0, bigint=0, bigint=INT_MAX) bigint \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 float pgstrom.random_float(float=0.0, float=0.0, float=1.0) float \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 date pgstrom.random_date(float=0.0, date='2015-01-01', date='2025-12-31') date \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 time pgstrom.random_time(float=0.0, time='00:00:00', time='23:59:59') time \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 timetz pgstrom.random_timetz(float=0.0, time='00:00:00', time='23:59:59') timetz \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 timestamp pgstrom.random_timestamp(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') timestamp \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 macaddr pgstrom.random_macaddr(float=0.0, macaddr='ab:cd:00:00:00', macaddr='ab:cd:ff:ff:ff:ff') macaddr \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 inet pgstrom.random_inet(float=0.0, inet='192.168.0.1/16') inet \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 text pgstrom.random_text(float=0.0, text='test_**') text \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u751f\u6210\u3057\u307e\u3059\u3002\u7b2c\u4e8c\u5f15\u6570\u306e'*'\u6587\u5b57\u3092\u30e9\u30f3\u30c0\u30e0\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 text pgstrom.random_text_len(float=0.0, int=10) text \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u6587\u5b57\u5217\u9577\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 int4range pgstrom.random_int4range(float=0.0, bigint=0, bigint=INT_MAX) int4range \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002} int8range pgstrom.random_int8range(float=0.0, bigint=0, bigint=LONG_MAX) int8range \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 tsrange pgstrom.random_tsrange(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') tsrange \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 tstzrange pgstrom.random_tstzrange(float=0.0, timestamptz='2015-01-01', timestamptz='2025-01-01') tstzrange \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 daterange pgstrom.random_daterange(float=0.0, date='2015-01-01', date='2025-12-31') daterange \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 \u305d\u306e\u4ed6\u306e\u95a2\u6570 text pgstrom.githash() \u73fe\u5728\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308bPG-Strom\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5143\u3068\u306a\u3063\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u30ea\u30d3\u30b8\u30e7\u30f3\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u8868\u793a\u3057\u307e\u3059\u3002\u3053\u306e\u5024\u306f\u3001\u969c\u5bb3\u6642\u306b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u30ea\u30d3\u30b8\u30e7\u30f3\u3092\u7279\u5b9a\u3059\u308b\u306e\u306b\u6709\u7528\u3067\u3059\u3002 postgres=# select pgstrom.githash(); githash ------------------------------------------ 103984be24cafd1e7ce6330a050960d97675c196 text pgstrom.license_query() \u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308c\u3070\u3001\u73fe\u5728\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u5546\u7528\u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3\u3092\u8868\u793a\u3057\u307e\u3059\u3002 =# select pgstrom.license_query(); license_query ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2020-11-24\", \"expired_at\" : \"2025-12-31\", \"gpus\" : [ { \"uuid\" : \"GPU-8ba149db-53d8-c5f3-0f55-97ce8cfadb28\" } ]} (1 row)","title":"SQL\u30aa\u30d6\u30b8\u30a7\u30af\u30c8"},{"location":"ref_sqlfuncs/#sql","text":"\u672c\u7ae0\u3067\u306fPG-Strom\u304c\u72ec\u81ea\u306b\u63d0\u4f9b\u3059\u308bSQL\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","title":"SQL\u30aa\u30d6\u30b8\u30a7\u30af\u30c8"},{"location":"ref_sqlfuncs/#_1","text":"pgstrom.device_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc PG-Strom\u7528\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305fGPU\u30c7\u30d0\u30a4\u30b9\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8868\u793a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d3\u30e5\u30fc\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 name type description gpu_id int GPU\u30c7\u30d0\u30a4\u30b9\u756a\u53f7 att_name text \u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u540d att_value text \u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u5024 att_desc text \u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u306e\u8aac\u660e GPU\u30c7\u30d0\u30a4\u30b9\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u975e\u5e38\u306b\u6570\u304c\u591a\u304f\u3001\u307e\u305fCUDA\u30c9\u30e9\u30a4\u30d0\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u6570\u306f\u307e\u3061\u307e\u3061\u3067\u3059\u3002 \u305d\u306e\u305f\u3081\u3001 pgstrom.device_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc\u3067\u306f\u3001GPU\u30c7\u30d0\u30a4\u30b9\u756a\u53f7( gpu_id )\u3068\u3001\u30c7\u30d0\u30a4\u30b9\u5c5e\u6027\u540d( att_name )\u306b\u3088\u3063\u3066\u5bfe\u8c61\u3068\u306a\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u7279\u5b9a\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306f pgstrom.device_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc\u306e\u51fa\u529b\u4f8b\u3067\u3059\u3002 postgres=# select * from pgstrom.gpu_device_info limit 10; gpu_id | att_name | att_value | att_desc --------+-----------------------+------------------------------------------+------------------------------------- 0 | DEV_NAME | NVIDIA A100-PCIE-40GB | GPU Device Name 0 | DEV_ID | 0 | GPU Device ID 0 | DEV_UUID | GPU-13943bfd-5b30-38f5-0473-78979c134606 | GPU Device UUID 0 | DEV_TOTAL_MEMSZ | 39.39GB | GPU Total RAM Size 0 | DEV_BAR1_MEMSZ | 64.00GB | GPU PCI Bar1 Size 0 | NUMA_NODE_ID | -1 | GPU NUMA Node Id 0 | MAX_THREADS_PER_BLOCK | 1024 | Maximum number of threads per block 0 | MAX_BLOCK_DIM_X | 1024 | Maximum block dimension X 0 | MAX_BLOCK_DIM_Y | 1024 | Maximum block dimension Y 0 | MAX_BLOCK_DIM_Z | 64 | Maximum block dimension Z (10 rows)","title":"\u30b7\u30b9\u30c6\u30e0\u60c5\u5831"},{"location":"ref_sqlfuncs/#arrow_fdw","text":"fdw_handler pgstrom.arrow_fdw_handler() Arrow_Fdw\u306eFDW\u30cf\u30f3\u30c9\u30e9\u95a2\u6570\u3067\u3059\u3002\u901a\u5e38\u3001\u30e6\u30fc\u30b6\u304c\u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 void pgstrom.arrow_fdw_validator(text[], oid) Arrow_Fdw\u306eFDW\u30aa\u30d7\u30b7\u30e7\u30f3\u691c\u8a3c\u7528\u95a2\u6570\u3067\u3059\u3002\u901a\u5e38\u3001\u30e6\u30fc\u30b6\u304c\u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 event_trigger pgstrom.arrow_fdw_precheck_schema() Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u305f\u3081\u306e\u30a4\u30d9\u30f3\u30c8\u30c8\u30ea\u30ac\u95a2\u6570\u3067\u3059\u3002\u901a\u5e38\u3001\u30e6\u30fc\u30b6\u304c\u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 void pgstrom.arrow_fdw_import_file(text, text, text = null) Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3001\u65b0\u305f\u306b\u5916\u90e8\u30c6\u30fc\u30d6\u30eb(foreign table)\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u7b2c\u4e00\u5f15\u6570\u306f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u540d\u524d\u3001\u7b2c\u4e8c\u5f15\u6570\u306fApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3001\u7701\u7565\u53ef\u80fd\u306a\u7b2c\u4e09\u5f15\u6570\u306f\u30b9\u30ad\u30fc\u30de\u540d\u3067\u3059\u3002 \u3053\u306e\u95a2\u6570\u306f IMPORT FOREIGN SCHEMA \u69cb\u6587\u306b\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001PostgreSQL\u306b\u304a\u3051\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u5217\u6570\u5236\u9650\uff08 MaxTupleAttributeNumber = 1664\uff09\u3092\u8d8a\u3048\u308b\u5217\u304c\u5b9a\u7fa9\u3055\u308c\u305fApache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3067\u304d\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u3053\u308c\u306b\u8a72\u5f53\u3057\u306a\u3044\u5927\u534a\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3067\u306f IMPORT FOREIGN SCHEMA \u69cb\u6587\u3092\u5229\u7528\u3059\u3079\u304d\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001 pgstrom.arrow_fdw_import_file \u3092\u7528\u3044\u30662000\u500b\u306eInt16\u5217\u3092\u6301\u3064Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u305f\u3082\u306e\u3067\u3059\u3002 \\d mytest \u306e\u5b9f\u884c\u7d50\u679c\u3088\u308a\u3001\u65b0\u305f\u306b\u4f5c\u6210\u3055\u308c\u305f\u5916\u90e8\u30c6\u30fc\u30d6\u30eb mytest \u304c2000\u500b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6301\u3063\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 PostgreSQL\u5185\u90e8\u8868\u73fe\u306e\u90fd\u5408\u4e0a\u3001\u5168\u3066\u306e\u5217\u3092\u4e00\u5ea6\u306b\u8aad\u307f\u51fa\u3059\u4e8b\u306f\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u6700\u5f8c\u306e\u4f8b\u306e\u3088\u3046\u306b\u4e00\u90e8\u306e\u5217\u3060\u3051\u3092\u53c2\u7167\u3059\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3042\u308c\u3070\u5b9f\u884c\u53ef\u80fd\u3067\u3059\u3002 =# select pgstrom.arrow_fdw_import_file('mytest', '/tmp/wide2000.arrow'); arrow_fdw_import_file ----------------------- (1 row) =# \\d List of relations Schema | Name | Type | Owner --------+--------+---------------+-------- public | mytest | foreign table | kaigai (1 row) =# \\d mytest Foreign table \"public.mytest\" Column | Type | Collation | Nullable | Default | FDW options -----------+----------+-----------+----------+---------+------------- object_id | integer | | | | c000 | smallint | | | | c001 | smallint | | | | c002 | smallint | | | | c003 | smallint | | | | : : : : : : c1997 | smallint | | | | c1998 | smallint | | | | c1999 | smallint | | | | Server: arrow_fdw FDW options: (file '/tmp/wide2000.arrow') =# select * from mytest ; ERROR: target lists can have at most 1664 entries =# select c0010,c1234,c1999 from mytest limit 3; c0010 | c1234 | c1999 -------+-------+------- 232 | 232 | 232 537 | 537 | 537 219 | 219 | 219 (3 rows)","title":"Arrow_Fdw"},{"location":"ref_sqlfuncs/#gpu","text":"pgstrom.gpucache_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u73fe\u5728\u306e\u72b6\u614b\u3092\u8868\u793a\u3057\u307e\u3059\u3002 \u3053\u306e\u30d3\u30e5\u30fc\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 name type description database_oid oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eOID\u3067\u3059 database_name text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u5c5e\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u540d\u524d\u3067\u3059 table_oid oid GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306eOID\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 table_name text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8a2d\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u540d\u524d\u3067\u3059\u3002\u5fc5\u305a\u3057\u3082\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306f\u9650\u3089\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 signature int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u4e00\u610f\u6027\u3092\u793a\u3059\u30cf\u30c3\u30b7\u30e5\u5024\u3067\u3059\u3002\u4f8b\u3048\u3070 ALTER TABLE \u306e\u524d\u5f8c\u306a\u3069\u3067\u3053\u306e\u5024\u304c\u5909\u308f\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 phase text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u69cb\u7bc9\u306e\u6bb5\u968e\u3092\u793a\u3057\u307e\u3059\u3002 not_built , is_empty , is_loading , is_ready , corrupted \u306e\u3044\u305a\u308c\u304b\u3067\u3059\u3002 rowid_num_used int8 \u5272\u5f53\u3066\u6e08\u307f\u306e\u884cID\u306e\u6570\u3067\u3059\u3002 rowid_num_free int8 \u672a\u5272\u5f53\u306e\u884cID\u306e\u6570\u3067\u3059\u3002 gpu_main_sz int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u56fa\u5b9a\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_main_nitems int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u30bf\u30d7\u30eb\u6570\u3067\u3059\u3002 gpu_extra_sz int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u7528\u306e\u9818\u57df\u306e\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_extra_usage int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u9818\u57df\u306e\u4f7f\u7528\u6e08\u307f\u30b5\u30a4\u30ba\u3067\u3059\u3002 gpu_extra_dead int8 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u4e0a\u306e\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u9818\u57df\u306e\u672a\u4f7f\u7528\u30b5\u30a4\u30ba\u3067\u3059\u3002 redo_write_ts timestamptz REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u6700\u5f8c\u306b\u66f4\u65b0\u3057\u305f\u6642\u523b\u3067\u3059\u3002 redo_write_nitems int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_write_pos int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_read_nitems int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u6570\u3067\u3059\u3002 redo_read_pos int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u9069\u7528\u3055\u308c\u305fREDO\u30ed\u30b0\u306e\u7dcf\u30d0\u30a4\u30c8\u6570\u3067\u3059\u3002 redo_sync_pos int8 REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u66f8\u304d\u8fbc\u307e\u308c\u305fREDO\u30ed\u30b0\u306e\u3046\u3061\u3001\u65e2\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3078\u306e\u9069\u7528\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u305f\u4f4d\u7f6e\u3067\u3059\u3002REDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u6b8b\u308a\u5bb9\u91cf\u304c\u903c\u8feb\u3057\u3066\u304d\u305f\u969b\u306b\u3001\u591a\u6570\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u540c\u6642\u306b\u975e\u540c\u671f\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u767a\u751f\u3055\u305b\u308b\u4e8b\u3092\u907f\u3051\u308b\u305f\u3081\u3001\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002 config_options text GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3067\u3059\u3002 \u4ee5\u4e0b\u306f pgstrom.gpucache_info \u30b7\u30b9\u30c6\u30e0\u30d3\u30e5\u30fc\u306e\u51fa\u529b\u4f8b\u3067\u3059\u3002 =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | phase | rowid_num_used | rowid_num_free | gpu_main_sz | gpu_main_nitems | gpu_extra_sz | gpu_extra_usage | gpu_extra_dead | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------------+------------+----------+----------------+----------------+-------------+-----------------+--------------+-----------------+----------------+-------------------------------+-------------------+----------------+------------------+---------------+---------------+--------------------------------------------------------------------------------------------------------------------- 193450 | hoge | 603029 | cache_test_table | 4529357070 | is_ready | 4000 | 6000 | 439904 | 4000 | 3200024 | 473848 | 0 | 2023-12-18 01:25:42.850193+09 | 4000 | 603368 | 4000 | 603368 | 603368 | gpu_device_id=0,max_num_rows=10000,redo_buffer_size=157286400,gpu_sync_interval=4000000,gpu_sync_threshold=10485760 (1 row) trigger pgstrom.gpucache_sync_trigger() \u30c6\u30fc\u30d6\u30eb\u66f4\u65b0\u306e\u969b\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u540c\u671f\u3059\u308b\u305f\u3081\u306e\u30c8\u30ea\u30ac\u95a2\u6570\u3067\u3059\u3002\u8a73\u3057\u304f\u306f GPU\u30ad\u30e3\u30c3\u30b7\u30e5 \u306e\u7ae0\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 bigint pgstrom.gpucache_apply_redo(regclass) \u5f15\u6570\u3067\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u672a\u9069\u7528\u306eREDO\u30ed\u30b0\u3092\u5f37\u5236\u7684\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u9069\u7528\u3057\u307e\u3059\u3002 bigint pgstrom.gpucache_compaction(regclass) \u5f15\u6570\u3067\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u30d0\u30c3\u30d5\u30a1\u3092\u5f37\u5236\u7684\u306b\u30b3\u30f3\u30d1\u30af\u30c8\u5316\u3057\u307e\u3059\u3002 bigint pgstrom.gpucache_recovery(regclass) \u7834\u640d\uff08corrupted\uff09\u72b6\u614b\u3068\u306a\u3063\u305fGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5fa9\u5143\u3057\u3088\u3046\u3068\u8a66\u307f\u307e\u3059\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5"},{"location":"ref_sqlfuncs/#_2","text":"void pgstrom.random_setseed(int) \u4e71\u6570\u306e\u7cfb\u5217\u3092\u521d\u671f\u5316\u3057\u307e\u3059\u3002 bigint pgstrom.random_int(float=0.0, bigint=0, bigint=INT_MAX) bigint \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 float pgstrom.random_float(float=0.0, float=0.0, float=1.0) float \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 date pgstrom.random_date(float=0.0, date='2015-01-01', date='2025-12-31') date \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 time pgstrom.random_time(float=0.0, time='00:00:00', time='23:59:59') time \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 timetz pgstrom.random_timetz(float=0.0, time='00:00:00', time='23:59:59') timetz \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 timestamp pgstrom.random_timestamp(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') timestamp \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 macaddr pgstrom.random_macaddr(float=0.0, macaddr='ab:cd:00:00:00', macaddr='ab:cd:ff:ff:ff:ff') macaddr \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 inet pgstrom.random_inet(float=0.0, inet='192.168.0.1/16') inet \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 text pgstrom.random_text(float=0.0, text='test_**') text \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u751f\u6210\u3057\u307e\u3059\u3002\u7b2c\u4e8c\u5f15\u6570\u306e'*'\u6587\u5b57\u3092\u30e9\u30f3\u30c0\u30e0\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002 text pgstrom.random_text_len(float=0.0, int=10) text \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u6587\u5b57\u5217\u9577\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 int4range pgstrom.random_int4range(float=0.0, bigint=0, bigint=INT_MAX) int4range \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002} int8range pgstrom.random_int8range(float=0.0, bigint=0, bigint=LONG_MAX) int8range \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 tsrange pgstrom.random_tsrange(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') tsrange \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 tstzrange pgstrom.random_tstzrange(float=0.0, timestamptz='2015-01-01', timestamptz='2025-01-01') tstzrange \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002 daterange pgstrom.random_daterange(float=0.0, date='2015-01-01', date='2025-12-31') daterange \u578b\u306e\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u306e\u7bc4\u56f2\u5185\u3067\u751f\u6210\u3057\u307e\u3059\u3002","title":"\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u751f\u6210"},{"location":"ref_sqlfuncs/#_3","text":"text pgstrom.githash() \u73fe\u5728\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308bPG-Strom\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5143\u3068\u306a\u3063\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u30ea\u30d3\u30b8\u30e7\u30f3\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u8868\u793a\u3057\u307e\u3059\u3002\u3053\u306e\u5024\u306f\u3001\u969c\u5bb3\u6642\u306b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u30ea\u30d3\u30b8\u30e7\u30f3\u3092\u7279\u5b9a\u3059\u308b\u306e\u306b\u6709\u7528\u3067\u3059\u3002 postgres=# select pgstrom.githash(); githash ------------------------------------------ 103984be24cafd1e7ce6330a050960d97675c196 text pgstrom.license_query() \u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308c\u3070\u3001\u73fe\u5728\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u5546\u7528\u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3\u3092\u8868\u793a\u3057\u307e\u3059\u3002 =# select pgstrom.license_query(); license_query ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2020-11-24\", \"expired_at\" : \"2025-12-31\", \"gpus\" : [ { \"uuid\" : \"GPU-8ba149db-53d8-c5f3-0f55-97ce8cfadb28\" } ]} (1 row)","title":"\u305d\u306e\u4ed6\u306e\u95a2\u6570"},{"location":"ref_types/","text":"\u30c7\u30fc\u30bf\u578b PG-Strom\u306f\u4ee5\u4e0b\u306e\u30c7\u30fc\u30bf\u578b\u3092GPU\u3067\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u6570\u5024\u30c7\u30fc\u30bf\u578b int1 [\u30c7\u30fc\u30bf\u9577: 1byte] 8bit\u6574\u6570\u578b\u3002PG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 int2 (\u5225\u540d smallint ) [\u30c7\u30fc\u30bf\u9577: 2bytes] 16bit\u6574\u6570\u578b int4 (\u5225\u540d int ) [\u30c7\u30fc\u30bf\u9577: 4bytes] 32bit\u6574\u6570\u578b int8 (\u5225\u540d bigint ) [\u30c7\u30fc\u30bf\u9577: 8bytes] 64bit\u6574\u6570\u578b float2 [\u30c7\u30fc\u30bf\u9577: 2bytes] \u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3002PG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 Note GPU\u3067\u306f\u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u304c\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001CPU(x86_64\u30d7\u30ed\u30bb\u30c3\u30b5)\u3067\u306f\u672a\u5bfe\u5fdc\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001 float2 \u30c7\u30fc\u30bf\u578b\u3092CPU\u3067\u51e6\u7406\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u3053\u308c\u3092\u4e00\u5ea6 float \u3084 double \u578b\u306b\u5909\u63db\u3057\u305f\u4e0a\u3067\u6f14\u7b97\u3092\u884c\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001GPU\u306e\u3088\u3046\u306b float2 \u306e\u65b9\u304c\u6f14\u7b97\u901f\u5ea6\u3067\u6709\u5229\u3068\u3044\u3046\u4e8b\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u6a5f\u68b0\u5b66\u7fd2\u3084\u7d71\u8a08\u89e3\u6790\u7528\u9014\u306b\u30c7\u30fc\u30bf\u91cf\u3092\u6291\u5236\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002 float4 (\u5225\u540d real ) [\u30c7\u30fc\u30bf\u9577: 4bytes] \u5358\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b float8 (\u5225\u540d double precision ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u500d\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b numeric [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909] \u5b9f\u6570\u578b\u3002GPU\u5074\u3067\u306f128bit\u56fa\u5b9a\u5c0f\u6570\u70b9\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u3002 Note GPU\u304c numeric \u578b\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u969b\u3001\u5b9f\u88c5\u4e0a\u306e\u7406\u7531\u304b\u3089\u3053\u308c\u3092128bit\u56fa\u5b9a\u5c11\u6570\u70b9\u306e\u5185\u90e8\u8868\u73fe\u306b\u5909\u63db\u3057\u3066\u51e6\u7406\u3057\u307e\u3059\u3002\uff08\u3053\u308c\u306f Apache Arrow \u306e Decimal \u578b\u3068\u540c\u4e00\u306e\u5f62\u5f0f\u3067\u3059\uff09 \u3053\u308c\u3089\u5185\u90e8\u8868\u73fe\u3078\u306e/\u304b\u3089\u306e\u5909\u63db\u306f\u900f\u904e\u7684\u306b\u884c\u308f\u308c\u307e\u3059\u304c\u3001\u4f8b\u3048\u3070\u3001\u6841\u6570\u306e\u5927\u304d\u306a numeric \u578b\u306e\u30c7\u30fc\u30bf\u306f\u8868\u73fe\u3059\u308b\u4e8b\u304c\u3067\u304d\u306a\u3044\u305f\u3081\u3001PG-Strom\u306fCPU\u5074\u3067\u306e\u30d5\u30a9\u30fc\u30eb\u30d0\u30c3\u30af\u51e6\u7406\u3092\u8a66\u307f\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u6841\u6570\u306e\u5927\u304d\u306a numeric \u578b\u306e\u30c7\u30fc\u30bf\u3092GPU\u306b\u4e0e\u3048\u308b\u3068\u5374\u3063\u3066\u5b9f\u884c\u901f\u5ea6\u304c\u4f4e\u4e0b\u3057\u3066\u3057\u307e\u3046\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u3053\u308c\u3092\u907f\u3051\u308b\u306b\u306f\u3001GUC\u30d1\u30e9\u30e1\u30fc\u30bf pg_strom.enable_numeric_type \u3092\u4f7f\u7528\u3057\u3066 numeric \u30c7\u30fc\u30bf\u578b\u3092\u542b\u3080\u6f14\u7b97\u5f0f\u3092GPU\u3067\u5b9f\u884c\u3057\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002 \u65e5\u4ed8\u6642\u523b\u578b date [\u30c7\u30fc\u30bf\u9577: 4bytes] \u65e5\u4ed8\u30c7\u30fc\u30bf\u578b time (\u5225\u540d time without time zone ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u6642\u523b\u30c7\u30fc\u30bf\u578b timetz (\u5225\u540d time with time zone ) [\u30c7\u30fc\u30bf\u9577: 12bytes] \u6642\u523b\u30c7\u30fc\u30bf\u578b\uff08\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u4ed8\u304d\uff09 timestamp (\u5225\u540d timestamp without time zone ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b timestamptz (\u5225\u540d timestamp with time zone ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b\uff08\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u4ed8\u304d\uff09 interval [\u30c7\u30fc\u30bf\u9577: 16bytes] \u6642\u9593\u9593\u9694\u578b \u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b bpchar [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30c6\u30ad\u30b9\u30c8\u578b\uff08\u7a7a\u767d\u30d1\u30c7\u30a3\u30f3\u30b0\u3042\u308a\uff09 varchar [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30c6\u30ad\u30b9\u30c8\u578b text [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30c6\u30ad\u30b9\u30c8\u578b bytea [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30d0\u30a4\u30ca\u30ea\u578b \u975e\u69cb\u9020\u30c7\u30fc\u30bf\u578b jsonb [length: \u53ef\u5909\u9577] \u30d0\u30a4\u30ca\u30ea\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5185\u5305\u3059\u308bJSON\u30c7\u30fc\u30bf\u578b Note jsonb \u30c7\u30fc\u30bf\u578b\u3092GPU\u3067\u51e6\u7406\u3055\u305b\u308b\u5834\u5408\u306b\u306f\u3001\u6b21\u306e2\u3064\u306e\u70b9\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u5b9f\u969b\u306b\u53c2\u7167\u3055\u308c\u306a\u3044\u5c5e\u6027\u3082\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u8ee2\u9001\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001I/O\u30d0\u30b9\u306e\u5229\u7528\u52b9\u7387\u306f\u5fc5\u305a\u3057\u3082\u826f\u304f\u306a\u3044\u30c7\u30fc\u30bf\u578b\u3067\u3042\u308b\u4e8b\u3002\u30c7\u30fc\u30bf\u9577\u304c TOAST\u5316 \u306e\u95be\u5024\uff08\u901a\u5e38\u306f2kB\u5f31\uff09\u3092\u8d8a\u3048\u3066\u3057\u307e\u3063\u305f\u5834\u5408\u3001 jsonb \u30c7\u30fc\u30bf\u5168\u4f53\u304cTOAST\u30c6\u30fc\u30d6\u30eb\u3078\u66f8\u304d\u51fa\u3055\u308c\u308b\u305f\u3081\u3001GPU\u5074\u3067\u306f\u51e6\u7406\u3067\u304d\u305a\u975e\u52b9\u7387\u306aCPU-fallback\u51e6\u7406\u3092\u547c\u3073\u51fa\u3057\u3066\u3057\u307e\u3046\u4e8b\u3002 \u5f8c\u8005\u306e\u554f\u984c\u306b\u5bfe\u3057\u3066\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u30aa\u30d7\u30b7\u30e7\u30f3 toast_tuple_target \u3092\u62e1\u5927\u3057\u3001TOAST\u5316\u306e\u95be\u5024\u3092\u5f15\u304d\u4e0a\u3052\u308b\u4e8b\u3067\u3042\u308b\u7a0b\u5ea6\u306f\u56de\u907f\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002 \u96d1\u591a\u306a\u30c7\u30fc\u30bf\u578b boolean [\u30c7\u30fc\u30bf\u9577: 1byte] \u8ad6\u7406\u5024\u30c7\u30fc\u30bf\u578b money [\u30c7\u30fc\u30bf\u9577: 8bytes] \u901a\u8ca8\u30c7\u30fc\u30bf\u578b uuid [\u30c7\u30fc\u30bf\u9577: 16bytes] UUID\u30c7\u30fc\u30bf\u578b macaddr [\u30c7\u30fc\u30bf\u9577: 6bytes] \u30cd\u30c3\u30c8\u30ef\u30fc\u30afMAC\u30a2\u30c9\u30ec\u30b9\u578b inet [\u30c7\u30fc\u30bf\u9577: 7 or 19bytes] \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u578b cidr [\u30c7\u30fc\u30bf\u9577: 7 or 19butes] \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u578b cube [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] contrib/cube \u306b\u3088\u3063\u3066\u63d0\u4f9b\u3055\u308c\u308b\u62e1\u5f35\u30c7\u30fc\u30bf\u578b \u30b8\u30aa\u30e1\u30c8\u30ea\u578b geometry [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909] PostGIS\u30b8\u30aa\u30e1\u30c8\u30ea\u30aa\u30d6\u30b8\u30a7\u30af\u30c8 box2df [\u30c7\u30fc\u30bf\u9577: 16bytes] 2\u6b21\u5143\u30d0\u30a6\u30f3\u30c7\u30a3\u30f3\u30b0\u30dc\u30c3\u30af\u30b9\uff08GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u7528\uff09","title":"\u30c7\u30fc\u30bf\u578b"},{"location":"ref_types/#_1","text":"PG-Strom\u306f\u4ee5\u4e0b\u306e\u30c7\u30fc\u30bf\u578b\u3092GPU\u3067\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002","title":"\u30c7\u30fc\u30bf\u578b"},{"location":"ref_types/#_2","text":"int1 [\u30c7\u30fc\u30bf\u9577: 1byte] 8bit\u6574\u6570\u578b\u3002PG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 int2 (\u5225\u540d smallint ) [\u30c7\u30fc\u30bf\u9577: 2bytes] 16bit\u6574\u6570\u578b int4 (\u5225\u540d int ) [\u30c7\u30fc\u30bf\u9577: 4bytes] 32bit\u6574\u6570\u578b int8 (\u5225\u540d bigint ) [\u30c7\u30fc\u30bf\u9577: 8bytes] 64bit\u6574\u6570\u578b float2 [\u30c7\u30fc\u30bf\u9577: 2bytes] \u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3002PG-Strom\u306b\u3088\u308b\u72ec\u81ea\u62e1\u5f35 Note GPU\u3067\u306f\u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u304c\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001CPU(x86_64\u30d7\u30ed\u30bb\u30c3\u30b5)\u3067\u306f\u672a\u5bfe\u5fdc\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001 float2 \u30c7\u30fc\u30bf\u578b\u3092CPU\u3067\u51e6\u7406\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u3053\u308c\u3092\u4e00\u5ea6 float \u3084 double \u578b\u306b\u5909\u63db\u3057\u305f\u4e0a\u3067\u6f14\u7b97\u3092\u884c\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001GPU\u306e\u3088\u3046\u306b float2 \u306e\u65b9\u304c\u6f14\u7b97\u901f\u5ea6\u3067\u6709\u5229\u3068\u3044\u3046\u4e8b\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u6a5f\u68b0\u5b66\u7fd2\u3084\u7d71\u8a08\u89e3\u6790\u7528\u9014\u306b\u30c7\u30fc\u30bf\u91cf\u3092\u6291\u5236\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002 float4 (\u5225\u540d real ) [\u30c7\u30fc\u30bf\u9577: 4bytes] \u5358\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b float8 (\u5225\u540d double precision ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u500d\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b numeric [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909] \u5b9f\u6570\u578b\u3002GPU\u5074\u3067\u306f128bit\u56fa\u5b9a\u5c0f\u6570\u70b9\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u3002 Note GPU\u304c numeric \u578b\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u969b\u3001\u5b9f\u88c5\u4e0a\u306e\u7406\u7531\u304b\u3089\u3053\u308c\u3092128bit\u56fa\u5b9a\u5c11\u6570\u70b9\u306e\u5185\u90e8\u8868\u73fe\u306b\u5909\u63db\u3057\u3066\u51e6\u7406\u3057\u307e\u3059\u3002\uff08\u3053\u308c\u306f Apache Arrow \u306e Decimal \u578b\u3068\u540c\u4e00\u306e\u5f62\u5f0f\u3067\u3059\uff09 \u3053\u308c\u3089\u5185\u90e8\u8868\u73fe\u3078\u306e/\u304b\u3089\u306e\u5909\u63db\u306f\u900f\u904e\u7684\u306b\u884c\u308f\u308c\u307e\u3059\u304c\u3001\u4f8b\u3048\u3070\u3001\u6841\u6570\u306e\u5927\u304d\u306a numeric \u578b\u306e\u30c7\u30fc\u30bf\u306f\u8868\u73fe\u3059\u308b\u4e8b\u304c\u3067\u304d\u306a\u3044\u305f\u3081\u3001PG-Strom\u306fCPU\u5074\u3067\u306e\u30d5\u30a9\u30fc\u30eb\u30d0\u30c3\u30af\u51e6\u7406\u3092\u8a66\u307f\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u6841\u6570\u306e\u5927\u304d\u306a numeric \u578b\u306e\u30c7\u30fc\u30bf\u3092GPU\u306b\u4e0e\u3048\u308b\u3068\u5374\u3063\u3066\u5b9f\u884c\u901f\u5ea6\u304c\u4f4e\u4e0b\u3057\u3066\u3057\u307e\u3046\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u3053\u308c\u3092\u907f\u3051\u308b\u306b\u306f\u3001GUC\u30d1\u30e9\u30e1\u30fc\u30bf pg_strom.enable_numeric_type \u3092\u4f7f\u7528\u3057\u3066 numeric \u30c7\u30fc\u30bf\u578b\u3092\u542b\u3080\u6f14\u7b97\u5f0f\u3092GPU\u3067\u5b9f\u884c\u3057\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002","title":"\u6570\u5024\u30c7\u30fc\u30bf\u578b"},{"location":"ref_types/#_3","text":"date [\u30c7\u30fc\u30bf\u9577: 4bytes] \u65e5\u4ed8\u30c7\u30fc\u30bf\u578b time (\u5225\u540d time without time zone ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u6642\u523b\u30c7\u30fc\u30bf\u578b timetz (\u5225\u540d time with time zone ) [\u30c7\u30fc\u30bf\u9577: 12bytes] \u6642\u523b\u30c7\u30fc\u30bf\u578b\uff08\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u4ed8\u304d\uff09 timestamp (\u5225\u540d timestamp without time zone ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b timestamptz (\u5225\u540d timestamp with time zone ) [\u30c7\u30fc\u30bf\u9577: 8bytes] \u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u578b\uff08\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u4ed8\u304d\uff09 interval [\u30c7\u30fc\u30bf\u9577: 16bytes] \u6642\u9593\u9593\u9694\u578b","title":"\u65e5\u4ed8\u6642\u523b\u578b"},{"location":"ref_types/#_4","text":"bpchar [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30c6\u30ad\u30b9\u30c8\u578b\uff08\u7a7a\u767d\u30d1\u30c7\u30a3\u30f3\u30b0\u3042\u308a\uff09 varchar [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30c6\u30ad\u30b9\u30c8\u578b text [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30c6\u30ad\u30b9\u30c8\u578b bytea [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] \u53ef\u5909\u9577\u30d0\u30a4\u30ca\u30ea\u578b","title":"\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b"},{"location":"ref_types/#_5","text":"jsonb [length: \u53ef\u5909\u9577] \u30d0\u30a4\u30ca\u30ea\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5185\u5305\u3059\u308bJSON\u30c7\u30fc\u30bf\u578b Note jsonb \u30c7\u30fc\u30bf\u578b\u3092GPU\u3067\u51e6\u7406\u3055\u305b\u308b\u5834\u5408\u306b\u306f\u3001\u6b21\u306e2\u3064\u306e\u70b9\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u5b9f\u969b\u306b\u53c2\u7167\u3055\u308c\u306a\u3044\u5c5e\u6027\u3082\u30b9\u30c8\u30ec\u30fc\u30b8\u304b\u3089\u8aad\u307f\u51fa\u3057\u3001GPU\u306b\u8ee2\u9001\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001I/O\u30d0\u30b9\u306e\u5229\u7528\u52b9\u7387\u306f\u5fc5\u305a\u3057\u3082\u826f\u304f\u306a\u3044\u30c7\u30fc\u30bf\u578b\u3067\u3042\u308b\u4e8b\u3002\u30c7\u30fc\u30bf\u9577\u304c TOAST\u5316 \u306e\u95be\u5024\uff08\u901a\u5e38\u306f2kB\u5f31\uff09\u3092\u8d8a\u3048\u3066\u3057\u307e\u3063\u305f\u5834\u5408\u3001 jsonb \u30c7\u30fc\u30bf\u5168\u4f53\u304cTOAST\u30c6\u30fc\u30d6\u30eb\u3078\u66f8\u304d\u51fa\u3055\u308c\u308b\u305f\u3081\u3001GPU\u5074\u3067\u306f\u51e6\u7406\u3067\u304d\u305a\u975e\u52b9\u7387\u306aCPU-fallback\u51e6\u7406\u3092\u547c\u3073\u51fa\u3057\u3066\u3057\u307e\u3046\u4e8b\u3002 \u5f8c\u8005\u306e\u554f\u984c\u306b\u5bfe\u3057\u3066\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u30aa\u30d7\u30b7\u30e7\u30f3 toast_tuple_target \u3092\u62e1\u5927\u3057\u3001TOAST\u5316\u306e\u95be\u5024\u3092\u5f15\u304d\u4e0a\u3052\u308b\u4e8b\u3067\u3042\u308b\u7a0b\u5ea6\u306f\u56de\u907f\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002","title":"\u975e\u69cb\u9020\u30c7\u30fc\u30bf\u578b"},{"location":"ref_types/#_6","text":"boolean [\u30c7\u30fc\u30bf\u9577: 1byte] \u8ad6\u7406\u5024\u30c7\u30fc\u30bf\u578b money [\u30c7\u30fc\u30bf\u9577: 8bytes] \u901a\u8ca8\u30c7\u30fc\u30bf\u578b uuid [\u30c7\u30fc\u30bf\u9577: 16bytes] UUID\u30c7\u30fc\u30bf\u578b macaddr [\u30c7\u30fc\u30bf\u9577: 6bytes] \u30cd\u30c3\u30c8\u30ef\u30fc\u30afMAC\u30a2\u30c9\u30ec\u30b9\u578b inet [\u30c7\u30fc\u30bf\u9577: 7 or 19bytes] \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u578b cidr [\u30c7\u30fc\u30bf\u9577: 7 or 19butes] \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u578b cube [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909\u9577] contrib/cube \u306b\u3088\u3063\u3066\u63d0\u4f9b\u3055\u308c\u308b\u62e1\u5f35\u30c7\u30fc\u30bf\u578b","title":"\u96d1\u591a\u306a\u30c7\u30fc\u30bf\u578b"},{"location":"ref_types/#_7","text":"geometry [\u30c7\u30fc\u30bf\u9577: \u53ef\u5909] PostGIS\u30b8\u30aa\u30e1\u30c8\u30ea\u30aa\u30d6\u30b8\u30a7\u30af\u30c8 box2df [\u30c7\u30fc\u30bf\u9577: 16bytes] 2\u6b21\u5143\u30d0\u30a6\u30f3\u30c7\u30a3\u30f3\u30b0\u30dc\u30c3\u30af\u30b9\uff08GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u7528\uff09","title":"\u30b8\u30aa\u30e1\u30c8\u30ea\u578b"},{"location":"release_v2.0/","text":"PG-Strom v2.0\u30ea\u30ea\u30fc\u30b9 PG-Strom Development Team (17-Apr-2018) \u6982\u8981 PG-Strom v2.0\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u6a5f\u80fd\u5f37\u5316\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 GPU\u3092\u7ba1\u7406\u3059\u308b\u5185\u90e8\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u306e\u5168\u4f53\u7684\u306a\u518d\u8a2d\u8a08\u3068\u5b89\u5b9a\u5316 CPU+GPU\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u4e26\u5217\u5b9f\u884c SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2(store_fdw) GpuJoin\u3068GpuPreAgg\u306e\u518d\u8a2d\u8a08\u306b\u4f34\u3046\u9ad8\u901f\u5316 GpuPreAgg+GpuJoin+GpuScan \u5bc6\u7d50\u5408GPU\u30ab\u30fc\u30cd\u30eb \u65b0\u6a5f\u80fd\u306e\u30b5\u30de\u30ea\u306f\u3053\u3061\u3089\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\uff1a PG-Strom v2.0 Technical Brief . \u52d5\u4f5c\u74b0\u5883 PostgreSQL v9.6, v10 CUDA Toolkit 9.1 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d) \u65b0\u6a5f\u80fd GPU\u3092\u7ba1\u7406\u3059\u308b\u5185\u90e8\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u306e\u5168\u4f53\u7684\u306a\u518d\u8a2d\u8a08\u3068\u5b89\u5b9a\u5316 PostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306f\u540c\u6642\u306b\uff11\u500b\u306eGPU\u3060\u3051\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u30de\u30eb\u30c1GPU\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u306fPostgreSQL\u306eCPU\u4e26\u5217\u3068\u306e\u4f75\u7528\u304c\u524d\u63d0\u306b\u306a\u308a\u307e\u3059\u304c\u3001CPU\u30b9\u30ec\u30c3\u30c9\u304cGPU\u3078\u30c7\u30fc\u30bf\u3092\u4f9b\u7d66\u3059\u308b\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u306fGPU\u306e\u51e6\u7406\u80fd\u529b\u3088\u308a\u3082\u305a\u3063\u3068\u4f4e\u3044\u305f\u3081\u3001\u901a\u5e38\u3001\u3053\u308c\u306f\u554f\u984c\u3068\u306f\u306a\u308a\u307e\u305b\u3093\u3002\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u8a2d\u8a08\u306e\u30b7\u30f3\u30d7\u30eb\u5316\u3092\u512a\u5148\u3057\u307e\u3057\u305f\u3002 Pascal\u4e16\u4ee3\u4ee5\u964d\u306eGPU\u3067\u63a1\u7528\u3055\u308c\u305fGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30c7\u30de\u30f3\u30c9\u30da\u30fc\u30b8\u30f3\u30b0\u3092\u307b\u307c\u5168\u9762\u7684\u306b\u63a1\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u591a\u304f\u306f\u5b9f\u969b\u306b\u5b9f\u884c\u3057\u3066\u307f\u308b\u307e\u3067\u5fc5\u8981\u306a\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u306e\u5927\u304d\u3055\u304c\u5206\u304b\u3089\u306a\u3044\u305f\u3081\u3001\u3053\u308c\u307e\u3067\u306f\u5fc5\u8981\u4ee5\u4e0a\u306b\u30d0\u30c3\u30d5\u30a1\u3092\u7372\u5f97\u3057\u3001\u307e\u305f\u30e1\u30e2\u30ea\u4e0d\u8db3\u6642\u306b\u306f\u518d\u5b9f\u884c\u3092\u884c\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u3089\u306f\u540c\u6642\u5b9f\u884c\u30d7\u30ed\u30bb\u30b9\u306e\u5229\u7528\u53ef\u80fd\u306a\u30ea\u30bd\u30fc\u30b9\u3092\u5236\u9650\u3057\u3001\u307e\u305f\u8907\u96d1\u306a\u4f8b\u5916\u30ed\u30b8\u30c3\u30af\u306f\u30d0\u30b0\u306e\u6e29\u5e8a\u3067\u3057\u305f\u3002GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30c7\u30de\u30f3\u30c9\u30da\u30fc\u30b8\u30f3\u30b0\u3092\u5229\u7528\u3059\u308b\u4e8b\u3067\u3001\u8a2d\u8a08\u306e\u30b7\u30f3\u30d7\u30eb\u5316\u3092\u884c\u3044\u307e\u3057\u305f\u3002 CUDA\u306e\u975e\u540c\u671f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5229\u7528\u3092\u6b62\u3081\u307e\u3057\u305f\u3002GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30c7\u30de\u30f3\u30c9\u30da\u30fc\u30b8\u30f3\u30b0\u3092\u5229\u7528\u3059\u308b\u3068\u3001DMA\u8ee2\u9001\u306e\u305f\u3081\u306e\u975e\u540c\u671fAPI\uff08 cuMemCpyHtoD \u306a\u3069\uff09\u306f\u540c\u671f\u7684\u306b\u632f\u821e\u3046\u3088\u3046\u306b\u306a\u308b\u305f\u3081\u3001GPU\u30ab\u30fc\u30cd\u30eb\u306e\u591a\u91cd\u5ea6\u304c\u4f4e\u4e0b\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u4ee3\u308f\u308a\u306bPG-Strom\u81ea\u8eab\u304c\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u3092\u7ba1\u7406\u3057\u3001\u3053\u308c\u3089\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u305d\u308c\u305e\u308c\u540c\u671fAPI\u3092\u547c\u3073\u51fa\u3059\u3088\u3046\u8a2d\u8a08\u5909\u66f4\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u526f\u7523\u7269\u3068\u3057\u3066\u3001\u975e\u540c\u671f\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\uff08 cuStreamAddCallback \uff09\u3092\u5229\u7528\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u3063\u305f\u306e\u3067\u3001MPS\u3092\u5229\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 CPU+GPU\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u4e26\u5217\u5b9f\u884c PostgreSQL v9.6\u3067\u65b0\u305f\u306b\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u305fCPU\u4e26\u5217\u5b9f\u884c\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 PG-Strom\u306e\u63d0\u4f9b\u3059\u308bGpuScan\u3001GpuJoin\u304a\u3088\u3073GpuPreAgg\u306e\u5404\u30ed\u30b8\u30c3\u30af\u306f\u8907\u6570\u306ePostgreSQL\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306b\u3088\u308a\u4e26\u5217\u306b\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 PostgreSQL v9.6\u3067\u306fCPU\u4e26\u5217\u5b9f\u884c\u306e\u969b\u306b EXPLAIN ANALYZE \u3067\u53d6\u5f97\u3059\u308bPG-Strom\u72ec\u81ea\u306e\u7d71\u8a08\u60c5\u5831\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001CustomScan\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9API\u3067 ShutdownCustomScan \u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u305f\u3081\u3001DSM\uff08\u52d5\u7684\u5171\u6709\u30e1\u30e2\u30ea\uff09\u306e\u89e3\u653e\u524d\u306b\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u30d7\u30ed\u30bb\u30b9\u304c\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306e\u60c5\u5831\u3092\u56de\u53ce\u3059\u308b\u624b\u6bb5\u304c\u7121\u304b\u3063\u305f\u305f\u3081\u3067\u3059\u3002 SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c Linux\u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb nvme_strom \u3092\u7528\u3044\u308b\u4e8b\u3067\u3001NVMe\u898f\u683c\u306b\u5bfe\u5fdc\u3057\u305fSSD\u4e0a\u306ePostgreSQL\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092\u3001CPU/RAM\u3092\u4ecb\u3055\u305a\u30c0\u30a4\u30ec\u30af\u30c8\u306bGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u3078\u8ee2\u9001\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002\u30b7\u30b9\u30c6\u30e0RAM\u306b\u8f09\u308a\u5207\u3089\u306a\u3044\u5927\u304d\u3055\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u3067\u3042\u3063\u3066\u3082\u3001\u672c\u6a5f\u80fd\u306b\u3088\u308aPG-Strom\u306e\u9069\u7528\u304c\u73fe\u5b9f\u7684\u306a\u9078\u629e\u80a2\u3068\u306a\u308b\u4e8b\u3067\u3057\u3087\u3046\u3002 \u30d6\u30ed\u30c3\u30af\u30c7\u30d0\u30a4\u30b9\u5c64\u3084\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u7d4c\u7531\u3057\u306a\u3044\u305f\u3081\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9650\u754c\u306b\u8fd1\u3044\u9ad8\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u3092\u5f15\u304d\u51fa\u3059\u4e8b\u304c\u53ef\u80fd\u3067\u3001\u304b\u3064\u3001GPU\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u51e6\u7406\u3059\u308b\u305f\u3081CPU\u306e\u51e6\u7406\u3059\u3079\u304d\u30c7\u30fc\u30bf\u91cf\u3092\u6e1b\u3089\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u7279\u6027\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u3088\u308a\u3001\u4e00\u822c\u7684\u306b\u306f\u8a08\u7b97\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u30a2\u30af\u30bb\u30e9\u30ec\u30fc\u30bf\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u3066\u3044\u308bGPU\u3092\u3001I/O\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u9ad8\u901f\u5316\u306b\u9069\u7528\u3059\u308b\u4e8b\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002 \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5 RAM\u30b5\u30a4\u30ba\u306b\u8f09\u308b\u7a0b\u5ea6\u306e\u5927\u304d\u3055\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u306f\u3001\u3088\u308aGPU\u3067\u306e\u51e6\u7406\u306b\u9069\u3057\u305f\u5217\u30c7\u30fc\u30bf\u5f62\u5f0f\u306b\u5909\u5f62\u3057\u3066\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u969b\u3057\u3066\u3001\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306b\u306fPostgreSQL\u306e\u5171\u6709\u30d0\u30c3\u30d5\u30a1\u3088\u308a\u3082\u3053\u3061\u3089\u3092\u512a\u5148\u3057\u3066\u53c2\u7167\u3057\u307e\u3059\u3002 \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u540c\u671f\u7684\u3001\u307e\u305f\u306f\u975e\u540c\u671f\u7684\u306b\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u521d\u671f\u306ePG-Strom\u3067\u4f3c\u305f\u3088\u3046\u306a\u6a5f\u80fd\u304c\u5b58\u5728\u3057\u3066\u3044\u305f\u4e8b\u3092\u899a\u3048\u3066\u304a\u3089\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002v2.0\u3067\u65b0\u305f\u306b\u5b9f\u88c5\u3055\u308c\u305f\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u3055\u308c\u305f\u884c\u304c\u66f4\u65b0\u3055\u308c\u308b\u3068\u3001\u5f53\u8a72\u884c\u3092\u542b\u3080\u30ad\u30e3\u30c3\u30b7\u30e5\u30d6\u30ed\u30c3\u30af\u3092\u6d88\u53bb\uff08invalidation\uff09\u3057\u307e\u3059\u3002\u884c\u30b9\u30c8\u30a2\u306e\u66f4\u65b0\u306b\u5408\u308f\u305b\u3066\u5217\u30ad\u30e3\u30c3\u30b7\u30e5\u5074\u306e\u66f4\u65b0\u3092\u884c\u3046\u3068\u3044\u3046\u4e8b\u306f\u884c\u308f\u306a\u3044\u305f\u3081\u3001\u66f4\u65b0\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u3059\u308b\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u4f4e\u4e0b\u306f\u9650\u5b9a\u7684\u3067\u3059\u3002 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2(gstore_fdw) GPU\u4e0a\u306b\u78ba\u4fdd\u3057\u305f\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u9818\u57df\u306b\u5bfe\u3057\u3066\u3001\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\uff08Foreign Table\uff09\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5229\u7528\u3057\u3066SQL\u306eSELECT/INSERT/UPDATE/DELETE\u306b\u3088\u308a\u8aad\u307f\u66f8\u304d\u3092\u884c\u3046\u6a5f\u80fd\u3067\u3059\u3002 \u5185\u90e8\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f pgstrom \u578b\u306e\u307f\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001PG-Strom\u306e\u30d0\u30c3\u30d5\u30a1\u5f62\u5f0f KDS_FORMAT_COLUMN \u30bf\u30a4\u30d7\u3068\u540c\u4e00\u306e\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3059\u308b\u3082\u306e\u3067\u3059\u3002\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b\u5834\u5408\u3001LZ\u65b9\u5f0f\u306b\u3088\u308b\u30c7\u30fc\u30bf\u5727\u7e2e\u3092\u884c\u3046\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002 v2.0\u306e\u6642\u70b9\u3067\u306f\u3001GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u306fPL/CUDA\u95a2\u6570\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u3060\u3051\u5229\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 GpuJoin\u3068GpuPreAgg\u306e\u518d\u8a2d\u8a08\u306b\u4f34\u3046\u9ad8\u901f\u5316 \u5f93\u6765\u3001GpuJoin\u3068GpuPreAgg\u3067\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3057\u3066\u3044\u305fDynamic Parallelism\u306e\u5229\u7528\u3092\u3084\u3081\u3001\u51e6\u7406\u30ed\u30b8\u30c3\u30af\u5168\u4f53\u306e\u898b\u76f4\u3057\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u3053\u308c\u306f\u3001GPU\u30b5\u30d6\u30ab\u30fc\u30cd\u30eb\u306e\u8d77\u52d5\u5f8c\u3001\u305d\u306e\u5b8c\u4e86\u3092\u5358\u306b\u5f85\u3063\u3066\u3044\u308b\u3060\u3051\u306eGPU\u30ab\u30fc\u30cd\u30eb\u304c\u5b9f\u884c\u30b9\u30ed\u30c3\u30c8\u3092\u5360\u6709\u3057\u3001GPU\u306e\u4f7f\u7528\u7387\u304c\u4e0a\u304c\u3089\u306a\u3044\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u3063\u305f\u305f\u3081\u3067\u3059\u3002 \u3053\u306e\u518d\u8a2d\u8a08\u306b\u4f34\u3046\u526f\u7523\u7269\u3068\u3057\u3066\u3001GpuJoin\u306e\u30b5\u30b9\u30da\u30f3\u30c9/\u30ec\u30b8\u30e5\u30fc\u30e0\u6a5f\u80fd\u304c\u5b9f\u88c5\u3055\u308c\u307e\u3057\u305f\u3002\u539f\u7406\u4e0a\u3001SQL\u306eJOIN\u51e6\u7406\u306f\u5165\u529b\u3057\u305f\u884c\u6570\u3088\u308a\u3082\u51fa\u529b\u3059\u308b\u884c\u6570\u306e\u65b9\u304c\u5897\u3048\u3066\u3057\u307e\u3046\u4e8b\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u51e6\u7406\u7d50\u679c\u3092\u66f8\u304d\u8fbc\u3080\u30d0\u30c3\u30d5\u30a1\u306e\u6b8b\u308a\u30b5\u30a4\u30ba\u304c\u4e0d\u8db3\u3057\u305f\u6642\u70b9\u3067GpuJoin\u3092\u30b5\u30b9\u30da\u30f3\u30c9\u3057\u3001\u65b0\u3057\u3044\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u3092\u5272\u308a\u5f53\u3066\u3066\u30ec\u30b8\u30e5\u30fc\u30e0\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u306e\u30b5\u30a4\u30ba\u63a8\u5b9a\u304c\u7c21\u7565\u5316\u3055\u308c\u305f\u307b\u304b\u3001\u5b9f\u884c\u6642\u306e\u30d0\u30c3\u30d5\u30a1\u4e0d\u8db3\u306b\u3088\u308b\u518d\u5b9f\u884c\u306e\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002 GpuPreAgg+GpuJoin+GpuScan \u5bc6\u7d50\u5408GPU\u30ab\u30fc\u30cd\u30eb GPU\u3067\u5b9f\u884c\u53ef\u80fd\u306aSCAN\u3001JOIN\u3001GROUP BY\u304c\u9023\u7d9a\u3057\u3066\u3044\u308b\u3068\u304d\u3001\u5bfe\u5fdc\u3059\u308bGpuScan\u3001GpuJoin\u3001GpuPreAgg\u306b\u76f8\u5f53\u3059\u308b\u51e6\u7406\u3092\u4e00\u56de\u306eGPU\u30ab\u30fc\u30cd\u30eb\u547c\u3073\u51fa\u3057\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306f\u3001GpuJoin\u306e\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u3092\u305d\u306e\u307e\u307eGpuPreAgg\u306e\u5165\u529b\u30d0\u30c3\u30d5\u30a1\u3068\u3057\u3066\u6271\u3046\u306a\u3069\u3001CPU\u3068GPU\u306e\u9593\u306e\u30c7\u30fc\u30bf\u4ea4\u63db\u3092\u6700\u5c0f\u9650\u306b\u6291\u3048\u308b\u305f\u3081\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u3059\u3002 \u3053\u306e\u6a5f\u80fd\u306f\u7279\u306b\u3001SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3059\u308b\u3068\u52b9\u679c\u7684\u3067\u3059\u3002 \u65b0\u3057\u3044\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc uuid \u578b\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u578b\uff08 inet \u3001 cidr \u3001\u304a\u3088\u3073 macaddr \uff09\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u7bc4\u56f2\u578b\uff08 int4range \u3001 int8range \u3001 tsrange \u3001 tstzrange \u3001 daterange \uff09\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\uff08 float2 \uff09\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306b\u95a2\u9023\u3059\u308bCPU\u5074\u306e\u5b9f\u88c5\u306fPG-Strom\u306e\u72ec\u81ea\u5b9f\u88c5\u306b\u3088\u308b\u3082\u306e\u3067\u3059\u3002 \u65b0\u3057\u3044\u6f14\u7b97\u5b50/\u95a2\u6570\u306e\u5bfe\u5fdc \u65e5\u4ed8\u6642\u523b\u578b\u306b\u5bfe\u3059\u308b EXTRACT(field FROM timestamp) \u6f14\u7b97\u5b50\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 New data type support uuid type Network address types ( inet , cidr and macaddr ) Range data types ( int4range , int8range , tsrange , tstzrange , daterange ) Half-precision floating point type ( float2 ). Its CPU side are also implemented by PG-Strom itself, not PostgreSQL's built-in feature. New operators / functions EXTRACT(field FROM timestamp) operator on the date and time types PL/CUDA\u95a2\u9023\u306e\u5f37\u5316 #plcuda_include \u306e\u62e1\u5f35\u306b\u3088\u308a\u3001 text \u578b\u3092\u8fd4\u3059SQL\u95a2\u6570\u3092\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u5f15\u6570\u306e\u5024\u306b\u3088\u3063\u3066\u633f\u5165\u3059\u308b\u30b3\u30fc\u30c9\u3092\u5909\u3048\u308b\u4e8b\u304c\u3067\u304d\u308b\u305f\u3081\u3001\u5358\u306b\u5916\u90e8\u5b9a\u7fa9\u95a2\u6570\u3092\u8aad\u307f\u8fbc\u3080\u3060\u3051\u3067\u306a\u304f\u3001\u52d5\u7684\u306b\u3044\u304f\u3064\u3082\u306eGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308a\u51fa\u3059\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002 PL/CUDA\u95a2\u6570\u306e\u5f15\u6570\u306b reggstore \u578b\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001GPU\u30ab\u30fc\u30cd\u30eb\u95a2\u6570\u3078\u306f\u5bfe\u5fdc\u3059\u308bGPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u306e\u30dd\u30a4\u30f3\u30bf\u304c\u6e21\u3055\u308c\u307e\u3059\u3002OID\u5024\u304c\u6e21\u3055\u308c\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u305d\u306e\u4ed6\u306e\u6a5f\u80fd\u5f37\u5316 lo_import_gpu \u304a\u3088\u3073 lo_export_gpu \u95a2\u6570\u306b\u3088\u308a\u3001\u5916\u90e8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u78ba\u4fdd\u3057\u305fGPU\u30e1\u30e2\u30ea\u306e\u5185\u5bb9\u3092\u76f4\u63a5PostgreSQL\u306e\u30e9\u30fc\u30b8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u8a18\u9332\u3057\u305f\u308a\u3001\u9006\u306b\u30e9\u30fc\u30b8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5185\u5bb9\u3092GPU\u30e1\u30e2\u30ea\u306b\u66f8\u304d\u51fa\u3059\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u30d1\u30c3\u30b1\u30fc\u30b8\u30f3\u30b0 PostgreSQL Global Development Group\u306e\u914d\u5e03\u3059\u308bPostgreSQL\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u9069\u5408\u3059\u308b\u3088\u3046\u3001RPM\u30d1\u30c3\u30b1\u30fc\u30b8\u5316\u3092\u884c\u3044\u307e\u3057\u305f\u3002 \u5168\u3066\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u7269\u4ef6\u306fHeteroDB SWDC(Software Distribution Center)\u3088\u308a\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u53ef\u80fd\u3067\u3059\u3002 \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 PG-Strom\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092markdown\u3068mkdocs\u3092\u7528\u3044\u3066\u5168\u9762\u7684\u306b\u66f8\u304d\u76f4\u3057\u307e\u3057\u305f\u3002\u5f93\u6765\u306eHTML\u3092\u7528\u3044\u305f\u30a2\u30d7\u30ed\u30fc\u30c1\u306b\u6bd4\u3079\u3001\u3088\u308a\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u304c\u5bb9\u6613\u3067\u65b0\u6a5f\u80fd\u306e\u958b\u767a\u306b\u5408\u308f\u305b\u305f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u62e1\u5145\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002 \u30c6\u30b9\u30c8 PostgreSQL\u306e\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u7528\u3057\u3066\u3001PG-Strom\u306e\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002 \u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd PostgreSQL v9.5\u30b5\u30dd\u30fc\u30c8 PostgreSQL v9.6\u3067\u306fCPU\u4e26\u5217\u30af\u30a8\u30ea\u306e\u63d0\u4f9b\u306b\u4f34\u3044\u3001\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6/\u30a8\u30b0\u30bc\u30ad\u30e5\u30fc\u30bf\u5171\u306b\u5927\u304d\u306a\u4fee\u6b63\u304c\u52a0\u3048\u3089\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u3068\u5bc6\u63a5\u306b\u9023\u643a\u3059\u308b\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u3068\u3063\u3066\u6700\u3082\u30a4\u30f3\u30d1\u30af\u30c8\u306e\u5927\u304d\u306a\u5909\u66f4\u306f\u300eupper planner path-ification\u300f\u3068\u547c\u3070\u308c\u308b\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5f37\u5316\u3067\u3001\u96c6\u7d04\u6f14\u7b97\u3084\u30bd\u30fc\u30c8\u306a\u3069\u306e\u5b9f\u884c\u8a08\u753b\u3082\u30b3\u30b9\u30c8\u30d9\u30fc\u30b9\u3067\u8907\u6570\u306e\u7570\u306a\u308b\u65b9\u6cd5\u3092\u6bd4\u8f03\u3057\u3066\u6700\u9069\u306a\u3082\u306e\u3092\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u3053\u308c\u306fGpuPreAgg\u3092\u5b9f\u88c5\u3059\u308b\u305f\u3081\u306b\u30d5\u30c3\u30af\u3092\u5229\u7528\u3057\u3066\u5b9f\u884c\u8a08\u753b\u3092\u66f8\u304d\u63db\u3048\u3066\u3044\u305f\u5f93\u6765\u306e\u65b9\u6cd5\u3068\u306f\u6839\u672c\u7684\u306b\u7570\u306a\u308a\u3001\u3088\u308a\u5408\u7406\u7684\u304b\u3064\u4fe1\u983c\u3067\u304d\u308b\u65b9\u6cd5\u3067GPU\u3092\u7528\u3044\u305f\u96c6\u7d04\u6f14\u7b97\u3092\u633f\u5165\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u3001\u30d0\u30b0\u306e\u6e29\u5e8a\u3067\u3042\u3063\u305f\u5b9f\u884c\u8a08\u753b\u306e\u66f8\u304d\u63db\u3048\u30ed\u30b8\u30c3\u30af\u3092\u6368\u3066\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u540c\u6642\u306b\u3001CustomScan\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u3082CPU\u4e26\u5217\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u306eAPI\u304c\u62e1\u5f35\u3055\u308c\u3001\u3053\u308c\u3089\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u306bPostgreSQL v9.5\u30b5\u30dd\u30fc\u30c8\u306f\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002 GpuSort\u6a5f\u80fd GpuSort\u6a5f\u80fd\u306f\u6027\u80fd\u4e0a\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u5f97\u3089\u308c\u306a\u3044\u305f\u3081\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002 \u30bd\u30fc\u30c8\u306fGPU\u306e\u5f97\u610f\u3068\u3059\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u4e00\u3064\u3067\u3059\u3002\u3057\u304b\u3057\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5927\u304d\u3055\u3092\u8d8a\u3048\u308b\u30b5\u30a4\u30ba\u306e\u30c7\u30fc\u30bf\u3092\u30bd\u30fc\u30c8\u3059\u308b\u5834\u5408\u3001\u8907\u6570\u306e\u30c1\u30e3\u30f3\u30af\u306b\u5206\u5272\u3057\u3066\u90e8\u5206\u30bd\u30fc\u30c8\u3092\u884c\u3044\u3001\u5f8c\u3067CPU\u5074\u3067\u3053\u308c\u3092\u7d50\u5408\u3057\u3066\u6700\u7d42\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u7d50\u5408\u30d5\u30a7\u30fc\u30ba\u306e\u51e6\u7406\u3092\u8efd\u304f\u3059\u308b\u306b\u306f\u3001GPU\u3067\u30bd\u30fc\u30c8\u3059\u3079\u304d\u30c1\u30e3\u30f3\u30af\u306e\u30b5\u30a4\u30ba\u3092\u5927\u304d\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u4e00\u65b9\u3067\u30c1\u30e3\u30f3\u30af\u30b5\u30a4\u30ba\u304c\u5927\u304d\u304f\u306a\u308b\u3068\u30bd\u30fc\u30c8\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\u305f\u3081\u306e\u30ea\u30fc\u30c9\u30bf\u30a4\u30e0\u304c\u9577\u304f\u306a\u308a\u3001PG-Strom\u306e\u7279\u9577\u306e\u4e00\u3064\u3067\u3042\u308b\u975e\u540c\u671f\u51e6\u7406\u306b\u3088\u308b\u30c7\u30fc\u30bf\u8ee2\u9001\u30ec\u30a4\u30c6\u30f3\u30b7\u306e\u96a0\u307a\u3044\u304c\u52b9\u304b\u306a\u304f\u306a\u308b\u3068\u3044\u3046\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u554f\u984c\u306b\u5bfe\u51e6\u3059\u308b\u306e\u306f\u56f0\u96e3\u3001\u5c11\u306a\u304f\u3068\u3082\u6642\u671f\u5c1a\u65e9\u3067\u3042\u308b\u3068\u5224\u65ad\u3057\u3001GpuSort\u6a5f\u80fd\u306f\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002","title":"PG-Strom v2.0"},{"location":"release_v2.0/#pg-strom-v20","text":"PG-Strom Development Team (17-Apr-2018)","title":"PG-Strom v2.0\u30ea\u30ea\u30fc\u30b9"},{"location":"release_v2.0/#_1","text":"PG-Strom v2.0\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u6a5f\u80fd\u5f37\u5316\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 GPU\u3092\u7ba1\u7406\u3059\u308b\u5185\u90e8\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u306e\u5168\u4f53\u7684\u306a\u518d\u8a2d\u8a08\u3068\u5b89\u5b9a\u5316 CPU+GPU\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u4e26\u5217\u5b9f\u884c SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2(store_fdw) GpuJoin\u3068GpuPreAgg\u306e\u518d\u8a2d\u8a08\u306b\u4f34\u3046\u9ad8\u901f\u5316 GpuPreAgg+GpuJoin+GpuScan \u5bc6\u7d50\u5408GPU\u30ab\u30fc\u30cd\u30eb \u65b0\u6a5f\u80fd\u306e\u30b5\u30de\u30ea\u306f\u3053\u3061\u3089\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\uff1a PG-Strom v2.0 Technical Brief .","title":"\u6982\u8981"},{"location":"release_v2.0/#_2","text":"PostgreSQL v9.6, v10 CUDA Toolkit 9.1 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d)","title":"\u52d5\u4f5c\u74b0\u5883"},{"location":"release_v2.0/#_3","text":"GPU\u3092\u7ba1\u7406\u3059\u308b\u5185\u90e8\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u306e\u5168\u4f53\u7684\u306a\u518d\u8a2d\u8a08\u3068\u5b89\u5b9a\u5316 PostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306f\u540c\u6642\u306b\uff11\u500b\u306eGPU\u3060\u3051\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u30de\u30eb\u30c1GPU\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u306fPostgreSQL\u306eCPU\u4e26\u5217\u3068\u306e\u4f75\u7528\u304c\u524d\u63d0\u306b\u306a\u308a\u307e\u3059\u304c\u3001CPU\u30b9\u30ec\u30c3\u30c9\u304cGPU\u3078\u30c7\u30fc\u30bf\u3092\u4f9b\u7d66\u3059\u308b\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u306fGPU\u306e\u51e6\u7406\u80fd\u529b\u3088\u308a\u3082\u305a\u3063\u3068\u4f4e\u3044\u305f\u3081\u3001\u901a\u5e38\u3001\u3053\u308c\u306f\u554f\u984c\u3068\u306f\u306a\u308a\u307e\u305b\u3093\u3002\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u8a2d\u8a08\u306e\u30b7\u30f3\u30d7\u30eb\u5316\u3092\u512a\u5148\u3057\u307e\u3057\u305f\u3002 Pascal\u4e16\u4ee3\u4ee5\u964d\u306eGPU\u3067\u63a1\u7528\u3055\u308c\u305fGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30c7\u30de\u30f3\u30c9\u30da\u30fc\u30b8\u30f3\u30b0\u3092\u307b\u307c\u5168\u9762\u7684\u306b\u63a1\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u591a\u304f\u306f\u5b9f\u969b\u306b\u5b9f\u884c\u3057\u3066\u307f\u308b\u307e\u3067\u5fc5\u8981\u306a\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u306e\u5927\u304d\u3055\u304c\u5206\u304b\u3089\u306a\u3044\u305f\u3081\u3001\u3053\u308c\u307e\u3067\u306f\u5fc5\u8981\u4ee5\u4e0a\u306b\u30d0\u30c3\u30d5\u30a1\u3092\u7372\u5f97\u3057\u3001\u307e\u305f\u30e1\u30e2\u30ea\u4e0d\u8db3\u6642\u306b\u306f\u518d\u5b9f\u884c\u3092\u884c\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u3089\u306f\u540c\u6642\u5b9f\u884c\u30d7\u30ed\u30bb\u30b9\u306e\u5229\u7528\u53ef\u80fd\u306a\u30ea\u30bd\u30fc\u30b9\u3092\u5236\u9650\u3057\u3001\u307e\u305f\u8907\u96d1\u306a\u4f8b\u5916\u30ed\u30b8\u30c3\u30af\u306f\u30d0\u30b0\u306e\u6e29\u5e8a\u3067\u3057\u305f\u3002GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30c7\u30de\u30f3\u30c9\u30da\u30fc\u30b8\u30f3\u30b0\u3092\u5229\u7528\u3059\u308b\u4e8b\u3067\u3001\u8a2d\u8a08\u306e\u30b7\u30f3\u30d7\u30eb\u5316\u3092\u884c\u3044\u307e\u3057\u305f\u3002 CUDA\u306e\u975e\u540c\u671f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5229\u7528\u3092\u6b62\u3081\u307e\u3057\u305f\u3002GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30c7\u30de\u30f3\u30c9\u30da\u30fc\u30b8\u30f3\u30b0\u3092\u5229\u7528\u3059\u308b\u3068\u3001DMA\u8ee2\u9001\u306e\u305f\u3081\u306e\u975e\u540c\u671fAPI\uff08 cuMemCpyHtoD \u306a\u3069\uff09\u306f\u540c\u671f\u7684\u306b\u632f\u821e\u3046\u3088\u3046\u306b\u306a\u308b\u305f\u3081\u3001GPU\u30ab\u30fc\u30cd\u30eb\u306e\u591a\u91cd\u5ea6\u304c\u4f4e\u4e0b\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u4ee3\u308f\u308a\u306bPG-Strom\u81ea\u8eab\u304c\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u3092\u7ba1\u7406\u3057\u3001\u3053\u308c\u3089\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u305d\u308c\u305e\u308c\u540c\u671fAPI\u3092\u547c\u3073\u51fa\u3059\u3088\u3046\u8a2d\u8a08\u5909\u66f4\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u526f\u7523\u7269\u3068\u3057\u3066\u3001\u975e\u540c\u671f\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\uff08 cuStreamAddCallback \uff09\u3092\u5229\u7528\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u3063\u305f\u306e\u3067\u3001MPS\u3092\u5229\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 CPU+GPU\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u4e26\u5217\u5b9f\u884c PostgreSQL v9.6\u3067\u65b0\u305f\u306b\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u305fCPU\u4e26\u5217\u5b9f\u884c\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 PG-Strom\u306e\u63d0\u4f9b\u3059\u308bGpuScan\u3001GpuJoin\u304a\u3088\u3073GpuPreAgg\u306e\u5404\u30ed\u30b8\u30c3\u30af\u306f\u8907\u6570\u306ePostgreSQL\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306b\u3088\u308a\u4e26\u5217\u306b\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 PostgreSQL v9.6\u3067\u306fCPU\u4e26\u5217\u5b9f\u884c\u306e\u969b\u306b EXPLAIN ANALYZE \u3067\u53d6\u5f97\u3059\u308bPG-Strom\u72ec\u81ea\u306e\u7d71\u8a08\u60c5\u5831\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001CustomScan\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9API\u3067 ShutdownCustomScan \u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u305f\u3081\u3001DSM\uff08\u52d5\u7684\u5171\u6709\u30e1\u30e2\u30ea\uff09\u306e\u89e3\u653e\u524d\u306b\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u30d7\u30ed\u30bb\u30b9\u304c\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306e\u60c5\u5831\u3092\u56de\u53ce\u3059\u308b\u624b\u6bb5\u304c\u7121\u304b\u3063\u305f\u305f\u3081\u3067\u3059\u3002 SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c Linux\u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb nvme_strom \u3092\u7528\u3044\u308b\u4e8b\u3067\u3001NVMe\u898f\u683c\u306b\u5bfe\u5fdc\u3057\u305fSSD\u4e0a\u306ePostgreSQL\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092\u3001CPU/RAM\u3092\u4ecb\u3055\u305a\u30c0\u30a4\u30ec\u30af\u30c8\u306bGPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u3078\u8ee2\u9001\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002\u30b7\u30b9\u30c6\u30e0RAM\u306b\u8f09\u308a\u5207\u3089\u306a\u3044\u5927\u304d\u3055\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u3067\u3042\u3063\u3066\u3082\u3001\u672c\u6a5f\u80fd\u306b\u3088\u308aPG-Strom\u306e\u9069\u7528\u304c\u73fe\u5b9f\u7684\u306a\u9078\u629e\u80a2\u3068\u306a\u308b\u4e8b\u3067\u3057\u3087\u3046\u3002 \u30d6\u30ed\u30c3\u30af\u30c7\u30d0\u30a4\u30b9\u5c64\u3084\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u7d4c\u7531\u3057\u306a\u3044\u305f\u3081\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9650\u754c\u306b\u8fd1\u3044\u9ad8\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u3092\u5f15\u304d\u51fa\u3059\u4e8b\u304c\u53ef\u80fd\u3067\u3001\u304b\u3064\u3001GPU\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u51e6\u7406\u3059\u308b\u305f\u3081CPU\u306e\u51e6\u7406\u3059\u3079\u304d\u30c7\u30fc\u30bf\u91cf\u3092\u6e1b\u3089\u3059\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u7279\u6027\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u3088\u308a\u3001\u4e00\u822c\u7684\u306b\u306f\u8a08\u7b97\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u30a2\u30af\u30bb\u30e9\u30ec\u30fc\u30bf\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u3066\u3044\u308bGPU\u3092\u3001I/O\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u9ad8\u901f\u5316\u306b\u9069\u7528\u3059\u308b\u4e8b\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002 \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5 RAM\u30b5\u30a4\u30ba\u306b\u8f09\u308b\u7a0b\u5ea6\u306e\u5927\u304d\u3055\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u306f\u3001\u3088\u308aGPU\u3067\u306e\u51e6\u7406\u306b\u9069\u3057\u305f\u5217\u30c7\u30fc\u30bf\u5f62\u5f0f\u306b\u5909\u5f62\u3057\u3066\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u306b\u969b\u3057\u3066\u3001\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306b\u306fPostgreSQL\u306e\u5171\u6709\u30d0\u30c3\u30d5\u30a1\u3088\u308a\u3082\u3053\u3061\u3089\u3092\u512a\u5148\u3057\u3066\u53c2\u7167\u3057\u307e\u3059\u3002 \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u540c\u671f\u7684\u3001\u307e\u305f\u306f\u975e\u540c\u671f\u7684\u306b\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u521d\u671f\u306ePG-Strom\u3067\u4f3c\u305f\u3088\u3046\u306a\u6a5f\u80fd\u304c\u5b58\u5728\u3057\u3066\u3044\u305f\u4e8b\u3092\u899a\u3048\u3066\u304a\u3089\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002v2.0\u3067\u65b0\u305f\u306b\u5b9f\u88c5\u3055\u308c\u305f\u5217\u6307\u5411\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u3055\u308c\u305f\u884c\u304c\u66f4\u65b0\u3055\u308c\u308b\u3068\u3001\u5f53\u8a72\u884c\u3092\u542b\u3080\u30ad\u30e3\u30c3\u30b7\u30e5\u30d6\u30ed\u30c3\u30af\u3092\u6d88\u53bb\uff08invalidation\uff09\u3057\u307e\u3059\u3002\u884c\u30b9\u30c8\u30a2\u306e\u66f4\u65b0\u306b\u5408\u308f\u305b\u3066\u5217\u30ad\u30e3\u30c3\u30b7\u30e5\u5074\u306e\u66f4\u65b0\u3092\u884c\u3046\u3068\u3044\u3046\u4e8b\u306f\u884c\u308f\u306a\u3044\u305f\u3081\u3001\u66f4\u65b0\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u5bfe\u3059\u308b\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u4f4e\u4e0b\u306f\u9650\u5b9a\u7684\u3067\u3059\u3002 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2(gstore_fdw) GPU\u4e0a\u306b\u78ba\u4fdd\u3057\u305f\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u9818\u57df\u306b\u5bfe\u3057\u3066\u3001\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\uff08Foreign Table\uff09\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5229\u7528\u3057\u3066SQL\u306eSELECT/INSERT/UPDATE/DELETE\u306b\u3088\u308a\u8aad\u307f\u66f8\u304d\u3092\u884c\u3046\u6a5f\u80fd\u3067\u3059\u3002 \u5185\u90e8\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f pgstrom \u578b\u306e\u307f\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001PG-Strom\u306e\u30d0\u30c3\u30d5\u30a1\u5f62\u5f0f KDS_FORMAT_COLUMN \u30bf\u30a4\u30d7\u3068\u540c\u4e00\u306e\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3059\u308b\u3082\u306e\u3067\u3059\u3002\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b\u5834\u5408\u3001LZ\u65b9\u5f0f\u306b\u3088\u308b\u30c7\u30fc\u30bf\u5727\u7e2e\u3092\u884c\u3046\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002 v2.0\u306e\u6642\u70b9\u3067\u306f\u3001GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u306fPL/CUDA\u95a2\u6570\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u3060\u3051\u5229\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 GpuJoin\u3068GpuPreAgg\u306e\u518d\u8a2d\u8a08\u306b\u4f34\u3046\u9ad8\u901f\u5316 \u5f93\u6765\u3001GpuJoin\u3068GpuPreAgg\u3067\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3057\u3066\u3044\u305fDynamic Parallelism\u306e\u5229\u7528\u3092\u3084\u3081\u3001\u51e6\u7406\u30ed\u30b8\u30c3\u30af\u5168\u4f53\u306e\u898b\u76f4\u3057\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u3053\u308c\u306f\u3001GPU\u30b5\u30d6\u30ab\u30fc\u30cd\u30eb\u306e\u8d77\u52d5\u5f8c\u3001\u305d\u306e\u5b8c\u4e86\u3092\u5358\u306b\u5f85\u3063\u3066\u3044\u308b\u3060\u3051\u306eGPU\u30ab\u30fc\u30cd\u30eb\u304c\u5b9f\u884c\u30b9\u30ed\u30c3\u30c8\u3092\u5360\u6709\u3057\u3001GPU\u306e\u4f7f\u7528\u7387\u304c\u4e0a\u304c\u3089\u306a\u3044\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u3063\u305f\u305f\u3081\u3067\u3059\u3002 \u3053\u306e\u518d\u8a2d\u8a08\u306b\u4f34\u3046\u526f\u7523\u7269\u3068\u3057\u3066\u3001GpuJoin\u306e\u30b5\u30b9\u30da\u30f3\u30c9/\u30ec\u30b8\u30e5\u30fc\u30e0\u6a5f\u80fd\u304c\u5b9f\u88c5\u3055\u308c\u307e\u3057\u305f\u3002\u539f\u7406\u4e0a\u3001SQL\u306eJOIN\u51e6\u7406\u306f\u5165\u529b\u3057\u305f\u884c\u6570\u3088\u308a\u3082\u51fa\u529b\u3059\u308b\u884c\u6570\u306e\u65b9\u304c\u5897\u3048\u3066\u3057\u307e\u3046\u4e8b\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u51e6\u7406\u7d50\u679c\u3092\u66f8\u304d\u8fbc\u3080\u30d0\u30c3\u30d5\u30a1\u306e\u6b8b\u308a\u30b5\u30a4\u30ba\u304c\u4e0d\u8db3\u3057\u305f\u6642\u70b9\u3067GpuJoin\u3092\u30b5\u30b9\u30da\u30f3\u30c9\u3057\u3001\u65b0\u3057\u3044\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u3092\u5272\u308a\u5f53\u3066\u3066\u30ec\u30b8\u30e5\u30fc\u30e0\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u306e\u30b5\u30a4\u30ba\u63a8\u5b9a\u304c\u7c21\u7565\u5316\u3055\u308c\u305f\u307b\u304b\u3001\u5b9f\u884c\u6642\u306e\u30d0\u30c3\u30d5\u30a1\u4e0d\u8db3\u306b\u3088\u308b\u518d\u5b9f\u884c\u306e\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002 GpuPreAgg+GpuJoin+GpuScan \u5bc6\u7d50\u5408GPU\u30ab\u30fc\u30cd\u30eb GPU\u3067\u5b9f\u884c\u53ef\u80fd\u306aSCAN\u3001JOIN\u3001GROUP BY\u304c\u9023\u7d9a\u3057\u3066\u3044\u308b\u3068\u304d\u3001\u5bfe\u5fdc\u3059\u308bGpuScan\u3001GpuJoin\u3001GpuPreAgg\u306b\u76f8\u5f53\u3059\u308b\u51e6\u7406\u3092\u4e00\u56de\u306eGPU\u30ab\u30fc\u30cd\u30eb\u547c\u3073\u51fa\u3057\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306f\u3001GpuJoin\u306e\u7d50\u679c\u30d0\u30c3\u30d5\u30a1\u3092\u305d\u306e\u307e\u307eGpuPreAgg\u306e\u5165\u529b\u30d0\u30c3\u30d5\u30a1\u3068\u3057\u3066\u6271\u3046\u306a\u3069\u3001CPU\u3068GPU\u306e\u9593\u306e\u30c7\u30fc\u30bf\u4ea4\u63db\u3092\u6700\u5c0f\u9650\u306b\u6291\u3048\u308b\u305f\u3081\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u3059\u3002 \u3053\u306e\u6a5f\u80fd\u306f\u7279\u306b\u3001SSD-to-GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3059\u308b\u3068\u52b9\u679c\u7684\u3067\u3059\u3002 \u65b0\u3057\u3044\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc uuid \u578b\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u578b\uff08 inet \u3001 cidr \u3001\u304a\u3088\u3073 macaddr \uff09\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u7bc4\u56f2\u578b\uff08 int4range \u3001 int8range \u3001 tsrange \u3001 tstzrange \u3001 daterange \uff09\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\uff08 float2 \uff09\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u534a\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306b\u95a2\u9023\u3059\u308bCPU\u5074\u306e\u5b9f\u88c5\u306fPG-Strom\u306e\u72ec\u81ea\u5b9f\u88c5\u306b\u3088\u308b\u3082\u306e\u3067\u3059\u3002 \u65b0\u3057\u3044\u6f14\u7b97\u5b50/\u95a2\u6570\u306e\u5bfe\u5fdc \u65e5\u4ed8\u6642\u523b\u578b\u306b\u5bfe\u3059\u308b EXTRACT(field FROM timestamp) \u6f14\u7b97\u5b50\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 New data type support uuid type Network address types ( inet , cidr and macaddr ) Range data types ( int4range , int8range , tsrange , tstzrange , daterange ) Half-precision floating point type ( float2 ). Its CPU side are also implemented by PG-Strom itself, not PostgreSQL's built-in feature. New operators / functions EXTRACT(field FROM timestamp) operator on the date and time types PL/CUDA\u95a2\u9023\u306e\u5f37\u5316 #plcuda_include \u306e\u62e1\u5f35\u306b\u3088\u308a\u3001 text \u578b\u3092\u8fd4\u3059SQL\u95a2\u6570\u3092\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u5f15\u6570\u306e\u5024\u306b\u3088\u3063\u3066\u633f\u5165\u3059\u308b\u30b3\u30fc\u30c9\u3092\u5909\u3048\u308b\u4e8b\u304c\u3067\u304d\u308b\u305f\u3081\u3001\u5358\u306b\u5916\u90e8\u5b9a\u7fa9\u95a2\u6570\u3092\u8aad\u307f\u8fbc\u3080\u3060\u3051\u3067\u306a\u304f\u3001\u52d5\u7684\u306b\u3044\u304f\u3064\u3082\u306eGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308a\u51fa\u3059\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002 PL/CUDA\u95a2\u6570\u306e\u5f15\u6570\u306b reggstore \u578b\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001GPU\u30ab\u30fc\u30cd\u30eb\u95a2\u6570\u3078\u306f\u5bfe\u5fdc\u3059\u308bGPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u306e\u30dd\u30a4\u30f3\u30bf\u304c\u6e21\u3055\u308c\u307e\u3059\u3002OID\u5024\u304c\u6e21\u3055\u308c\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u305d\u306e\u4ed6\u306e\u6a5f\u80fd\u5f37\u5316 lo_import_gpu \u304a\u3088\u3073 lo_export_gpu \u95a2\u6570\u306b\u3088\u308a\u3001\u5916\u90e8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u78ba\u4fdd\u3057\u305fGPU\u30e1\u30e2\u30ea\u306e\u5185\u5bb9\u3092\u76f4\u63a5PostgreSQL\u306e\u30e9\u30fc\u30b8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u8a18\u9332\u3057\u305f\u308a\u3001\u9006\u306b\u30e9\u30fc\u30b8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5185\u5bb9\u3092GPU\u30e1\u30e2\u30ea\u306b\u66f8\u304d\u51fa\u3059\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u30d1\u30c3\u30b1\u30fc\u30b8\u30f3\u30b0 PostgreSQL Global Development Group\u306e\u914d\u5e03\u3059\u308bPostgreSQL\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u9069\u5408\u3059\u308b\u3088\u3046\u3001RPM\u30d1\u30c3\u30b1\u30fc\u30b8\u5316\u3092\u884c\u3044\u307e\u3057\u305f\u3002 \u5168\u3066\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u7269\u4ef6\u306fHeteroDB SWDC(Software Distribution Center)\u3088\u308a\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u53ef\u80fd\u3067\u3059\u3002 \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 PG-Strom\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092markdown\u3068mkdocs\u3092\u7528\u3044\u3066\u5168\u9762\u7684\u306b\u66f8\u304d\u76f4\u3057\u307e\u3057\u305f\u3002\u5f93\u6765\u306eHTML\u3092\u7528\u3044\u305f\u30a2\u30d7\u30ed\u30fc\u30c1\u306b\u6bd4\u3079\u3001\u3088\u308a\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u304c\u5bb9\u6613\u3067\u65b0\u6a5f\u80fd\u306e\u958b\u767a\u306b\u5408\u308f\u305b\u305f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u62e1\u5145\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002 \u30c6\u30b9\u30c8 PostgreSQL\u306e\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u7528\u3057\u3066\u3001PG-Strom\u306e\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002","title":"\u65b0\u6a5f\u80fd"},{"location":"release_v2.0/#_4","text":"PostgreSQL v9.5\u30b5\u30dd\u30fc\u30c8 PostgreSQL v9.6\u3067\u306fCPU\u4e26\u5217\u30af\u30a8\u30ea\u306e\u63d0\u4f9b\u306b\u4f34\u3044\u3001\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6/\u30a8\u30b0\u30bc\u30ad\u30e5\u30fc\u30bf\u5171\u306b\u5927\u304d\u306a\u4fee\u6b63\u304c\u52a0\u3048\u3089\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u3068\u5bc6\u63a5\u306b\u9023\u643a\u3059\u308b\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u3068\u3063\u3066\u6700\u3082\u30a4\u30f3\u30d1\u30af\u30c8\u306e\u5927\u304d\u306a\u5909\u66f4\u306f\u300eupper planner path-ification\u300f\u3068\u547c\u3070\u308c\u308b\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5f37\u5316\u3067\u3001\u96c6\u7d04\u6f14\u7b97\u3084\u30bd\u30fc\u30c8\u306a\u3069\u306e\u5b9f\u884c\u8a08\u753b\u3082\u30b3\u30b9\u30c8\u30d9\u30fc\u30b9\u3067\u8907\u6570\u306e\u7570\u306a\u308b\u65b9\u6cd5\u3092\u6bd4\u8f03\u3057\u3066\u6700\u9069\u306a\u3082\u306e\u3092\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u3053\u308c\u306fGpuPreAgg\u3092\u5b9f\u88c5\u3059\u308b\u305f\u3081\u306b\u30d5\u30c3\u30af\u3092\u5229\u7528\u3057\u3066\u5b9f\u884c\u8a08\u753b\u3092\u66f8\u304d\u63db\u3048\u3066\u3044\u305f\u5f93\u6765\u306e\u65b9\u6cd5\u3068\u306f\u6839\u672c\u7684\u306b\u7570\u306a\u308a\u3001\u3088\u308a\u5408\u7406\u7684\u304b\u3064\u4fe1\u983c\u3067\u304d\u308b\u65b9\u6cd5\u3067GPU\u3092\u7528\u3044\u305f\u96c6\u7d04\u6f14\u7b97\u3092\u633f\u5165\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u3001\u30d0\u30b0\u306e\u6e29\u5e8a\u3067\u3042\u3063\u305f\u5b9f\u884c\u8a08\u753b\u306e\u66f8\u304d\u63db\u3048\u30ed\u30b8\u30c3\u30af\u3092\u6368\u3066\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u540c\u6642\u306b\u3001CustomScan\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u3082CPU\u4e26\u5217\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u306eAPI\u304c\u62e1\u5f35\u3055\u308c\u3001\u3053\u308c\u3089\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u306bPostgreSQL v9.5\u30b5\u30dd\u30fc\u30c8\u306f\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002 GpuSort\u6a5f\u80fd GpuSort\u6a5f\u80fd\u306f\u6027\u80fd\u4e0a\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u5f97\u3089\u308c\u306a\u3044\u305f\u3081\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002 \u30bd\u30fc\u30c8\u306fGPU\u306e\u5f97\u610f\u3068\u3059\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u4e00\u3064\u3067\u3059\u3002\u3057\u304b\u3057\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u5927\u304d\u3055\u3092\u8d8a\u3048\u308b\u30b5\u30a4\u30ba\u306e\u30c7\u30fc\u30bf\u3092\u30bd\u30fc\u30c8\u3059\u308b\u5834\u5408\u3001\u8907\u6570\u306e\u30c1\u30e3\u30f3\u30af\u306b\u5206\u5272\u3057\u3066\u90e8\u5206\u30bd\u30fc\u30c8\u3092\u884c\u3044\u3001\u5f8c\u3067CPU\u5074\u3067\u3053\u308c\u3092\u7d50\u5408\u3057\u3066\u6700\u7d42\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u7d50\u5408\u30d5\u30a7\u30fc\u30ba\u306e\u51e6\u7406\u3092\u8efd\u304f\u3059\u308b\u306b\u306f\u3001GPU\u3067\u30bd\u30fc\u30c8\u3059\u3079\u304d\u30c1\u30e3\u30f3\u30af\u306e\u30b5\u30a4\u30ba\u3092\u5927\u304d\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u4e00\u65b9\u3067\u30c1\u30e3\u30f3\u30af\u30b5\u30a4\u30ba\u304c\u5927\u304d\u304f\u306a\u308b\u3068\u30bd\u30fc\u30c8\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\u305f\u3081\u306e\u30ea\u30fc\u30c9\u30bf\u30a4\u30e0\u304c\u9577\u304f\u306a\u308a\u3001PG-Strom\u306e\u7279\u9577\u306e\u4e00\u3064\u3067\u3042\u308b\u975e\u540c\u671f\u51e6\u7406\u306b\u3088\u308b\u30c7\u30fc\u30bf\u8ee2\u9001\u30ec\u30a4\u30c6\u30f3\u30b7\u306e\u96a0\u307a\u3044\u304c\u52b9\u304b\u306a\u304f\u306a\u308b\u3068\u3044\u3046\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u554f\u984c\u306b\u5bfe\u51e6\u3059\u308b\u306e\u306f\u56f0\u96e3\u3001\u5c11\u306a\u304f\u3068\u3082\u6642\u671f\u5c1a\u65e9\u3067\u3042\u308b\u3068\u5224\u65ad\u3057\u3001GpuSort\u6a5f\u80fd\u306f\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002","title":"\u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd"},{"location":"release_v2.2/","text":"PG-Strom v2.2\u30ea\u30ea\u30fc\u30b9 PG-Strom Development Team (1-May-2019) \u6982\u8981 PG-Strom v2.2\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u6a5f\u80fd\u5f37\u5316\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3078\u306e\u5bfe\u5fdc Arrow_Fdw\u306b\u3088\u308b\u5217\u6307\u5411\u30b9\u30c8\u30a2\u306e\u30b5\u30dd\u30fc\u30c8 \u30d3\u30eb\u30c9\u6e08\u307fGPU\u30d0\u30a4\u30ca\u30ea\u3078\u306e\u5bfe\u5fdc Jsonb\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc \u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b\u3092\u8fd4\u3059GPU\u95a2\u6570\u306e\u5bfe\u5fdc GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\uff08Gstore_Fdw\uff09\u306e\u30bd\u30fc\u30c8\u5bfe\u5fdc NVMEoF\u3078\u306e\u5bfe\u5fdc\uff08\u5b9f\u9a13\u7684\u6a5f\u80fd\uff09 \u52d5\u4f5c\u74b0\u5883 PostgreSQL v9.6, v10, v11 CUDA Toolkit 10.1 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d) \u65b0\u6a5f\u80fd \u30c6\u30fc\u30d6\u30eb\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3078\u306e\u5bfe\u5fdc \u30de\u30eb\u30c1GPU\u69cb\u6210\u306e\u5834\u5408\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3092\u69cb\u6210\u3059\u308b\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u7269\u7406\u7684\u306aGPU\u3068\u306e\u8ddd\u96e2\u306b\u5fdc\u3058\u3066\u6700\u9069\u306aGPU\u3092\u9078\u629e\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002NVME-oF\u74b0\u5883\u306a\u3069PCIe\u30d0\u30b9\u306e\u69cb\u6210\u3060\u3051\u3067\u306f\u6700\u9069\u8ddd\u96e2\u3092\u5224\u65ad\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u3001DB\u7ba1\u7406\u8005\u306f pg_strom.nvme_distance_map \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u7528\u3044\u3066\u5bfe\u5fdc\u95a2\u4fc2\u3092\u8a2d\u5b9a\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3068\u306eJOIN\u6642\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3068\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3068\u306eJOIN\u3092\u884c\u3063\u305f\u5f8c\u3001\u5404\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u51e6\u7406\u7d50\u679c\u3092\u7d50\u5408\u3059\u308b\u3088\u3046\u306a\u5b9f\u884c\u8a08\u753b\u3092\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u672c\u6a5f\u80fd\u306f Asymmetric Partition-wise JOIN \u3068\u3044\u3046\u540d\u79f0\u3067PostgreSQL v13\u306e\u672c\u4f53\u6a5f\u80fd\u3078\u3068\u63d0\u6848\u3055\u308c\u3066\u3044\u307e\u3059\u3002 Arrow_Fdw\u306b\u3088\u308b\u5217\u6307\u5411\u30b9\u30c8\u30a2\u306e\u30b5\u30dd\u30fc\u30c8 \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u7d4c\u7531\u3067Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u51fa\u3057\u306b\u5bfe\u5fdc\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 SSD-to-GPU Direct SQL\u3092\u7528\u3044\u305fApache Arrow\u306e\u8aad\u307f\u51fa\u3057\u3068SQL\u5b9f\u884c\u306b\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 \u30d3\u30eb\u30c9\u6e08\u307fGPU\u30d0\u30a4\u30ca\u30ea\u3078\u306e\u5bfe\u5fdc SQL\u304b\u3089GPU\u30d0\u30a4\u30ca\u30ea\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b\u969b\u3001\u5f93\u6765\u306f\u52d5\u7684\u306b\u5909\u66f4\u3059\u308b\u8981\u7d20\u306e\u306a\u3044\u95a2\u6570\u7fa4\uff08\u30e9\u30a4\u30d6\u30e9\u30ea\u95a2\u6570\u306b\u9177\u4f3c\uff09\u3082\u542b\u3081\u3066CUDA C\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3057\u3001\u305d\u308c\u3092NVRTC(NVIDIA Run-Time Compiler)\u3092\u7528\u3044\u3066\u30d3\u30eb\u30c9\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u4e00\u90e8\u306e\u8907\u96d1\u306a\u95a2\u6570\u306e\u5f71\u97ff\u3067\u30d3\u30eb\u30c9\u6642\u9593\u304c\u6975\u7aef\u306b\u9577\u304f\u306a\u308b\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002 v2.2\u306b\u304a\u3044\u3066\u3001\u9759\u7684\u306a\u95a2\u6570\u7fa4\u306f\u4e8b\u524d\u306b\u30d3\u30eb\u30c9\u3055\u308c\u3001SQL\u304b\u3089\u52d5\u7684\u306b\u751f\u6210\u3059\u308b\u90e8\u5206\u306e\u307f\u3092\u5b9f\u884c\u6642\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001GPU\u30d0\u30a4\u30ca\u30ea\u306e\u751f\u6210\u6642\u9593\u304c\u5927\u5e45\u306b\u6e1b\u5c11\u3059\u308b\u4e8b\u3068\u306a\u308a\u307e\u3057\u305f\u3002 JSONB\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc GPU\u5074\u3067JSONB\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5b50\u8981\u7d20\u3092\u53c2\u7167\u3057\u3001 numeric \u3084 text \u5024\u3068\u3057\u3066\u6761\u4ef6\u53e5\u306a\u3069\u3067\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002 \u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b\u3092\u8fd4\u3059GPU\u95a2\u6570\u306e\u5bfe\u5fdc textcat \u306a\u3069\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b\u3092\u8fd4\u3059SQL\u95a2\u6570\u3092GPU\u5074\u3067\u5b9f\u88c5\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\uff08Gstore_Fdw\uff09\u306e\u30bd\u30fc\u30c8\u5bfe\u5fdc PL/CUDA\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u4ee5\u5916\u306b\u3001GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3057\u3066\u5b9f\u884c\u3059\u308bSQL\u3092GPU\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u5bfe\u5fdc\u3057\u3066\u3044\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306fGpuScan\u304a\u3088\u3073GpuSort\u306e\uff12\u7a2e\u985e\u3067\u3001JOIN\u304a\u3088\u3073GROUP BY\u306b\u306f\u307e\u3060\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002 \u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u306e\u8ffd\u52a0 \u7c21\u6613\u306a\u30c6\u30b9\u30c8\u306e\u305f\u3081\u3001\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 NVME-oF\u3078\u306e\u5bfe\u5fdc\uff08\u5b9f\u9a13\u7684\u6a5f\u80fd\uff09 NVME-over-Fabric\u3092\u7528\u3044\u3066\u30de\u30a6\u30f3\u30c8\u3055\u308c\u305f\u30ea\u30e2\u30fc\u30c8\u306eNVME\u30c7\u30a3\u30b9\u30af\u304b\u3089\u306eSSD-to-GPU Direct SQL\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u305f\u3060\u3057\u3001Red Hat Enterprise Linux 7.x / CentOS 7.x\u3067\u306f nvme_rdma \u30c9\u30e9\u30a4\u30d0\u306e\u5165\u308c\u66ff\u3048\u304c\u5fc5\u8981\u3068\u306a\u308a\u3001\u73fe\u5728\u306e\u3068\u3053\u308d\u5b9f\u9a13\u7684\u6a5f\u80fd\u3068\u3044\u3046\u5f62\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 \u5c06\u6765\u5ec3\u6b62\u4e88\u5b9a\u306e\u6a5f\u80fd PostgreSQL v9.6\u30b5\u30dd\u30fc\u30c8 PostgreSQL v9.6\u306eCustomScan API\u306b\u306f\u3001\u52d5\u7684\u5171\u6709\u30e1\u30e2\u30ea(DSM)\u306e\u6b63\u3057\u3044\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306b\u5fc5\u8981\u306a\u5e7e\u3064\u304b\u306eAPI\u304c\u6b20\u3051\u3066\u304a\u308a\u3001\u5b9f\u884c\u6642\u7d71\u8a08\u60c5\u5831\u306e\u63a1\u53d6\u306a\u3069\u304c\u4e0d\u53ef\u80fd\u3067\u3057\u305f\u3002 \u307e\u305f\u3001\u5185\u90e8\u7684\u306b\u5f0f\u8868\u73fe(Expression)\u3092\u4fdd\u6301\u3059\u308b\u305f\u3081\u306e\u65b9\u6cd5\u306b\u3082\u5909\u66f4\u304c\u52a0\u3048\u3089\u308c\u3066\u3044\u308b\u4e8b\u304b\u3089\u3001\u5c11\u306a\u304f\u306a\u3044\u7b87\u6240\u3067 #if ... #endif \u30d6\u30ed\u30c3\u30af\u304c\u5fc5\u8981\u3068\u306a\u308a\u3001\u30b3\u30fc\u30c9\u306e\u4fdd\u5b88\u6027\u3092\u640d\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002 \u3053\u308c\u3089\u306e\u554f\u984c\u306b\u3088\u308a\u3001PostgreSQL v9.6\u30b5\u30dd\u30fc\u30c8\u306f\u672c\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u6700\u5f8c\u3068\u306a\u308a\u307e\u3059\u3002PG-Strom\u3092PostgreSQL v9.6\u3067\u304a\u4f7f\u3044\u306e\u5834\u5408\u306f\u3001\u65e9\u671f\u306bPostgreSQL v11\u3078\u3068\u79fb\u884c\u3055\u308c\u308b\u4e8b\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002 Gstore_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306epgstrom\u30d5\u30a9\u30fc\u30de\u30c3\u30c8 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u4e0a\u306e\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f\u3001\u5143\u3005PL/CUDA\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u305f\u72ec\u81ea\u306e\u5217\u5f62\u5f0f\u3067\u3001\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u3084numeric\u30c7\u30fc\u30bf\u578b\u306e\u8868\u73fe\u306fPostgreSQL\u306e\u3082\u306e\u3092\u305d\u306e\u307e\u307e\u5229\u7528\u3057\u3066\u3044\u307e\u3057\u305f\u3002 \u305d\u306e\u5f8c\u3001GPU\u4e0a\u3067\u306e\u30c7\u30fc\u30bf\u4ea4\u63db\u7528\u5171\u901a\u5f62\u5f0f\u3068\u3057\u3066\u3001Apache Arrow\u5f62\u5f0f\u3092\u5143\u306b\u3057\u305fNVIDIA RAPIDS(cuDF)\u304c\u516c\u958b\u3055\u308c\u3001\u591a\u304f\u306e\u6a5f\u68b0\u5b66\u7fd2\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3084Python\u3067\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30b9\u30bf\u30c3\u30af\u306a\u3069\u5bfe\u5fdc\u304c\u5f37\u5316\u3055\u308c\u3064\u3064\u3042\u308a\u307e\u3059\u3002 \u4eca\u5f8c\u3001PG-Strom\u306fGstore_Fdw\u306e\u5185\u90e8\u30c7\u30fc\u30bf\u5f62\u5f0f\u3092cuDF\u3068\u5171\u901a\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u5909\u66f4\u3057\u3001\u3053\u308c\u3089\u6a5f\u68b0\u5b66\u7fd2\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u306e\u76f8\u4e92\u904b\u7528\u6027\u3092\u6539\u5584\u3057\u307e\u3059\u3002\u30b3\u30fc\u30c9\u306e\u4fdd\u5b88\u6027\u3092\u9ad8\u304f\u3059\u308b\u305f\u3081\u3001\u5f93\u6765\u306e\u72ec\u81ea\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f\u5ec3\u6b62\u3068\u306a\u308a\u307e\u3059\u3002 \u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd \u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u30ad\u30e3\u30c3\u30b7\u30e5 \u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5206\u6790\u3057\u305f\u7d50\u679c\u3001\u591a\u304f\u306e\u30b1\u30fc\u30b9\u3067\u306fArrow_Fdw\u3067\u5341\u5206\u306b\u4ee3\u66ff\u53ef\u80fd\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3042\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u3002\u91cd\u8907\u6a5f\u80fd\u3067\u3042\u308b\u305f\u3081\u3001\u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u524a\u9664\u3055\u308c\u307e\u3057\u305f\u3002","title":"PG-Strom v2.2"},{"location":"release_v2.2/#pg-strom-v22","text":"PG-Strom Development Team (1-May-2019)","title":"PG-Strom v2.2\u30ea\u30ea\u30fc\u30b9"},{"location":"release_v2.2/#_1","text":"PG-Strom v2.2\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u6a5f\u80fd\u5f37\u5316\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3078\u306e\u5bfe\u5fdc Arrow_Fdw\u306b\u3088\u308b\u5217\u6307\u5411\u30b9\u30c8\u30a2\u306e\u30b5\u30dd\u30fc\u30c8 \u30d3\u30eb\u30c9\u6e08\u307fGPU\u30d0\u30a4\u30ca\u30ea\u3078\u306e\u5bfe\u5fdc Jsonb\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc \u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b\u3092\u8fd4\u3059GPU\u95a2\u6570\u306e\u5bfe\u5fdc GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\uff08Gstore_Fdw\uff09\u306e\u30bd\u30fc\u30c8\u5bfe\u5fdc NVMEoF\u3078\u306e\u5bfe\u5fdc\uff08\u5b9f\u9a13\u7684\u6a5f\u80fd\uff09","title":"\u6982\u8981"},{"location":"release_v2.2/#_2","text":"PostgreSQL v9.6, v10, v11 CUDA Toolkit 10.1 CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d)","title":"\u52d5\u4f5c\u74b0\u5883"},{"location":"release_v2.2/#_3","text":"\u30c6\u30fc\u30d6\u30eb\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3078\u306e\u5bfe\u5fdc \u30de\u30eb\u30c1GPU\u69cb\u6210\u306e\u5834\u5408\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3092\u69cb\u6210\u3059\u308b\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u7269\u7406\u7684\u306aGPU\u3068\u306e\u8ddd\u96e2\u306b\u5fdc\u3058\u3066\u6700\u9069\u306aGPU\u3092\u9078\u629e\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002NVME-oF\u74b0\u5883\u306a\u3069PCIe\u30d0\u30b9\u306e\u69cb\u6210\u3060\u3051\u3067\u306f\u6700\u9069\u8ddd\u96e2\u3092\u5224\u65ad\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u3001DB\u7ba1\u7406\u8005\u306f pg_strom.nvme_distance_map \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u7528\u3044\u3066\u5bfe\u5fdc\u95a2\u4fc2\u3092\u8a2d\u5b9a\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3068\u306eJOIN\u6642\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u3068\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3068\u306eJOIN\u3092\u884c\u3063\u305f\u5f8c\u3001\u5404\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u51e6\u7406\u7d50\u679c\u3092\u7d50\u5408\u3059\u308b\u3088\u3046\u306a\u5b9f\u884c\u8a08\u753b\u3092\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u672c\u6a5f\u80fd\u306f Asymmetric Partition-wise JOIN \u3068\u3044\u3046\u540d\u79f0\u3067PostgreSQL v13\u306e\u672c\u4f53\u6a5f\u80fd\u3078\u3068\u63d0\u6848\u3055\u308c\u3066\u3044\u307e\u3059\u3002 Arrow_Fdw\u306b\u3088\u308b\u5217\u6307\u5411\u30b9\u30c8\u30a2\u306e\u30b5\u30dd\u30fc\u30c8 \u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u7d4c\u7531\u3067Apache Arrow\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u51fa\u3057\u306b\u5bfe\u5fdc\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 SSD-to-GPU Direct SQL\u3092\u7528\u3044\u305fApache Arrow\u306e\u8aad\u307f\u51fa\u3057\u3068SQL\u5b9f\u884c\u306b\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002 \u30d3\u30eb\u30c9\u6e08\u307fGPU\u30d0\u30a4\u30ca\u30ea\u3078\u306e\u5bfe\u5fdc SQL\u304b\u3089GPU\u30d0\u30a4\u30ca\u30ea\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b\u969b\u3001\u5f93\u6765\u306f\u52d5\u7684\u306b\u5909\u66f4\u3059\u308b\u8981\u7d20\u306e\u306a\u3044\u95a2\u6570\u7fa4\uff08\u30e9\u30a4\u30d6\u30e9\u30ea\u95a2\u6570\u306b\u9177\u4f3c\uff09\u3082\u542b\u3081\u3066CUDA C\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3057\u3001\u305d\u308c\u3092NVRTC(NVIDIA Run-Time Compiler)\u3092\u7528\u3044\u3066\u30d3\u30eb\u30c9\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u4e00\u90e8\u306e\u8907\u96d1\u306a\u95a2\u6570\u306e\u5f71\u97ff\u3067\u30d3\u30eb\u30c9\u6642\u9593\u304c\u6975\u7aef\u306b\u9577\u304f\u306a\u308b\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002 v2.2\u306b\u304a\u3044\u3066\u3001\u9759\u7684\u306a\u95a2\u6570\u7fa4\u306f\u4e8b\u524d\u306b\u30d3\u30eb\u30c9\u3055\u308c\u3001SQL\u304b\u3089\u52d5\u7684\u306b\u751f\u6210\u3059\u308b\u90e8\u5206\u306e\u307f\u3092\u5b9f\u884c\u6642\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001GPU\u30d0\u30a4\u30ca\u30ea\u306e\u751f\u6210\u6642\u9593\u304c\u5927\u5e45\u306b\u6e1b\u5c11\u3059\u308b\u4e8b\u3068\u306a\u308a\u307e\u3057\u305f\u3002 JSONB\u30c7\u30fc\u30bf\u578b\u306e\u5bfe\u5fdc GPU\u5074\u3067JSONB\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5b50\u8981\u7d20\u3092\u53c2\u7167\u3057\u3001 numeric \u3084 text \u5024\u3068\u3057\u3066\u6761\u4ef6\u53e5\u306a\u3069\u3067\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002 \u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b\u3092\u8fd4\u3059GPU\u95a2\u6570\u306e\u5bfe\u5fdc textcat \u306a\u3069\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u578b\u3092\u8fd4\u3059SQL\u95a2\u6570\u3092GPU\u5074\u3067\u5b9f\u88c5\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\uff08Gstore_Fdw\uff09\u306e\u30bd\u30fc\u30c8\u5bfe\u5fdc PL/CUDA\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u4ee5\u5916\u306b\u3001GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3057\u3066\u5b9f\u884c\u3059\u308bSQL\u3092GPU\u3067\u5b9f\u884c\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u5bfe\u5fdc\u3057\u3066\u3044\u308b\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306fGpuScan\u304a\u3088\u3073GpuSort\u306e\uff12\u7a2e\u985e\u3067\u3001JOIN\u304a\u3088\u3073GROUP BY\u306b\u306f\u307e\u3060\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002 \u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u306e\u8ffd\u52a0 \u7c21\u6613\u306a\u30c6\u30b9\u30c8\u306e\u305f\u3081\u3001\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 NVME-oF\u3078\u306e\u5bfe\u5fdc\uff08\u5b9f\u9a13\u7684\u6a5f\u80fd\uff09 NVME-over-Fabric\u3092\u7528\u3044\u3066\u30de\u30a6\u30f3\u30c8\u3055\u308c\u305f\u30ea\u30e2\u30fc\u30c8\u306eNVME\u30c7\u30a3\u30b9\u30af\u304b\u3089\u306eSSD-to-GPU Direct SQL\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u305f\u3060\u3057\u3001Red Hat Enterprise Linux 7.x / CentOS 7.x\u3067\u306f nvme_rdma \u30c9\u30e9\u30a4\u30d0\u306e\u5165\u308c\u66ff\u3048\u304c\u5fc5\u8981\u3068\u306a\u308a\u3001\u73fe\u5728\u306e\u3068\u3053\u308d\u5b9f\u9a13\u7684\u6a5f\u80fd\u3068\u3044\u3046\u5f62\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002","title":"\u65b0\u6a5f\u80fd"},{"location":"release_v2.2/#_4","text":"PostgreSQL v9.6\u30b5\u30dd\u30fc\u30c8 PostgreSQL v9.6\u306eCustomScan API\u306b\u306f\u3001\u52d5\u7684\u5171\u6709\u30e1\u30e2\u30ea(DSM)\u306e\u6b63\u3057\u3044\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306b\u5fc5\u8981\u306a\u5e7e\u3064\u304b\u306eAPI\u304c\u6b20\u3051\u3066\u304a\u308a\u3001\u5b9f\u884c\u6642\u7d71\u8a08\u60c5\u5831\u306e\u63a1\u53d6\u306a\u3069\u304c\u4e0d\u53ef\u80fd\u3067\u3057\u305f\u3002 \u307e\u305f\u3001\u5185\u90e8\u7684\u306b\u5f0f\u8868\u73fe(Expression)\u3092\u4fdd\u6301\u3059\u308b\u305f\u3081\u306e\u65b9\u6cd5\u306b\u3082\u5909\u66f4\u304c\u52a0\u3048\u3089\u308c\u3066\u3044\u308b\u4e8b\u304b\u3089\u3001\u5c11\u306a\u304f\u306a\u3044\u7b87\u6240\u3067 #if ... #endif \u30d6\u30ed\u30c3\u30af\u304c\u5fc5\u8981\u3068\u306a\u308a\u3001\u30b3\u30fc\u30c9\u306e\u4fdd\u5b88\u6027\u3092\u640d\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002 \u3053\u308c\u3089\u306e\u554f\u984c\u306b\u3088\u308a\u3001PostgreSQL v9.6\u30b5\u30dd\u30fc\u30c8\u306f\u672c\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u6700\u5f8c\u3068\u306a\u308a\u307e\u3059\u3002PG-Strom\u3092PostgreSQL v9.6\u3067\u304a\u4f7f\u3044\u306e\u5834\u5408\u306f\u3001\u65e9\u671f\u306bPostgreSQL v11\u3078\u3068\u79fb\u884c\u3055\u308c\u308b\u4e8b\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002 Gstore_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306epgstrom\u30d5\u30a9\u30fc\u30de\u30c3\u30c8 GPU\u30e1\u30e2\u30ea\u30b9\u30c8\u30a2\u4e0a\u306e\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f\u3001\u5143\u3005PL/CUDA\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u305f\u72ec\u81ea\u306e\u5217\u5f62\u5f0f\u3067\u3001\u53ef\u5909\u9577\u30c7\u30fc\u30bf\u3084numeric\u30c7\u30fc\u30bf\u578b\u306e\u8868\u73fe\u306fPostgreSQL\u306e\u3082\u306e\u3092\u305d\u306e\u307e\u307e\u5229\u7528\u3057\u3066\u3044\u307e\u3057\u305f\u3002 \u305d\u306e\u5f8c\u3001GPU\u4e0a\u3067\u306e\u30c7\u30fc\u30bf\u4ea4\u63db\u7528\u5171\u901a\u5f62\u5f0f\u3068\u3057\u3066\u3001Apache Arrow\u5f62\u5f0f\u3092\u5143\u306b\u3057\u305fNVIDIA RAPIDS(cuDF)\u304c\u516c\u958b\u3055\u308c\u3001\u591a\u304f\u306e\u6a5f\u68b0\u5b66\u7fd2\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3084Python\u3067\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30b9\u30bf\u30c3\u30af\u306a\u3069\u5bfe\u5fdc\u304c\u5f37\u5316\u3055\u308c\u3064\u3064\u3042\u308a\u307e\u3059\u3002 \u4eca\u5f8c\u3001PG-Strom\u306fGstore_Fdw\u306e\u5185\u90e8\u30c7\u30fc\u30bf\u5f62\u5f0f\u3092cuDF\u3068\u5171\u901a\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u5909\u66f4\u3057\u3001\u3053\u308c\u3089\u6a5f\u68b0\u5b66\u7fd2\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3068\u306e\u76f8\u4e92\u904b\u7528\u6027\u3092\u6539\u5584\u3057\u307e\u3059\u3002\u30b3\u30fc\u30c9\u306e\u4fdd\u5b88\u6027\u3092\u9ad8\u304f\u3059\u308b\u305f\u3081\u3001\u5f93\u6765\u306e\u72ec\u81ea\u30c7\u30fc\u30bf\u5f62\u5f0f\u306f\u5ec3\u6b62\u3068\u306a\u308a\u307e\u3059\u3002","title":"\u5c06\u6765\u5ec3\u6b62\u4e88\u5b9a\u306e\u6a5f\u80fd"},{"location":"release_v2.2/#_5","text":"\u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u30ad\u30e3\u30c3\u30b7\u30e5 \u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5206\u6790\u3057\u305f\u7d50\u679c\u3001\u591a\u304f\u306e\u30b1\u30fc\u30b9\u3067\u306fArrow_Fdw\u3067\u5341\u5206\u306b\u4ee3\u66ff\u53ef\u80fd\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3042\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u3002\u91cd\u8907\u6a5f\u80fd\u3067\u3042\u308b\u305f\u3081\u3001\u30a4\u30f3\u30e1\u30e2\u30ea\u5217\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u524a\u9664\u3055\u308c\u307e\u3057\u305f\u3002","title":"\u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd"},{"location":"release_v2.3/","text":"PG-Strom v2.3\u30ea\u30ea\u30fc\u30b9 PG-Strom Development Team (1-Apr-2020) \u6982\u8981 PG-Strom v2.3\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u6a5f\u80fd\u5f37\u5316\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 GpuJoin\u306eInner\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u304cCPU\u4e26\u5217\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 Arrow_Fdw\u304cINSERT/TRUNCATE\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 pg2arrow\u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u8a18\u30e2\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 mysql2arrow\u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002 \u52d5\u4f5c\u74b0\u5883 PostgreSQL v10, v11, v12 CUDA Toolkit 10.1 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal or Volta) \u65b0\u6a5f\u80fd GpuJoin\u306eInner\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u304cCPU\u4e26\u5217\u306b\u5bfe\u5fdc \u5f93\u6765\u306fGpuJoin\u306eInner\u5074\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u306f\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306e\u307f\u304c\u884c\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u306e\u5236\u7d04\u306b\u3088\u308a\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u4e26\u5217\u30b9\u30ad\u30e3\u30f3\u304c\u6975\u7aef\u306b\u9045\u5ef6\u3059\u308b\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u672c\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306e\u6a5f\u80fd\u5f37\u5316\u306b\u3088\u308a\u3001\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u3001\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306e\u3069\u3061\u3089\u3067\u3082Inner\u5074\u30d0\u30c3\u30d5\u30a1\u3092\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u5834\u5408\u3067\u3082\u3001\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u30d7\u30ed\u30bb\u30b9\u304c\u76f4\u3061\u306bGpuJoin\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 Partition-wise Asymmetric GpuJoin\u306e\u518d\u8a2d\u8a08 \u5168\u4f53\u7684\u306a\u30c7\u30b6\u30a4\u30f3\u306e\u518d\u8a2d\u8a08\u3092\u884c\u3044\u3001\u9069\u5207\u306a\u5c40\u9762\u306b\u304a\u3044\u3066\u591a\u6bb5GpuJoin\u304c\u9078\u629e\u3055\u308c\u3084\u3059\u304f\u306a\u308b\u3088\u3046\u6539\u826f\u3092\u884c\u3044\u307e\u3057\u305f\u3002 Arrow_Fdw\u304cINSERT/TRUNCATE\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u3001 INSERT \u306b\u3088\u308b\u30d0\u30eb\u30af\u30ed\u30fc\u30c9\u3068\u3001 pgstrom.arrow_fdw_truncate \u306b\u3088\u308bTRUNCATE\u51e6\u7406\u3092\u884c\u3046\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 CuPy\u9023\u643a\u3068\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306eGPU\u30a8\u30af\u30b9\u30dd\u30fc\u30c8 Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306e\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306b\u30ed\u30fc\u30c9\u3057\u3001\u3053\u308c\u3092CuPy\u306e cupy.ndarray \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066Python\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089\u53c2\u7167\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 pg2arrow\u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u8a18\u30e2\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 pg2arrow \u30b3\u30de\u30f3\u30c9\u306b --append \u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u8ffd\u52a0\u3055\u308c\u3001\u65e2\u5b58\u306eApache Arrow\u306b\u5bfe\u3057\u3066\u8ffd\u8a18\u3092\u884c\u3046\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 \u307e\u305f\u540c\u6642\u306b\u3001 SELECT * FROM table \u306e\u5225\u540d\u8868\u8a18\u3068\u3057\u3066 -t table \u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002 mysql2arrow\u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002 PostgreSQL\u3067\u306f\u306a\u304f\u3001MySQL\u306b\u63a5\u7d9a\u3057\u3066\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b mysql2arrow \u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 \u5217\u6319\u578b\u306e\u30c7\u30fc\u30bf\u3082\u901a\u5e38\u306eUtf8\u578b\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\uff08DictionaryBatch\u3092\u4f7f\u7528\u3057\u306a\u3044\uff09\u4ee5\u5916\u306f\u3001 pg2arrow \u3068\u540c\u7b49\u306e\u6a5f\u80fd\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 \u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f PostgreSQL\u306e\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u5408\u308f\u305b\u3066\u3001\u5e7e\u3064\u304b\u306e\u57fa\u672c\u7684\u306a\u30c6\u30b9\u30c8\u30b1\u30fc\u30b9\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002 \u4fee\u6b63\u3055\u308c\u305f\u4e3b\u306a\u4e0d\u5177\u5408 GPU\u30c7\u30d0\u30a4\u30b9\u95a2\u6570/\u578b\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u7121\u52b9\u5316\u306e\u30ed\u30b8\u30c3\u30af\u3092\u6539\u5584 ALTER\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u6642\u3001\u5168\u3066\u306eGPU\u30c7\u30d0\u30a4\u30b9\u95a2\u6570/\u578b\u306e\u30e1\u30bf\u60c5\u5831\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u7121\u52b9\u5316\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u5b9f\u969b\u306b\u7121\u52b9\u5316\u306e\u5fc5\u8981\u306e\u3042\u308b\u30a8\u30f3\u30c8\u30ea\u306e\u307f\u3092\u30af\u30ea\u30a2\u3059\u308b\u3088\u3046\u4fee\u6b63\u3092\u884c\u3044\u307e\u3057\u305f\u3002 GROUP BY\u3067\u540c\u3058\u5217\u3092\u5076\u6570\u56de\u6307\u5b9a\u3057\u305f\u969b\u306b\u6975\u7aef\u306a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u4f4e\u4e0b\u3092\u4fee\u6b63 GROUP BY\u306e\u30ad\u30fc\u5024\u304c\u8907\u6570\u3042\u308b\u6642\u306b\u3001GpuPreAgg\u306f\u30cf\u30c3\u30b7\u30e5\u5024\u3092XOR\u3067\u7d50\u5408\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u305d\u306e\u305f\u3081\u3001\u540c\u3058\u5217\u3092\u5076\u6570\u56de\u6307\u5b9a\u3057\u305f\u5834\u5408\u306b\u306f\u5e38\u306b\u30cf\u30c3\u30b7\u30e5\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c0\u306b\u306a\u308b\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u9069\u5f53\u306a\u30e9\u30f3\u30c0\u30e0\u5316\u51e6\u7406\u3092\u52a0\u3048\u308b\u4e8b\u3067\u30cf\u30c3\u30b7\u30e5\u5024\u304c\u5206\u6563\u3059\u308b\u3088\u3046\u4fee\u6b63\u3057\u3066\u3044\u307e\u3059\u3002 \u6f5c\u5728\u7684\u306aGpuScan\u7121\u9650\u30eb\u30fc\u30d7\u306e\u554f\u984c\u3092\u4fee\u6b63 SSD2GPU Direct SQL\u306e\u4f7f\u7528\u6642\u3001\u5909\u6570\u306e\u672a\u521d\u671f\u5316\u306b\u3088\u308aGpuScan\u304c\u7121\u9650\u30eb\u30fc\u30d7\u306b\u9665\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u6f5c\u5728\u7684\u306aGpuJoin\u306eGPU\u30ab\u30fc\u30cd\u30eb\u30af\u30e9\u30c3\u30b7\u30e5 3\u500b\u4ee5\u4e0a\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u7d50\u5408\u3059\u308bGpuJoin\u3067\u3001\u5909\u6570\u306e\u672a\u521d\u671f\u5316\u306b\u3088\u308aGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd PostgreSQL v9.6\u30b5\u30dd\u30fc\u30c8 PostgreSQL v9.6\u306eCustomScan API\u306b\u306f\u3001\u52d5\u7684\u5171\u6709\u30e1\u30e2\u30ea(DSM)\u306e\u6b63\u3057\u3044\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306b\u5fc5\u8981\u306a\u5e7e\u3064\u304b\u306eAPI\u304c\u6b20\u3051\u3066\u304a\u308a\u3001v10\u4ee5\u964d\u3068\u5171\u901a\u306e\u30b3\u30fc\u30c9\u3092\u4fdd\u5b88\u3059\u308b\u4e0a\u3067\u969c\u5bb3\u3068\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u306e\u554f\u984c\u304b\u3089\u3001\u672c\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f PostgreSQL v9.6 \u306f\u30b5\u30dd\u30fc\u30c8\u5916\u3068\u306a\u308a\u307e\u3059\u3002 PL/CUDA \u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5206\u6790\u3057\u305f\u7d50\u679c\u3001\u72ec\u81ea\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u74b0\u5883\u3088\u308a\u3082\u3001Python\u8a00\u8a9e\u306a\u3069\u30e6\u30fc\u30b6\u306e\u4f7f\u3044\u6163\u308c\u305f\u8a00\u8a9e\u74b0\u5883\u306e\u65b9\u304c\u671b\u307e\u3057\u3044\u4e8b\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u3002 \u4eca\u5f8c\u306f\u3001Arrow_Fdw\u306eGPU\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u6a5f\u80fd\u3068PL/Python\u7d4c\u7531\u3067\u306eCuPy\u547c\u51fa\u3057\u3092\u4f75\u7528\u3059\u308b\u4e8b\u3067\u3001In-database\u6a5f\u68b0\u5b66\u7fd2/\u7d71\u8a08\u89e3\u6790\u306e\u4ee3\u66ff\u624b\u6bb5\u3068\u306a\u308a\u307e\u3059\u3002 Gstore_Fdw \u672c\u6a5f\u80fd\u306f\u3001\u66f8\u304d\u8fbc\u307f\u53ef\u80fdArrow_Fdw\u3068GPU\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u6a5f\u80fd\u306b\u3088\u308a\u4ee3\u66ff\u3055\u308c\u307e\u3057\u305f\u3002 Largeobject\uff5eGPU\u9593\u30a8\u30af\u30b9\u30dd\u30fc\u30c8/\u30a4\u30f3\u30dd\u30fc\u30c8 \u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5206\u6790\u3057\u305f\u7d50\u679c\u3001\u672c\u6a5f\u80fd\u306f\u4e0d\u8981\u3068\u5224\u65ad\u3057\u307e\u3057\u305f\u3002","title":"PG-Strom v2.3"},{"location":"release_v2.3/#pg-strom-v23","text":"PG-Strom Development Team (1-Apr-2020)","title":"PG-Strom v2.3\u30ea\u30ea\u30fc\u30b9"},{"location":"release_v2.3/#_1","text":"PG-Strom v2.3\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u6a5f\u80fd\u5f37\u5316\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 GpuJoin\u306eInner\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u304cCPU\u4e26\u5217\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 Arrow_Fdw\u304cINSERT/TRUNCATE\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 pg2arrow\u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u8a18\u30e2\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 mysql2arrow\u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002","title":"\u6982\u8981"},{"location":"release_v2.3/#_2","text":"PostgreSQL v10, v11, v12 CUDA Toolkit 10.1 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal or Volta)","title":"\u52d5\u4f5c\u74b0\u5883"},{"location":"release_v2.3/#_3","text":"GpuJoin\u306eInner\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u304cCPU\u4e26\u5217\u306b\u5bfe\u5fdc \u5f93\u6765\u306fGpuJoin\u306eInner\u5074\u30d0\u30c3\u30d5\u30a1\u306e\u69cb\u7bc9\u306f\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306e\u307f\u304c\u884c\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u306e\u5236\u7d04\u306b\u3088\u308a\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u4e26\u5217\u30b9\u30ad\u30e3\u30f3\u304c\u6975\u7aef\u306b\u9045\u5ef6\u3059\u308b\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u672c\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306e\u6a5f\u80fd\u5f37\u5316\u306b\u3088\u308a\u3001\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u3001\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\u306e\u3069\u3061\u3089\u3067\u3082Inner\u5074\u30d0\u30c3\u30d5\u30a1\u3092\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u5834\u5408\u3067\u3082\u3001\u5404\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u30d7\u30ed\u30bb\u30b9\u304c\u76f4\u3061\u306bGpuJoin\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 Partition-wise Asymmetric GpuJoin\u306e\u518d\u8a2d\u8a08 \u5168\u4f53\u7684\u306a\u30c7\u30b6\u30a4\u30f3\u306e\u518d\u8a2d\u8a08\u3092\u884c\u3044\u3001\u9069\u5207\u306a\u5c40\u9762\u306b\u304a\u3044\u3066\u591a\u6bb5GpuJoin\u304c\u9078\u629e\u3055\u308c\u3084\u3059\u304f\u306a\u308b\u3088\u3046\u6539\u826f\u3092\u884c\u3044\u307e\u3057\u305f\u3002 Arrow_Fdw\u304cINSERT/TRUNCATE\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u3001 INSERT \u306b\u3088\u308b\u30d0\u30eb\u30af\u30ed\u30fc\u30c9\u3068\u3001 pgstrom.arrow_fdw_truncate \u306b\u3088\u308bTRUNCATE\u51e6\u7406\u3092\u884c\u3046\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 CuPy\u9023\u643a\u3068\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306eGPU\u30a8\u30af\u30b9\u30dd\u30fc\u30c8 Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306e\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u306b\u30ed\u30fc\u30c9\u3057\u3001\u3053\u308c\u3092CuPy\u306e cupy.ndarray \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066Python\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089\u53c2\u7167\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 pg2arrow\u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u8a18\u30e2\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 pg2arrow \u30b3\u30de\u30f3\u30c9\u306b --append \u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u8ffd\u52a0\u3055\u308c\u3001\u65e2\u5b58\u306eApache Arrow\u306b\u5bfe\u3057\u3066\u8ffd\u8a18\u3092\u884c\u3046\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 \u307e\u305f\u540c\u6642\u306b\u3001 SELECT * FROM table \u306e\u5225\u540d\u8868\u8a18\u3068\u3057\u3066 -t table \u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002 mysql2arrow\u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002 PostgreSQL\u3067\u306f\u306a\u304f\u3001MySQL\u306b\u63a5\u7d9a\u3057\u3066\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b mysql2arrow \u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 \u5217\u6319\u578b\u306e\u30c7\u30fc\u30bf\u3082\u901a\u5e38\u306eUtf8\u578b\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\uff08DictionaryBatch\u3092\u4f7f\u7528\u3057\u306a\u3044\uff09\u4ee5\u5916\u306f\u3001 pg2arrow \u3068\u540c\u7b49\u306e\u6a5f\u80fd\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002 \u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f PostgreSQL\u306e\u30ea\u30b0\u30ec\u30c3\u30b7\u30e7\u30f3\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u5408\u308f\u305b\u3066\u3001\u5e7e\u3064\u304b\u306e\u57fa\u672c\u7684\u306a\u30c6\u30b9\u30c8\u30b1\u30fc\u30b9\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002","title":"\u65b0\u6a5f\u80fd"},{"location":"release_v2.3/#_4","text":"GPU\u30c7\u30d0\u30a4\u30b9\u95a2\u6570/\u578b\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u7121\u52b9\u5316\u306e\u30ed\u30b8\u30c3\u30af\u3092\u6539\u5584 ALTER\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u6642\u3001\u5168\u3066\u306eGPU\u30c7\u30d0\u30a4\u30b9\u95a2\u6570/\u578b\u306e\u30e1\u30bf\u60c5\u5831\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u7121\u52b9\u5316\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u5b9f\u969b\u306b\u7121\u52b9\u5316\u306e\u5fc5\u8981\u306e\u3042\u308b\u30a8\u30f3\u30c8\u30ea\u306e\u307f\u3092\u30af\u30ea\u30a2\u3059\u308b\u3088\u3046\u4fee\u6b63\u3092\u884c\u3044\u307e\u3057\u305f\u3002 GROUP BY\u3067\u540c\u3058\u5217\u3092\u5076\u6570\u56de\u6307\u5b9a\u3057\u305f\u969b\u306b\u6975\u7aef\u306a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u4f4e\u4e0b\u3092\u4fee\u6b63 GROUP BY\u306e\u30ad\u30fc\u5024\u304c\u8907\u6570\u3042\u308b\u6642\u306b\u3001GpuPreAgg\u306f\u30cf\u30c3\u30b7\u30e5\u5024\u3092XOR\u3067\u7d50\u5408\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u305d\u306e\u305f\u3081\u3001\u540c\u3058\u5217\u3092\u5076\u6570\u56de\u6307\u5b9a\u3057\u305f\u5834\u5408\u306b\u306f\u5e38\u306b\u30cf\u30c3\u30b7\u30e5\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c0\u306b\u306a\u308b\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u9069\u5f53\u306a\u30e9\u30f3\u30c0\u30e0\u5316\u51e6\u7406\u3092\u52a0\u3048\u308b\u4e8b\u3067\u30cf\u30c3\u30b7\u30e5\u5024\u304c\u5206\u6563\u3059\u308b\u3088\u3046\u4fee\u6b63\u3057\u3066\u3044\u307e\u3059\u3002 \u6f5c\u5728\u7684\u306aGpuScan\u7121\u9650\u30eb\u30fc\u30d7\u306e\u554f\u984c\u3092\u4fee\u6b63 SSD2GPU Direct SQL\u306e\u4f7f\u7528\u6642\u3001\u5909\u6570\u306e\u672a\u521d\u671f\u5316\u306b\u3088\u308aGpuScan\u304c\u7121\u9650\u30eb\u30fc\u30d7\u306b\u9665\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u6f5c\u5728\u7684\u306aGpuJoin\u306eGPU\u30ab\u30fc\u30cd\u30eb\u30af\u30e9\u30c3\u30b7\u30e5 3\u500b\u4ee5\u4e0a\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u7d50\u5408\u3059\u308bGpuJoin\u3067\u3001\u5909\u6570\u306e\u672a\u521d\u671f\u5316\u306b\u3088\u308aGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3057\u305f\u3002","title":"\u4fee\u6b63\u3055\u308c\u305f\u4e3b\u306a\u4e0d\u5177\u5408"},{"location":"release_v2.3/#_5","text":"PostgreSQL v9.6\u30b5\u30dd\u30fc\u30c8 PostgreSQL v9.6\u306eCustomScan API\u306b\u306f\u3001\u52d5\u7684\u5171\u6709\u30e1\u30e2\u30ea(DSM)\u306e\u6b63\u3057\u3044\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306b\u5fc5\u8981\u306a\u5e7e\u3064\u304b\u306eAPI\u304c\u6b20\u3051\u3066\u304a\u308a\u3001v10\u4ee5\u964d\u3068\u5171\u901a\u306e\u30b3\u30fc\u30c9\u3092\u4fdd\u5b88\u3059\u308b\u4e0a\u3067\u969c\u5bb3\u3068\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u306e\u554f\u984c\u304b\u3089\u3001\u672c\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f PostgreSQL v9.6 \u306f\u30b5\u30dd\u30fc\u30c8\u5916\u3068\u306a\u308a\u307e\u3059\u3002 PL/CUDA \u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5206\u6790\u3057\u305f\u7d50\u679c\u3001\u72ec\u81ea\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u74b0\u5883\u3088\u308a\u3082\u3001Python\u8a00\u8a9e\u306a\u3069\u30e6\u30fc\u30b6\u306e\u4f7f\u3044\u6163\u308c\u305f\u8a00\u8a9e\u74b0\u5883\u306e\u65b9\u304c\u671b\u307e\u3057\u3044\u4e8b\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u3002 \u4eca\u5f8c\u306f\u3001Arrow_Fdw\u306eGPU\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u6a5f\u80fd\u3068PL/Python\u7d4c\u7531\u3067\u306eCuPy\u547c\u51fa\u3057\u3092\u4f75\u7528\u3059\u308b\u4e8b\u3067\u3001In-database\u6a5f\u68b0\u5b66\u7fd2/\u7d71\u8a08\u89e3\u6790\u306e\u4ee3\u66ff\u624b\u6bb5\u3068\u306a\u308a\u307e\u3059\u3002 Gstore_Fdw \u672c\u6a5f\u80fd\u306f\u3001\u66f8\u304d\u8fbc\u307f\u53ef\u80fdArrow_Fdw\u3068GPU\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u6a5f\u80fd\u306b\u3088\u308a\u4ee3\u66ff\u3055\u308c\u307e\u3057\u305f\u3002 Largeobject\uff5eGPU\u9593\u30a8\u30af\u30b9\u30dd\u30fc\u30c8/\u30a4\u30f3\u30dd\u30fc\u30c8 \u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3092\u5206\u6790\u3057\u305f\u7d50\u679c\u3001\u672c\u6a5f\u80fd\u306f\u4e0d\u8981\u3068\u5224\u65ad\u3057\u307e\u3057\u305f\u3002","title":"\u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd"},{"location":"release_v3.0/","text":"PG-Strom v3.0\u30ea\u30ea\u30fc\u30b9 PG-Strom Development Team (29-Jun-2021) \u6982\u8981 PG-Strom v3.0\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u5909\u66f4\u306f\u70b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 NVIDIA GPUDirect Storage (cuFile) \u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u3044\u304f\u3064\u304b\u306ePostGIS\u95a2\u6570\u304cGPU\u3067\u5b9f\u884c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3057\u305fGpuJoin\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u65b0\u305f\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u6a5f\u80fd\u304c\u5b9f\u88c5\u3055\u308c\u307e\u3057\u305f\u3002 \u30e6\u30fc\u30b6\u5b9a\u7fa9\u306eGPU\u30c7\u30fc\u30bf\u578b/\u95a2\u6570/\u6f14\u7b97\u5b50\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002(\u5b9f\u9a13\u7684) \u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30e9\u30a4\u30bb\u30f3\u30b9\u3092GPLv2\u304b\u3089PostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u3078\u3068\u5207\u308a\u66ff\u3048\u307e\u3057\u305f\u3002 \u52d5\u4f5c\u74b0\u5883 PostgreSQL v11, v12, v13 CUDA Toolkit 11.2 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d) NVIDIA GPUDirect Storage GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL \u7528\u306e\u30c9\u30e9\u30a4\u30d0\u3068\u3057\u3066\u3001\u5f93\u6765\u306e nvme_strom \u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u52a0\u3048\u3066\u3001 NVIDIA\u304c\u958b\u767a\u3092\u9032\u3081\u3066\u3044\u308b GPUDirect Storage \u306b\u3082\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u3069\u3061\u3089\u306e\u30c9\u30e9\u30a4\u30d0\u3082\u6982\u306d\u540c\u7b49\u306e\u6a5f\u80fd\u3001\u6027\u80fd\u3092\u6709\u3057\u3066\u3044\u307e\u3059\u304c\u3001GPUDirect Storage\u306e\u5bfe\u5fdc\u306b\u3088\u308a\u3001\u5f93\u6765\u304b\u3089\u306e\u30ed\u30fc\u30ab\u30ebNVME-SSD\u306b\u52a0\u3048\u3066\u3001NVME-oF(NVME over Fabrics)\u30c7\u30d0\u30a4\u30b9\u3084SDS(Software Defined Storage)\u30c7\u30d0\u30a4\u30b9\u3001\u304a\u3088\u3073\u305d\u306e\u4e0a\u306b\u69cb\u7bc9\u3055\u308c\u305f\u5171\u6709\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u306eGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306b\u3082\u5bfe\u5fdc\u3059\u308b\u4e8b\u3068\u306a\u308a\u3001\u3088\u308a\u5927\u898f\u6a21\u3067\u67d4\u8edf\u306a\u30b9\u30c8\u30ec\u30fc\u30b8\u69cb\u6210\u3092\u53d6\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002 GPUDirect SQL\u306f\u3001PostgreSQL\u6a19\u6e96\u306eHeap\u30c6\u30fc\u30d6\u30eb\u3068Apache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u51fa\u3057\u306b\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u3044\u305a\u308c\u306e\u5834\u5408\u306b\u304a\u3044\u3066\u3082\u3001\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u304c\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u3068\u306a\u308b\u3088\u3046\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u304a\u3044\u3066\u9855\u8457\u306a\u9ad8\u901f\u5316\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u6e2c\u5b9a\u7d50\u679c\u306f\u3001GPU 1\u53f0\u3068NVME-SSD 4\u53f0\u3092\u7528\u3044\u3066\u3001SSBM(Star Schema Benchmark)\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPUDirect SQL\u3092GPUDirect Storage\u30c9\u30e9\u30a4\u30d0\u306e\u4e0b\u3067\u5b9f\u884c\u3057\u305f\u3082\u306e\u3067\u3059\u304c\u3001PostgreSQL heap\u3068Apache Arrow\u306e\u3044\u305a\u308c\u306e\u30b1\u30fc\u30b9\u306b\u304a\u3044\u3066\u3082\u3001\u5358\u4f4d\u6642\u9593\u3042\u305f\u308a\u306e\u30c7\u30fc\u30bf\u51e6\u7406\u4ef6\u6570\u306fPostgreSQL\u306b\u6bd4\u3079\u5927\u5e45\u306b\u6539\u5584\u3057\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 \u307e\u305f\u3001\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u4e2d\u306eNVME-SSD\u304b\u3089\u306e\u8aad\u307f\u51fa\u3057\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u3092\u6bd4\u8f03\u3057\u3066\u307f\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4ecb\u3057\u305f\u8aad\u51fa\u3057\uff08PostgreSQL Heap Storage\uff09\u306b\u6bd4\u3079\u3001GPUDirect Storage\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u306b\u306f\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9650\u754c\u306b\u8fd1\u3044\u6027\u80fd\u5024\u3092\u5f15\u304d\u51fa\u305b\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 GPU\u7248PostGIS\u3068GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9 \u3044\u304f\u3064\u304b\u306ePostGIS\u95a2\u6570\u306bGPU\u7248\u3092\u5b9f\u88c5\u3057\u307e\u3057\u305f\u3002 \u6761\u4ef6\u53e5\u3067\u3053\u308c\u3089\u306ePostGIS\u95a2\u6570\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001PG-Strom\u306fGPU\u5074\u3067\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046GPU\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u81ea\u52d5\u751f\u6210\u3057\u307e\u3059\u3002 GPU\u7248PostGIS\u306e\u4e3b\u305f\u308b\u30bf\u30fc\u30b2\u30c3\u30c8\u306f\u3001\u643a\u5e2f\u96fb\u8a71\u3084\u81ea\u52d5\u8eca\u3068\u3044\u3063\u305f\u79fb\u52d5\u4f53\u30c7\u30d0\u30a4\u30b9\u306e\u6700\u65b0\u306e\u4f4d\u7f6e\u60c5\u5831\uff08Real-time Location Data\uff09\u3068\u3001\u5e02\u533a\u753a\u6751\u3084\u5b66\u533a\u306e\u5883\u754c\u3068\u3044\u3063\u305f\u9818\u57df\uff08Area Definition Data\uff09\u3068\u306e\u9593\u3067\u884c\u308f\u308c\u308b\u7a81\u5408\u51e6\u7406\u3067\u3059\u3002 \u4f8b\u3048\u3070\u3001\u4e00\u5b9a\u306e\u30a8\u30ea\u30a2\u5185\u306b\u5b58\u5728\u3059\u308b\u643a\u5e2f\u96fb\u8a71\u306b\u5e83\u544a\u3092\u914d\u4fe1\u3057\u305f\u3044\u6642\u3001\u4e00\u5b9a\u306e\u30a8\u30ea\u30a2\u5185\u306b\u5b58\u5728\u3059\u308b\u81ea\u52d5\u8eca\u306b\u6e0b\u6ede\u60c5\u5831\u3092\u914d\u4fe1\u3057\u305f\u3044\u6642\u306a\u3069\u3001\u4f4d\u7f6e\u3092\u30ad\u30fc\u3068\u3057\u3066\u8a72\u5f53\u3059\u308b\u30c7\u30d0\u30a4\u30b9\u3092\u691c\u7d22\u3059\u308b\u51e6\u7406\u306b\u52b9\u679c\u3092\u767a\u63ee\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u6771\u4eac\u8fd1\u90ca\u30a8\u30ea\u30a2\u3092\u5305\u542b\u3059\u308b\u77e9\u5f62\u9818\u57df\u5185\u306b\u30e9\u30f3\u30c0\u30e0\u306a1600\u4e07\u500b\u306e\u70b9\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3057\u3001\u5e02\u533a\u753a\u6751\u3054\u3068\u306b\u305d\u306e\u9818\u57df\u5185\u306b\u542b\u307e\u308c\u308b\u70b9\u306e\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u3059\u308b\u3068\u3044\u3046\u51e6\u7406\u306e\u5fdc\u7b54\u6642\u9593\u3092\u8a08\u6e2c\u3057\u305f\u3082\u306e\u3067\u3059\u3002 \u901a\u5e38\u306ePostGIS\u3068GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u306f160\u79d2\u4ee5\u4e0a\u3092\u8981\u3057\u305f\u51e6\u7406\u304c\u3001GPU\u7248PostGIS\u3068GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u304a\u3044\u3066\u306f\u3001\u50c5\u304b0.830\u79d2\u3067\u5fdc\u7b54\u3057\u3066\u3044\u307e\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5 GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u4e88\u3081\u9818\u57df\u3092\u78ba\u4fdd\u3057\u3066\u304a\u304d\u3001\u5bfe\u8c61\u3068\u306a\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u8907\u88fd\u3092\u4fdd\u6301\u3057\u3066\u304a\u304f\u6a5f\u80fd\u3067\u3059\u3002 \u6bd4\u8f03\u7684\u5c0f\u898f\u6a21\u306e\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\uff08\uff5e10GB\u7a0b\u5ea6\uff09\u3067\u3001\u66f4\u65b0\u983b\u5ea6\u306e\u9ad8\u3044\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u5206\u6790/\u691c\u7d22\u7cfb\u306e\u30af\u30a8\u30ea\u3092\u52b9\u7387\u3088\u304f\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u307e\u3057\u305f\u3002 \u5206\u6790/\u691c\u7d22\u7cfb\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u6642\u306b\u306f\u3001GPU\u4e0a\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u53c2\u7167\u3059\u308b\u4e8b\u3067\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3059\u4e8b\u306a\u304fGPU\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u51e6\u7406\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u5178\u578b\u7684\u306b\u306f\u3001\u6570\u767e\u4e07\u30c7\u30d0\u30a4\u30b9\u306e\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30c7\u30fc\u30bf\u3092GPU\u4e0a\u306b\u4fdd\u6301\u3057\u3066\u304a\u304d\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3084\u4f4d\u7f6e\u60c5\u5831\u306e\u66f4\u65b0\u304c\u9ad8\u983b\u5ea6\u3067\u767a\u751f\u3059\u308b\u3068\u3044\u3063\u305f\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u66f4\u65b0\u3059\u308b\u3068\u3001\u305d\u306e\u66f4\u65b0\u5c65\u6b74\u3092\u30aa\u30f3\u30e1\u30e2\u30ea\u306eREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u683c\u7d0d\u3057\u3001\u305d\u308c\u3092\u4e00\u5b9a\u9593\u9694\u304b\u3001\u307e\u305f\u306f\u5206\u6790/\u691c\u7d22\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u5b9f\u884c\u524d\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u5074\u306b\u53cd\u6620\u3057\u307e\u3059\u3002 \u3053\u306e\u4ed5\u7d44\u307f\u306b\u3088\u308a\u3001\u9ad8\u983b\u5ea6\u3067\u306e\u66f4\u65b0\u3068\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3068\u306e\u6574\u5408\u6027\u3068\u3092\u4e21\u7acb\u3057\u3066\u3044\u307e\u3059\u3002 \u30e6\u30fc\u30b6\u5b9a\u7fa9\u306eGPU\u30c7\u30fc\u30bf\u578b/\u95a2\u6570 \u30e6\u30fc\u30b6\u5b9a\u7fa9\u306eGPU\u30c7\u30fc\u30bf\u578b/\u95a2\u6570\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306eAPI\u3092\u65b0\u305f\u306b\u63d0\u4f9b\u3057\u307e\u3059\u3002 \u3053\u308c\u306b\u3088\u308a\u3001PG-Strom\u81ea\u4f53\u306b\u306f\u624b\u3092\u52a0\u3048\u308b\u3053\u3068\u306a\u304f\u3001\u30cb\u30c3\u30c1\u306a\u7528\u9014\u306e\u30c7\u30fc\u30bf\u578b\u3084\u305d\u308c\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306eSQL\u95a2\u6570\u3092\u30e6\u30fc\u30b6\u304c\u72ec\u81ea\u306b\u5b9a\u7fa9\u3001\u5b9f\u88c5\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 Notice \u672cAPI\u306f\u5b9f\u9a13\u7684\u30b9\u30c6\u30fc\u30bf\u30b9\u3067\u3042\u308a\u3001\u5c06\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u4e88\u544a\u306a\u304f\u5909\u66f4\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u307e\u305f\u3001\u672cAPI\u306e\u5229\u7528\u306b\u306fPG-Strom\u5185\u90e8\u69cb\u9020\u3092\u5341\u5206\u306b\u7406\u89e3\u3057\u3066\u3044\u308b\u4e8b\u304c\u524d\u63d0\u3067\u3059\u306e\u3067\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 PostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u63a1\u7528 PG-Strom v3.0\u4ee5\u964d\u3067\u306fPostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u3092\u63a1\u7528\u3057\u307e\u3059\u3002 \u6b74\u53f2\u7684\u306a\u7d4c\u7def\u306b\u3088\u308a\u3001\u3053\u308c\u307e\u3067\u306ePG-Strom\u3067\u306fGPLv2\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001PG-Strom\u30b3\u30a2\u6a5f\u80fd\u3084\u5468\u8fba\u30c4\u30fc\u30eb\u3068\u7d44\u307f\u5408\u308f\u305b\u305f\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306b\u30e9\u30a4\u30bb\u30f3\u30b9\u4f53\u7cfb\u304c\u969c\u5bb3\u306b\u306a\u308b\u3068\u306e\u58f0\u3092\u8907\u6570\u3044\u305f\u3060\u3044\u3066\u3044\u307e\u3057\u305f\u3002 \u305d\u306e\u4ed6\u306e\u5909\u66f4 \u72ec\u81ea\u306b int1 (8bit\u6574\u6570) \u30c7\u30fc\u30bf\u578b\u3001\u304a\u3088\u3073\u95a2\u9023\u3059\u308b\u6f14\u7b97\u5b50\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 pg2arrow \u306b --inner-join \u304a\u3088\u3073 --outer-join \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002PostgreSQL\u306e\u5217\u6570\u5236\u9650\u3092\u8d8a\u3048\u305f\u6570\u306e\u5217\u3092\u6301\u3064Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u30de\u30eb\u30c1GPU\u74b0\u5883\u3067\u306f\u3001GPU\u3054\u3068\u306b\u5c02\u7528\u306eGPU Memory Keeper\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u304c\u7acb\u3061\u4e0a\u304c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 PostgreSQL v13.x \u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 CUDA 11.2 \u304a\u3088\u3073 Ampere\u4e16\u4ee3\u306eGPU\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 ScaleFlux\u793e\u306eComputational Storage\u88fd\u54c1CSD2000\u30b7\u30ea\u30fc\u30ba\u3067\u306eGPUDirect SQL\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\uff08cuFile\u30c9\u30e9\u30a4\u30d0\u306e\u307f\uff09 \u96d1\u591a\u306a\u30d0\u30b0\u306e\u4fee\u6b63 \u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd PostgreSQL v10.x \u7cfb\u5217\u306e\u30b5\u30dd\u30fc\u30c8\u304c\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002 Python\u30b9\u30af\u30ea\u30d7\u30c8\u3068\u306e\u30c7\u30fc\u30bf\u9023\u643a\u6a5f\u80fd\uff08PyStrom\uff09\u304c\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002","title":"PG-Strom v3.0"},{"location":"release_v3.0/#pg-strom-v30","text":"PG-Strom Development Team (29-Jun-2021)","title":"PG-Strom v3.0\u30ea\u30ea\u30fc\u30b9"},{"location":"release_v3.0/#_1","text":"PG-Strom v3.0\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u5909\u66f4\u306f\u70b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 NVIDIA GPUDirect Storage (cuFile) \u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u3044\u304f\u3064\u304b\u306ePostGIS\u95a2\u6570\u304cGPU\u3067\u5b9f\u884c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3057\u305fGpuJoin\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u65b0\u305f\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u6a5f\u80fd\u304c\u5b9f\u88c5\u3055\u308c\u307e\u3057\u305f\u3002 \u30e6\u30fc\u30b6\u5b9a\u7fa9\u306eGPU\u30c7\u30fc\u30bf\u578b/\u95a2\u6570/\u6f14\u7b97\u5b50\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002(\u5b9f\u9a13\u7684) \u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30e9\u30a4\u30bb\u30f3\u30b9\u3092GPLv2\u304b\u3089PostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u3078\u3068\u5207\u308a\u66ff\u3048\u307e\u3057\u305f\u3002","title":"\u6982\u8981"},{"location":"release_v3.0/#_2","text":"PostgreSQL v11, v12, v13 CUDA Toolkit 11.2 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d)","title":"\u52d5\u4f5c\u74b0\u5883"},{"location":"release_v3.0/#nvidia-gpudirect-storage","text":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL \u7528\u306e\u30c9\u30e9\u30a4\u30d0\u3068\u3057\u3066\u3001\u5f93\u6765\u306e nvme_strom \u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u52a0\u3048\u3066\u3001 NVIDIA\u304c\u958b\u767a\u3092\u9032\u3081\u3066\u3044\u308b GPUDirect Storage \u306b\u3082\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u3069\u3061\u3089\u306e\u30c9\u30e9\u30a4\u30d0\u3082\u6982\u306d\u540c\u7b49\u306e\u6a5f\u80fd\u3001\u6027\u80fd\u3092\u6709\u3057\u3066\u3044\u307e\u3059\u304c\u3001GPUDirect Storage\u306e\u5bfe\u5fdc\u306b\u3088\u308a\u3001\u5f93\u6765\u304b\u3089\u306e\u30ed\u30fc\u30ab\u30ebNVME-SSD\u306b\u52a0\u3048\u3066\u3001NVME-oF(NVME over Fabrics)\u30c7\u30d0\u30a4\u30b9\u3084SDS(Software Defined Storage)\u30c7\u30d0\u30a4\u30b9\u3001\u304a\u3088\u3073\u305d\u306e\u4e0a\u306b\u69cb\u7bc9\u3055\u308c\u305f\u5171\u6709\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u306eGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306b\u3082\u5bfe\u5fdc\u3059\u308b\u4e8b\u3068\u306a\u308a\u3001\u3088\u308a\u5927\u898f\u6a21\u3067\u67d4\u8edf\u306a\u30b9\u30c8\u30ec\u30fc\u30b8\u69cb\u6210\u3092\u53d6\u308b\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002 GPUDirect SQL\u306f\u3001PostgreSQL\u6a19\u6e96\u306eHeap\u30c6\u30fc\u30d6\u30eb\u3068Apache Arrow\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u51fa\u3057\u306b\u5229\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u3044\u305a\u308c\u306e\u5834\u5408\u306b\u304a\u3044\u3066\u3082\u3001\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u304c\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u3068\u306a\u308b\u3088\u3046\u306a\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306b\u304a\u3044\u3066\u9855\u8457\u306a\u9ad8\u901f\u5316\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u6e2c\u5b9a\u7d50\u679c\u306f\u3001GPU 1\u53f0\u3068NVME-SSD 4\u53f0\u3092\u7528\u3044\u3066\u3001SSBM(Star Schema Benchmark)\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092GPUDirect SQL\u3092GPUDirect Storage\u30c9\u30e9\u30a4\u30d0\u306e\u4e0b\u3067\u5b9f\u884c\u3057\u305f\u3082\u306e\u3067\u3059\u304c\u3001PostgreSQL heap\u3068Apache Arrow\u306e\u3044\u305a\u308c\u306e\u30b1\u30fc\u30b9\u306b\u304a\u3044\u3066\u3082\u3001\u5358\u4f4d\u6642\u9593\u3042\u305f\u308a\u306e\u30c7\u30fc\u30bf\u51e6\u7406\u4ef6\u6570\u306fPostgreSQL\u306b\u6bd4\u3079\u5927\u5e45\u306b\u6539\u5584\u3057\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002 \u307e\u305f\u3001\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u4e2d\u306eNVME-SSD\u304b\u3089\u306e\u8aad\u307f\u51fa\u3057\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u3092\u6bd4\u8f03\u3057\u3066\u307f\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4ecb\u3057\u305f\u8aad\u51fa\u3057\uff08PostgreSQL Heap Storage\uff09\u306b\u6bd4\u3079\u3001GPUDirect Storage\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u306b\u306f\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9650\u754c\u306b\u8fd1\u3044\u6027\u80fd\u5024\u3092\u5f15\u304d\u51fa\u305b\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002","title":"NVIDIA GPUDirect Storage"},{"location":"release_v3.0/#gpupostgisgist","text":"\u3044\u304f\u3064\u304b\u306ePostGIS\u95a2\u6570\u306bGPU\u7248\u3092\u5b9f\u88c5\u3057\u307e\u3057\u305f\u3002 \u6761\u4ef6\u53e5\u3067\u3053\u308c\u3089\u306ePostGIS\u95a2\u6570\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001PG-Strom\u306fGPU\u5074\u3067\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046GPU\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u81ea\u52d5\u751f\u6210\u3057\u307e\u3059\u3002 GPU\u7248PostGIS\u306e\u4e3b\u305f\u308b\u30bf\u30fc\u30b2\u30c3\u30c8\u306f\u3001\u643a\u5e2f\u96fb\u8a71\u3084\u81ea\u52d5\u8eca\u3068\u3044\u3063\u305f\u79fb\u52d5\u4f53\u30c7\u30d0\u30a4\u30b9\u306e\u6700\u65b0\u306e\u4f4d\u7f6e\u60c5\u5831\uff08Real-time Location Data\uff09\u3068\u3001\u5e02\u533a\u753a\u6751\u3084\u5b66\u533a\u306e\u5883\u754c\u3068\u3044\u3063\u305f\u9818\u57df\uff08Area Definition Data\uff09\u3068\u306e\u9593\u3067\u884c\u308f\u308c\u308b\u7a81\u5408\u51e6\u7406\u3067\u3059\u3002 \u4f8b\u3048\u3070\u3001\u4e00\u5b9a\u306e\u30a8\u30ea\u30a2\u5185\u306b\u5b58\u5728\u3059\u308b\u643a\u5e2f\u96fb\u8a71\u306b\u5e83\u544a\u3092\u914d\u4fe1\u3057\u305f\u3044\u6642\u3001\u4e00\u5b9a\u306e\u30a8\u30ea\u30a2\u5185\u306b\u5b58\u5728\u3059\u308b\u81ea\u52d5\u8eca\u306b\u6e0b\u6ede\u60c5\u5831\u3092\u914d\u4fe1\u3057\u305f\u3044\u6642\u306a\u3069\u3001\u4f4d\u7f6e\u3092\u30ad\u30fc\u3068\u3057\u3066\u8a72\u5f53\u3059\u308b\u30c7\u30d0\u30a4\u30b9\u3092\u691c\u7d22\u3059\u308b\u51e6\u7406\u306b\u52b9\u679c\u3092\u767a\u63ee\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u6771\u4eac\u8fd1\u90ca\u30a8\u30ea\u30a2\u3092\u5305\u542b\u3059\u308b\u77e9\u5f62\u9818\u57df\u5185\u306b\u30e9\u30f3\u30c0\u30e0\u306a1600\u4e07\u500b\u306e\u70b9\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3057\u3001\u5e02\u533a\u753a\u6751\u3054\u3068\u306b\u305d\u306e\u9818\u57df\u5185\u306b\u542b\u307e\u308c\u308b\u70b9\u306e\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u3059\u308b\u3068\u3044\u3046\u51e6\u7406\u306e\u5fdc\u7b54\u6642\u9593\u3092\u8a08\u6e2c\u3057\u305f\u3082\u306e\u3067\u3059\u3002 \u901a\u5e38\u306ePostGIS\u3068GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u306f160\u79d2\u4ee5\u4e0a\u3092\u8981\u3057\u305f\u51e6\u7406\u304c\u3001GPU\u7248PostGIS\u3068GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u304a\u3044\u3066\u306f\u3001\u50c5\u304b0.830\u79d2\u3067\u5fdc\u7b54\u3057\u3066\u3044\u307e\u3059\u3002","title":"GPU\u7248PostGIS\u3068GiST\u30a4\u30f3\u30c7\u30c3\u30af\u30b9"},{"location":"release_v3.0/#gpu","text":"GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u4e0a\u306b\u4e88\u3081\u9818\u57df\u3092\u78ba\u4fdd\u3057\u3066\u304a\u304d\u3001\u5bfe\u8c61\u3068\u306a\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u8907\u88fd\u3092\u4fdd\u6301\u3057\u3066\u304a\u304f\u6a5f\u80fd\u3067\u3059\u3002 \u6bd4\u8f03\u7684\u5c0f\u898f\u6a21\u306e\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\uff08\uff5e10GB\u7a0b\u5ea6\uff09\u3067\u3001\u66f4\u65b0\u983b\u5ea6\u306e\u9ad8\u3044\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u5206\u6790/\u691c\u7d22\u7cfb\u306e\u30af\u30a8\u30ea\u3092\u52b9\u7387\u3088\u304f\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u307e\u3057\u305f\u3002 \u5206\u6790/\u691c\u7d22\u7cfb\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u6642\u306b\u306f\u3001GPU\u4e0a\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u53c2\u7167\u3059\u308b\u4e8b\u3067\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u3059\u4e8b\u306a\u304fGPU\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u51e6\u7406\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u5178\u578b\u7684\u306b\u306f\u3001\u6570\u767e\u4e07\u30c7\u30d0\u30a4\u30b9\u306e\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30c7\u30fc\u30bf\u3092GPU\u4e0a\u306b\u4fdd\u6301\u3057\u3066\u304a\u304d\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3084\u4f4d\u7f6e\u60c5\u5831\u306e\u66f4\u65b0\u304c\u9ad8\u983b\u5ea6\u3067\u767a\u751f\u3059\u308b\u3068\u3044\u3063\u305f\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3067\u3059\u3002 GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u66f4\u65b0\u3059\u308b\u3068\u3001\u305d\u306e\u66f4\u65b0\u5c65\u6b74\u3092\u30aa\u30f3\u30e1\u30e2\u30ea\u306eREDO\u30ed\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u683c\u7d0d\u3057\u3001\u305d\u308c\u3092\u4e00\u5b9a\u9593\u9694\u304b\u3001\u307e\u305f\u306f\u5206\u6790/\u691c\u7d22\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u5b9f\u884c\u524d\u306bGPU\u30ad\u30e3\u30c3\u30b7\u30e5\u5074\u306b\u53cd\u6620\u3057\u307e\u3059\u3002 \u3053\u306e\u4ed5\u7d44\u307f\u306b\u3088\u308a\u3001\u9ad8\u983b\u5ea6\u3067\u306e\u66f4\u65b0\u3068\u3001GPU\u30ad\u30e3\u30c3\u30b7\u30e5\u3068\u306e\u6574\u5408\u6027\u3068\u3092\u4e21\u7acb\u3057\u3066\u3044\u307e\u3059\u3002","title":"GPU\u30ad\u30e3\u30c3\u30b7\u30e5"},{"location":"release_v3.0/#gpu_1","text":"\u30e6\u30fc\u30b6\u5b9a\u7fa9\u306eGPU\u30c7\u30fc\u30bf\u578b/\u95a2\u6570\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306eAPI\u3092\u65b0\u305f\u306b\u63d0\u4f9b\u3057\u307e\u3059\u3002 \u3053\u308c\u306b\u3088\u308a\u3001PG-Strom\u81ea\u4f53\u306b\u306f\u624b\u3092\u52a0\u3048\u308b\u3053\u3068\u306a\u304f\u3001\u30cb\u30c3\u30c1\u306a\u7528\u9014\u306e\u30c7\u30fc\u30bf\u578b\u3084\u305d\u308c\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306eSQL\u95a2\u6570\u3092\u30e6\u30fc\u30b6\u304c\u72ec\u81ea\u306b\u5b9a\u7fa9\u3001\u5b9f\u88c5\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3057\u305f\u3002 Notice \u672cAPI\u306f\u5b9f\u9a13\u7684\u30b9\u30c6\u30fc\u30bf\u30b9\u3067\u3042\u308a\u3001\u5c06\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u4e88\u544a\u306a\u304f\u5909\u66f4\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u307e\u305f\u3001\u672cAPI\u306e\u5229\u7528\u306b\u306fPG-Strom\u5185\u90e8\u69cb\u9020\u3092\u5341\u5206\u306b\u7406\u89e3\u3057\u3066\u3044\u308b\u4e8b\u304c\u524d\u63d0\u3067\u3059\u306e\u3067\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002","title":"\u30e6\u30fc\u30b6\u5b9a\u7fa9\u306eGPU\u30c7\u30fc\u30bf\u578b/\u95a2\u6570"},{"location":"release_v3.0/#postgresql","text":"PG-Strom v3.0\u4ee5\u964d\u3067\u306fPostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u3092\u63a1\u7528\u3057\u307e\u3059\u3002 \u6b74\u53f2\u7684\u306a\u7d4c\u7def\u306b\u3088\u308a\u3001\u3053\u308c\u307e\u3067\u306ePG-Strom\u3067\u306fGPLv2\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001PG-Strom\u30b3\u30a2\u6a5f\u80fd\u3084\u5468\u8fba\u30c4\u30fc\u30eb\u3068\u7d44\u307f\u5408\u308f\u305b\u305f\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306b\u30e9\u30a4\u30bb\u30f3\u30b9\u4f53\u7cfb\u304c\u969c\u5bb3\u306b\u306a\u308b\u3068\u306e\u58f0\u3092\u8907\u6570\u3044\u305f\u3060\u3044\u3066\u3044\u307e\u3057\u305f\u3002","title":"PostgreSQL\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u63a1\u7528"},{"location":"release_v3.0/#_3","text":"\u72ec\u81ea\u306b int1 (8bit\u6574\u6570) \u30c7\u30fc\u30bf\u578b\u3001\u304a\u3088\u3073\u95a2\u9023\u3059\u308b\u6f14\u7b97\u5b50\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 pg2arrow \u306b --inner-join \u304a\u3088\u3073 --outer-join \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002PostgreSQL\u306e\u5217\u6570\u5236\u9650\u3092\u8d8a\u3048\u305f\u6570\u306e\u5217\u3092\u6301\u3064Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u30de\u30eb\u30c1GPU\u74b0\u5883\u3067\u306f\u3001GPU\u3054\u3068\u306b\u5c02\u7528\u306eGPU Memory Keeper\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u304c\u7acb\u3061\u4e0a\u304c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 PostgreSQL v13.x \u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 CUDA 11.2 \u304a\u3088\u3073 Ampere\u4e16\u4ee3\u306eGPU\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 ScaleFlux\u793e\u306eComputational Storage\u88fd\u54c1CSD2000\u30b7\u30ea\u30fc\u30ba\u3067\u306eGPUDirect SQL\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\uff08cuFile\u30c9\u30e9\u30a4\u30d0\u306e\u307f\uff09 \u96d1\u591a\u306a\u30d0\u30b0\u306e\u4fee\u6b63","title":"\u305d\u306e\u4ed6\u306e\u5909\u66f4"},{"location":"release_v3.0/#_4","text":"PostgreSQL v10.x \u7cfb\u5217\u306e\u30b5\u30dd\u30fc\u30c8\u304c\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002 Python\u30b9\u30af\u30ea\u30d7\u30c8\u3068\u306e\u30c7\u30fc\u30bf\u9023\u643a\u6a5f\u80fd\uff08PyStrom\uff09\u304c\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002","title":"\u5ec3\u6b62\u3055\u308c\u305f\u6a5f\u80fd"},{"location":"release_v5.0/","text":"PG-Strom v5.0\u30ea\u30ea\u30fc\u30b9 PG-Strom Development Team (15-Dec-2023) \u6982\u8981 PG-Strom v5.0\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u5909\u66f4\u306f\u70b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 \u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u3092\u4e00\u65b0\u3057\u3001\u5f93\u6765\u306e\u8a2d\u8a08\u306b\u304a\u3051\u308b\u554f\u984c\u70b9\u3092\u6539\u826f\u3057\u307e\u3057\u305f\u3002 \u30d7\u30ed\u30bb\u30b9\u30e2\u30c7\u30eb\u304c\u30de\u30eb\u30c1\u30d7\u30ed\u30bb\u30b9\u304b\u3089\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001GPU\u30ea\u30bd\u30fc\u30b9\u306e\u6d88\u8cbb\u91cf\u3092\u524a\u6e1b\u3057\u3001\u30bf\u30b9\u30af\u30b9\u30a4\u30c3\u30c1\u30f3\u30b0\u304c\u8efd\u91cf\u306b\u306a\u308a\u307e\u3057\u305f\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u306fCUDA C++\u3067\u52d5\u7684\u751f\u6210\u3055\u308c\u305f\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u304b\u3089\u7591\u4f3c\u30b3\u30fc\u30c9\u3078\u3068\u7f6e\u304d\u63db\u3048\u3089\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5b9f\u884c\u6642\u30b3\u30f3\u30d1\u30a4\u30eb(NVRTC)\u304c\u4e0d\u8981\u3068\u306a\u308a\u30af\u30a8\u30ea\u306e\u5fdc\u7b54\u901f\u5ea6\u304c\u5411\u4e0a\u3057\u305f\u307b\u304b\u3001\u5c06\u6765\u7684\u306bCSD(Computational Storage Drive)\u3084DPU(Data Processing Unit)\u3067\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u8a2d\u8a08\u5909\u66f4\u3067\u3059\u3002 GPU-Cache\u306fCUDA\u30de\u30cd\u30fc\u30b8\u30c9\u30e1\u30e2\u30ea\u4e0a\u306b\u5c55\u958b\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30aa\u30fc\u30d0\u30fc\u30b3\u30df\u30c3\u30c8\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u4e0a\u306ePostgreSQL\u30c7\u30fc\u30bf\u578b\u306e\u8868\u73fe\u304c\u3001Coalesced Memory Access\u3092\u610f\u8b58\u3057\u305f\u30ec\u30a4\u30a2\u30a6\u30c8\u306b\u5909\u308f\u308a\u307e\u3057\u305f\u3002 GpuPreAgg\u3067\u306eGROUP BY\u51e6\u7406\u304c\u4e00\u65b0\u3055\u308c\u3001\u5168\u822c\u7684\u306a\u51e6\u7406\u901f\u5ea6\u304c\u5411\u4e0a\u3057\u307e\u3057\u305f\u3002 GpuJoin\u306e\u6bb5\u6570\u304c\u6df1\u304f\u306a\u3063\u3066\u3082\u3001\u30bf\u30d7\u30eb\u306e\u5c55\u958b\u306f\u4e00\u56de\u3060\u3051\u3067\u6e08\u3080\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 Arrow_Fdw\u304a\u3088\u3073Pg2Arrow\u304cmin/max\u7d71\u8a08\u5024\u4ed8\u304d\u306eArrow\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d1\u30b1\u30c3\u30c8\u3092\u30ad\u30e3\u30d7\u30c1\u30e3\u3059\u308bPcap2Arrow\u30c4\u30fc\u30eb\u3001\u304a\u3088\u3073Arrow\u30d5\u30a1\u30a4\u30eb\u3092CSV\u51fa\u529b\u3059\u308barrow2csv\u30c4\u30fc\u30eb\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 \u52d5\u4f5c\u74b0\u5883 PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d; Volta\u4ee5\u964d\u3092\u63a8\u5968) \u30d7\u30ed\u30bb\u30b9\u30e2\u30c7\u30eb\u306e\u5909\u66f4 v5.0\u3067\u306f\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\uff08PG-Strom GPU Service\uff09\u304cGPU\u306e\u30ea\u30bd\u30fc\u30b9\u7ba1\u7406\u3084\u30bf\u30b9\u30af\u6295\u5165\u3092\u7d71\u62ec\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u3001PostgreSQL\u306e\u5404\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306fIPC\u3092\u901a\u3058\u3066GPU Service\u3078\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u51fa\u3057\u3001\u7d50\u679c\u3092\u53d7\u3051\u53d6\u308b\u5f62\u306b\u6539\u3081\u3089\u308c\u307e\u3057\u305f\u3002 v3.x\u7cfb\u5217\u307e\u3067\u306fPostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u304c\u500b\u5225\u306bGPU\u3092\u5236\u5fa1\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u306e\u8a2d\u8a08\u306f\u3001\u304b\u3064\u3066CUDA\u3084PG-Strom\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u54c1\u8cea\u304c\u5341\u5206\u3067\u306a\u3044\u6642\u4ee3\u306b\u554f\u984c\u7b87\u6240\u306e\u7279\u5b9a\u3092\u5bb9\u6613\u306b\u3059\u308b\u3068\u3044\u3046\u5229\u70b9\u304c\u3042\u3063\u305f\u3082\u306e\u306e\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30bb\u30c3\u30b7\u30e7\u30f3\u6570\u304c\u5897\u52a0\u3059\u308b\u3068\u6975\u7aef\u306bGPU\u30ea\u30bd\u30fc\u30b9\u3092\u6d88\u8cbb\u3057\u3001\u307e\u305f\u30bf\u30b9\u30af\u5207\u308a\u66ff\u3048\u306e\u89b3\u70b9\u304b\u3089\u3082\u975e\u63a8\u5968\u3068\u3055\u308c\u308b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u69cb\u9020\u3067\u3057\u305f\u3002 \u3053\u306e\u8a2d\u8a08\u5909\u66f4\u306b\u3088\u308a\u3001PG-Strom v5.0\u306f\u540c\u6642\u5b9f\u884c\u6570\u306e\u5897\u52a0\u306b\u5bfe\u3057\u3066\u9811\u5f37\u306b\u306a\u3063\u305f\u4ed6\u3001\u9ad8\u8ca0\u8377\u306aGPU\u30bf\u30b9\u30af\u306e\u5b9f\u884c\u6027\u80fd\u304c\u5411\u4e0a\u3057\u3066\u3044\u307e\u3059\u3002 \u7591\u4f3c\u30b3\u30fc\u30c9\u306e\u5c0e\u5165 PG-Strom v5.0\u3067\u306f\u3001SQL\u304b\u3089\u72ec\u81ea\u306e\u300e\u7591\u4f3c\u30b3\u30fc\u30c9\u300f\u3092\u751f\u6210\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u306f\u3053\u306e\u300e\u7591\u4f3c\u30b3\u30fc\u30c9\u300f\u3092\u5b9f\u884c\u3059\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u3068\u3057\u3066\u50cd\u304d\u307e\u3059\u3002v3.x\u7cfb\u5217\u306e\u3088\u3046\u306bCUDA C++\u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u3053\u308c\u306f\u4e00\u898b\u3001\u6027\u80fd\u4f4e\u4e0b\u306e\u8981\u56e0\u3068\u898b\u3048\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u3057\u304b\u3057\u3001\u5143\u3005\u52d5\u7684\u30b3\u30fc\u30c9\u751f\u6210\u306e\u5bfe\u8c61\u3068\u306a\u3063\u3066\u3044\u305f\u306e\u306fWHERE\u53e5\u306a\u3069\u30af\u30a8\u30ea\u306e\u5ea6\u306b\u5909\u5316\u3059\u308b\u3054\u304f\u4e00\u90e8\u5206\u3060\u3051\u3067\u3042\u308a\u3001\u5927\u534a\u306e\u5b9f\u88c5\u306f\u9759\u7684\u306b\u30d3\u30eb\u30c9\u3055\u308c\u3066\u3044\u305f\u307b\u304b\u3001NVRTC\u306b\u3088\u308b\u5b9f\u884c\u6642\u30b3\u30f3\u30d1\u30a4\u30eb\u306e\u51e6\u7406\uff08150ms\uff5e\u7a0b\u5ea6\uff09\u3092\u7701\u7565\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u305f\u3081\u3001\u5fdc\u7b54\u6642\u9593\u306e\u6539\u5584\u306b\u5bc4\u4e0e\u3057\u3066\u3044\u307e\u3059\u3002 \u300e\u7591\u4f3c\u30b3\u30fc\u30c9\u300f\u306fEXPLAIN VERBOSE\u306b\u3088\u3063\u3066\u8868\u793a\u3055\u308c\u308b\u4f4e\u30ec\u30d9\u30eb\u306a\u30b3\u30de\u30f3\u30c9\u30bb\u30c3\u30c8\u3067\u3001\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bWHERE\u53e5\u306b lo_quantity > 10 \u3068\u3044\u3046\u6f14\u7b97\u5f0f\u3092\u542b\u3080\u30af\u30a8\u30ea\u306f\u3001 Scan Quals OpCode \u3068\u3057\u3066 lo_quantity \u5217\u3068\u5b9a\u6570 10 \u3068\u306e\u5927\u5c0f\u95a2\u4fc2\u3092\u6bd4\u8f03\u3059\u308b numeric_gt \u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u3088\u3046\u51e6\u7406\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002 postgres=# explain verbose select count(*), sum(lo_quantity), lo_shipmode from lineorder where lo_quantity > 10 group by lo_shipmode; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- HashAggregate (cost=3242387.01..3242387.10 rows=7 width=51) Output: pgstrom.fcount((pgstrom.nrows())), pgstrom.sum_fp_num((pgstrom.psum((lo_quantity)::double precision))), lo_shipmode Group Key: lineorder.lo_shipmode -> Custom Scan (GpuPreAgg) on public.lineorder (cost=3242386.89..3242386.96 rows=7 width=51) Output: (pgstrom.nrows()), (pgstrom.psum((lo_quantity)::double precision)), lo_shipmode GPU Projection: pgstrom.nrows(), pgstrom.psum((lo_quantity)::double precision), lo_shipmode GPU Scan Quals: (lo_quantity > '10'::numeric) [rows: 600128800 -> 479262800] GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , KVecs-Buffer: nbytes: 83968, ndims: 2, items=[kvec0=<0x0000-dfff, type='numeric', expr='lo_quantity'>, kvec1=<0xe000-147ff, type='bpchar', expr='lo_shipmode'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, ]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, ]}}} Scan Quals OpCode: {Func(bool)::numeric_gt args=[{Var(numeric): slot=0, expr='lo_quantity'}, {Const(numeric): value='10'}]} Group-By KeyHash OpCode: {HashValue arg={SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}} Group-By KeyLoad OpCode: {LoadVars(depth=-2): kvars=[]} Group-By KeyComp OpCode: {Func(bool)::bpchareq args=[{Var(bpchar): slot=1, expr='lo_shipmode'}, {Var(bpchar): slot=2, expr='lo_shipmode'}]} Partial Aggregation OpCode: {AggFuncs args=[{SaveExpr: arg={Func(float8)::float8 arg={Var(numeric): kvec=0x0000-e000, expr='lo_quantity'}}}, {SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}]} Partial Function BufSz: 24 (18 rows) \u73fe\u5728\u306f\u307e\u3060\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u3053\u306e\u7591\u4f3c\u30b3\u30fc\u30c9\u306f\u3001\u5c06\u6765\u7684\u306bCSD(Computational Storage Drive)\u3084DPU(Data Processing Unit)\u3067SQL\u51e6\u7406\u3092\u30aa\u30d5\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u6539\u5584 CPU\u3068\u6bd4\u8f03\u3057\u3066\u3001GPU\u306f\u5e83\u5e2f\u57df\u306a\u30e1\u30e2\u30ea\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u6027\u80fd\u3092\u5f15\u304d\u51fa\u3059\u306b\u306f\u8fd1\u508d\u306e\u30e1\u30e2\u30ea\u9818\u57df\u3092\u540c\u3058\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308bCoalesced Memory Access\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 v5.0\u3067\u306fGPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u306b\u304a\u3051\u308bPostgreSQL\u30c7\u30fc\u30bf\u578b\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u304c\u6539\u826f\u3055\u308c\u3001Coalesced Memory Access\u306b\u9069\u3057\u305f\u5f62\u5f0f\u3068\u306a\u308a\u307e\u3057\u305f\u3002 PostgreSQL\u306e\u30c7\u30fc\u30bf\u578b\u3092\u305d\u306e\u307e\u307e\u5229\u7528\u3057\u305f\u5834\u5408\u3001\u3042\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u53c2\u7167\u3055\u308c\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u98db\u3073\u98db\u3073\u306e\u4f4d\u7f6e\u3092\u53d6\u308b\u4e8b\u306b\u306a\u308a\u3001DRAM\u304b\u3089\u306e\u8aad\u51fa\u3057\u5e2f\u57df\u3092\u6709\u52b9\u306b\u6d3b\u7528\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u308c\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u6bce\u306b\u8907\u6570\u500b\u307e\u3068\u3081\u3066\u914d\u7f6e\u3059\u308b\u4e8b\u3067\u3001\u96a3\u63a5\u30b3\u30a2\u304c\u96a3\u63a5\u9818\u57df\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u3001Coalesced Memory Access\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002 \u3053\u306e\u6539\u826f\u306f\u3001\u6975\u3081\u3066\u9ad8\u6027\u80fd\u306a\u30e1\u30e2\u30ea\u5e2f\u57df\u3092\u6301\u3064\u30cf\u30a4\u30a8\u30f3\u30c9GPU\u88fd\u54c1\u3060\u3051\u3067\u306a\u304f\u3001\u30df\u30c9\u30eb\u30a8\u30f3\u30c9\u7d1a\u306eGPU\u3067\u3082\u5341\u5206\u306a\u5b9f\u884c\u6027\u80fd\u3092\u5f15\u304d\u51fa\u3059\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002 Arrow_Fdw\u306e\u7d71\u8a08\u60c5\u5831\u30b5\u30dd\u30fc\u30c8 Pg2Arrow\u3067min/max\u7d71\u8a08\u60c5\u5831\u4ed8\u304d\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 Pg2Arrow\u306e\u65b0\u305f\u306a\u30aa\u30d7\u30b7\u30e7\u30f3 --stat=COLUMN_NAME \u306f\u3001RecordBatch\u5358\u4f4d\u3067\u6307\u5b9a\u3057\u305f\u5217\u306e\u6700\u5927\u5024/\u6700\u5c0f\u5024\u3092\u8a18\u9332\u3057\u3066\u304a\u304d\u3001\u305d\u308c\u3092Apache Arrow\u306eCustom-Metadata\u30e1\u30ab\u30cb\u30ba\u30e0\u3092\u5229\u7528\u3057\u3066\u30d5\u30c3\u30bf\u306b\u57cb\u3081\u8fbc\u307f\u307e\u3059\u3002 Arrow_Fdw\u3092\u4ecb\u3057\u3066Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u51fa\u3059\u969b\u3001\u4e0a\u8a18\u306emin/max\u7d71\u8a08\u60c5\u5831\u3092\u5229\u7528\u3057\u305f\u7bc4\u56f2\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30b9\u30ad\u30e3\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b\u691c\u7d22\u6761\u4ef6\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3042\u3063\u305f\u5834\u5408\u3001 WHERE ymd BETERRN '2020-01-01'::date AND '2021-12-31'::date ymd\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6700\u5927\u5024\u304c '2020-01-01'::date \u672a\u6e80\u3067\u3042\u308bRecord Batch\u3084\u3001 ymd\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6700\u5c0f\u5024\u304c '2021-12-31 ::date`\u3088\u308a\u5927\u304d\u306aRecord Batch\u306f\u3001 \u691c\u7d22\u6761\u4ef6\u306b\u30de\u30c3\u30c1\u3057\u306a\u3044\u4e8b\u304c\u660e\u3089\u304b\u3067\u3042\u308b\u305f\u3081\u3001Arrow_Fdw\u306f\u3053\u306eRecord Batch\u3092\u8aad\u307f\u98db\u3070\u3057\u307e\u3059\u3002 \u3053\u308c\u306b\u3088\u308a\u3001\u4f8b\u3048\u3070\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u306a\u3069\u3001\u8fd1\u3057\u3044\u5024\u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u304c\u8fd1\u508d\u306b\u96c6\u307e\u3063\u3066\u3044\u308b\u30d1\u30bf\u30fc\u30f3\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u304a\u3044\u3066\u306f\u3001\u7bc4\u56f2\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u7528\u3044\u305f\u7d5e\u8fbc\u307f\u3068\u540c\u7b49\u306e\u6027\u80fd\u304c\u5f97\u3089\u308c\u307e\u3059\u3002 \u305d\u306e\u4ed6\u306e\u5909\u66f4\u70b9 PostgreSQL v14 \u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002v15\u4ee5\u964d\u3078\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3092\u304a\u9858\u3044\u3057\u307e\u3059\u3002 Partition-wise GpuJoin\u6a5f\u80fd\u306b\u95a2\u3057\u3066\u306f\u3001\u958b\u767a\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u4e0a\u306e\u7406\u7531\u306b\u3088\u308a\u3001v5.0\u3067\u306f\u7121\u52b9\u5316\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5c06\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u518d\u3073\u5b9f\u88c5\u3055\u308c\u308b\u4e88\u5b9a\u3067\u3059\u3002","title":"PG-Strom v5.0"},{"location":"release_v5.0/#pg-strom-v50","text":"PG-Strom Development Team (15-Dec-2023)","title":"PG-Strom v5.0\u30ea\u30ea\u30fc\u30b9"},{"location":"release_v5.0/#_1","text":"PG-Strom v5.0\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u5909\u66f4\u306f\u70b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 \u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u3092\u4e00\u65b0\u3057\u3001\u5f93\u6765\u306e\u8a2d\u8a08\u306b\u304a\u3051\u308b\u554f\u984c\u70b9\u3092\u6539\u826f\u3057\u307e\u3057\u305f\u3002 \u30d7\u30ed\u30bb\u30b9\u30e2\u30c7\u30eb\u304c\u30de\u30eb\u30c1\u30d7\u30ed\u30bb\u30b9\u304b\u3089\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001GPU\u30ea\u30bd\u30fc\u30b9\u306e\u6d88\u8cbb\u91cf\u3092\u524a\u6e1b\u3057\u3001\u30bf\u30b9\u30af\u30b9\u30a4\u30c3\u30c1\u30f3\u30b0\u304c\u8efd\u91cf\u306b\u306a\u308a\u307e\u3057\u305f\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u306fCUDA C++\u3067\u52d5\u7684\u751f\u6210\u3055\u308c\u305f\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u304b\u3089\u7591\u4f3c\u30b3\u30fc\u30c9\u3078\u3068\u7f6e\u304d\u63db\u3048\u3089\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5b9f\u884c\u6642\u30b3\u30f3\u30d1\u30a4\u30eb(NVRTC)\u304c\u4e0d\u8981\u3068\u306a\u308a\u30af\u30a8\u30ea\u306e\u5fdc\u7b54\u901f\u5ea6\u304c\u5411\u4e0a\u3057\u305f\u307b\u304b\u3001\u5c06\u6765\u7684\u306bCSD(Computational Storage Drive)\u3084DPU(Data Processing Unit)\u3067\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u8a2d\u8a08\u5909\u66f4\u3067\u3059\u3002 GPU-Cache\u306fCUDA\u30de\u30cd\u30fc\u30b8\u30c9\u30e1\u30e2\u30ea\u4e0a\u306b\u5c55\u958b\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u306e\u30aa\u30fc\u30d0\u30fc\u30b3\u30df\u30c3\u30c8\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002 GPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u4e0a\u306ePostgreSQL\u30c7\u30fc\u30bf\u578b\u306e\u8868\u73fe\u304c\u3001Coalesced Memory Access\u3092\u610f\u8b58\u3057\u305f\u30ec\u30a4\u30a2\u30a6\u30c8\u306b\u5909\u308f\u308a\u307e\u3057\u305f\u3002 GpuPreAgg\u3067\u306eGROUP BY\u51e6\u7406\u304c\u4e00\u65b0\u3055\u308c\u3001\u5168\u822c\u7684\u306a\u51e6\u7406\u901f\u5ea6\u304c\u5411\u4e0a\u3057\u307e\u3057\u305f\u3002 GpuJoin\u306e\u6bb5\u6570\u304c\u6df1\u304f\u306a\u3063\u3066\u3082\u3001\u30bf\u30d7\u30eb\u306e\u5c55\u958b\u306f\u4e00\u56de\u3060\u3051\u3067\u6e08\u3080\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 Arrow_Fdw\u304a\u3088\u3073Pg2Arrow\u304cmin/max\u7d71\u8a08\u5024\u4ed8\u304d\u306eArrow\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d1\u30b1\u30c3\u30c8\u3092\u30ad\u30e3\u30d7\u30c1\u30e3\u3059\u308bPcap2Arrow\u30c4\u30fc\u30eb\u3001\u304a\u3088\u3073Arrow\u30d5\u30a1\u30a4\u30eb\u3092CSV\u51fa\u529b\u3059\u308barrow2csv\u30c4\u30fc\u30eb\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002","title":"\u6982\u8981"},{"location":"release_v5.0/#_2","text":"PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d; Volta\u4ee5\u964d\u3092\u63a8\u5968)","title":"\u52d5\u4f5c\u74b0\u5883"},{"location":"release_v5.0/#_3","text":"v5.0\u3067\u306f\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30ef\u30fc\u30ab\u30fc\u30d7\u30ed\u30bb\u30b9\uff08PG-Strom GPU Service\uff09\u304cGPU\u306e\u30ea\u30bd\u30fc\u30b9\u7ba1\u7406\u3084\u30bf\u30b9\u30af\u6295\u5165\u3092\u7d71\u62ec\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u3001PostgreSQL\u306e\u5404\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306fIPC\u3092\u901a\u3058\u3066GPU Service\u3078\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u51fa\u3057\u3001\u7d50\u679c\u3092\u53d7\u3051\u53d6\u308b\u5f62\u306b\u6539\u3081\u3089\u308c\u307e\u3057\u305f\u3002 v3.x\u7cfb\u5217\u307e\u3067\u306fPostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u304c\u500b\u5225\u306bGPU\u3092\u5236\u5fa1\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u306e\u8a2d\u8a08\u306f\u3001\u304b\u3064\u3066CUDA\u3084PG-Strom\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u54c1\u8cea\u304c\u5341\u5206\u3067\u306a\u3044\u6642\u4ee3\u306b\u554f\u984c\u7b87\u6240\u306e\u7279\u5b9a\u3092\u5bb9\u6613\u306b\u3059\u308b\u3068\u3044\u3046\u5229\u70b9\u304c\u3042\u3063\u305f\u3082\u306e\u306e\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30bb\u30c3\u30b7\u30e7\u30f3\u6570\u304c\u5897\u52a0\u3059\u308b\u3068\u6975\u7aef\u306bGPU\u30ea\u30bd\u30fc\u30b9\u3092\u6d88\u8cbb\u3057\u3001\u307e\u305f\u30bf\u30b9\u30af\u5207\u308a\u66ff\u3048\u306e\u89b3\u70b9\u304b\u3089\u3082\u975e\u63a8\u5968\u3068\u3055\u308c\u308b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u69cb\u9020\u3067\u3057\u305f\u3002 \u3053\u306e\u8a2d\u8a08\u5909\u66f4\u306b\u3088\u308a\u3001PG-Strom v5.0\u306f\u540c\u6642\u5b9f\u884c\u6570\u306e\u5897\u52a0\u306b\u5bfe\u3057\u3066\u9811\u5f37\u306b\u306a\u3063\u305f\u4ed6\u3001\u9ad8\u8ca0\u8377\u306aGPU\u30bf\u30b9\u30af\u306e\u5b9f\u884c\u6027\u80fd\u304c\u5411\u4e0a\u3057\u3066\u3044\u307e\u3059\u3002","title":"\u30d7\u30ed\u30bb\u30b9\u30e2\u30c7\u30eb\u306e\u5909\u66f4"},{"location":"release_v5.0/#_4","text":"PG-Strom v5.0\u3067\u306f\u3001SQL\u304b\u3089\u72ec\u81ea\u306e\u300e\u7591\u4f3c\u30b3\u30fc\u30c9\u300f\u3092\u751f\u6210\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u306f\u3053\u306e\u300e\u7591\u4f3c\u30b3\u30fc\u30c9\u300f\u3092\u5b9f\u884c\u3059\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u3068\u3057\u3066\u50cd\u304d\u307e\u3059\u3002v3.x\u7cfb\u5217\u306e\u3088\u3046\u306bCUDA C++\u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u3053\u308c\u306f\u4e00\u898b\u3001\u6027\u80fd\u4f4e\u4e0b\u306e\u8981\u56e0\u3068\u898b\u3048\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u3057\u304b\u3057\u3001\u5143\u3005\u52d5\u7684\u30b3\u30fc\u30c9\u751f\u6210\u306e\u5bfe\u8c61\u3068\u306a\u3063\u3066\u3044\u305f\u306e\u306fWHERE\u53e5\u306a\u3069\u30af\u30a8\u30ea\u306e\u5ea6\u306b\u5909\u5316\u3059\u308b\u3054\u304f\u4e00\u90e8\u5206\u3060\u3051\u3067\u3042\u308a\u3001\u5927\u534a\u306e\u5b9f\u88c5\u306f\u9759\u7684\u306b\u30d3\u30eb\u30c9\u3055\u308c\u3066\u3044\u305f\u307b\u304b\u3001NVRTC\u306b\u3088\u308b\u5b9f\u884c\u6642\u30b3\u30f3\u30d1\u30a4\u30eb\u306e\u51e6\u7406\uff08150ms\uff5e\u7a0b\u5ea6\uff09\u3092\u7701\u7565\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u305f\u3081\u3001\u5fdc\u7b54\u6642\u9593\u306e\u6539\u5584\u306b\u5bc4\u4e0e\u3057\u3066\u3044\u307e\u3059\u3002 \u300e\u7591\u4f3c\u30b3\u30fc\u30c9\u300f\u306fEXPLAIN VERBOSE\u306b\u3088\u3063\u3066\u8868\u793a\u3055\u308c\u308b\u4f4e\u30ec\u30d9\u30eb\u306a\u30b3\u30de\u30f3\u30c9\u30bb\u30c3\u30c8\u3067\u3001\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bWHERE\u53e5\u306b lo_quantity > 10 \u3068\u3044\u3046\u6f14\u7b97\u5f0f\u3092\u542b\u3080\u30af\u30a8\u30ea\u306f\u3001 Scan Quals OpCode \u3068\u3057\u3066 lo_quantity \u5217\u3068\u5b9a\u6570 10 \u3068\u306e\u5927\u5c0f\u95a2\u4fc2\u3092\u6bd4\u8f03\u3059\u308b numeric_gt \u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u3088\u3046\u51e6\u7406\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002 postgres=# explain verbose select count(*), sum(lo_quantity), lo_shipmode from lineorder where lo_quantity > 10 group by lo_shipmode; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- HashAggregate (cost=3242387.01..3242387.10 rows=7 width=51) Output: pgstrom.fcount((pgstrom.nrows())), pgstrom.sum_fp_num((pgstrom.psum((lo_quantity)::double precision))), lo_shipmode Group Key: lineorder.lo_shipmode -> Custom Scan (GpuPreAgg) on public.lineorder (cost=3242386.89..3242386.96 rows=7 width=51) Output: (pgstrom.nrows()), (pgstrom.psum((lo_quantity)::double precision)), lo_shipmode GPU Projection: pgstrom.nrows(), pgstrom.psum((lo_quantity)::double precision), lo_shipmode GPU Scan Quals: (lo_quantity > '10'::numeric) [rows: 600128800 -> 479262800] GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , KVecs-Buffer: nbytes: 83968, ndims: 2, items=[kvec0=<0x0000-dfff, type='numeric', expr='lo_quantity'>, kvec1=<0xe000-147ff, type='bpchar', expr='lo_shipmode'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, ]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, ]}}} Scan Quals OpCode: {Func(bool)::numeric_gt args=[{Var(numeric): slot=0, expr='lo_quantity'}, {Const(numeric): value='10'}]} Group-By KeyHash OpCode: {HashValue arg={SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}} Group-By KeyLoad OpCode: {LoadVars(depth=-2): kvars=[]} Group-By KeyComp OpCode: {Func(bool)::bpchareq args=[{Var(bpchar): slot=1, expr='lo_shipmode'}, {Var(bpchar): slot=2, expr='lo_shipmode'}]} Partial Aggregation OpCode: {AggFuncs args=[{SaveExpr: arg={Func(float8)::float8 arg={Var(numeric): kvec=0x0000-e000, expr='lo_quantity'}}}, {SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}]} Partial Function BufSz: 24 (18 rows) \u73fe\u5728\u306f\u307e\u3060\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u3053\u306e\u7591\u4f3c\u30b3\u30fc\u30c9\u306f\u3001\u5c06\u6765\u7684\u306bCSD(Computational Storage Drive)\u3084DPU(Data Processing Unit)\u3067SQL\u51e6\u7406\u3092\u30aa\u30d5\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002","title":"\u7591\u4f3c\u30b3\u30fc\u30c9\u306e\u5c0e\u5165"},{"location":"release_v5.0/#_5","text":"CPU\u3068\u6bd4\u8f03\u3057\u3066\u3001GPU\u306f\u5e83\u5e2f\u57df\u306a\u30e1\u30e2\u30ea\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u6027\u80fd\u3092\u5f15\u304d\u51fa\u3059\u306b\u306f\u8fd1\u508d\u306e\u30e1\u30e2\u30ea\u9818\u57df\u3092\u540c\u3058\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308bCoalesced Memory Access\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 v5.0\u3067\u306fGPU\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u306b\u304a\u3051\u308bPostgreSQL\u30c7\u30fc\u30bf\u578b\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u304c\u6539\u826f\u3055\u308c\u3001Coalesced Memory Access\u306b\u9069\u3057\u305f\u5f62\u5f0f\u3068\u306a\u308a\u307e\u3057\u305f\u3002 PostgreSQL\u306e\u30c7\u30fc\u30bf\u578b\u3092\u305d\u306e\u307e\u307e\u5229\u7528\u3057\u305f\u5834\u5408\u3001\u3042\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u53c2\u7167\u3055\u308c\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u98db\u3073\u98db\u3073\u306e\u4f4d\u7f6e\u3092\u53d6\u308b\u4e8b\u306b\u306a\u308a\u3001DRAM\u304b\u3089\u306e\u8aad\u51fa\u3057\u5e2f\u57df\u3092\u6709\u52b9\u306b\u6d3b\u7528\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u308c\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u6bce\u306b\u8907\u6570\u500b\u307e\u3068\u3081\u3066\u914d\u7f6e\u3059\u308b\u4e8b\u3067\u3001\u96a3\u63a5\u30b3\u30a2\u304c\u96a3\u63a5\u9818\u57df\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u51fa\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u3001Coalesced Memory Access\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002 \u3053\u306e\u6539\u826f\u306f\u3001\u6975\u3081\u3066\u9ad8\u6027\u80fd\u306a\u30e1\u30e2\u30ea\u5e2f\u57df\u3092\u6301\u3064\u30cf\u30a4\u30a8\u30f3\u30c9GPU\u88fd\u54c1\u3060\u3051\u3067\u306a\u304f\u3001\u30df\u30c9\u30eb\u30a8\u30f3\u30c9\u7d1a\u306eGPU\u3067\u3082\u5341\u5206\u306a\u5b9f\u884c\u6027\u80fd\u3092\u5f15\u304d\u51fa\u3059\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002","title":"\u30c7\u30fc\u30bf\u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u6539\u5584"},{"location":"release_v5.0/#arrow_fdw","text":"Pg2Arrow\u3067min/max\u7d71\u8a08\u60c5\u5831\u4ed8\u304d\u306eApache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 Pg2Arrow\u306e\u65b0\u305f\u306a\u30aa\u30d7\u30b7\u30e7\u30f3 --stat=COLUMN_NAME \u306f\u3001RecordBatch\u5358\u4f4d\u3067\u6307\u5b9a\u3057\u305f\u5217\u306e\u6700\u5927\u5024/\u6700\u5c0f\u5024\u3092\u8a18\u9332\u3057\u3066\u304a\u304d\u3001\u305d\u308c\u3092Apache Arrow\u306eCustom-Metadata\u30e1\u30ab\u30cb\u30ba\u30e0\u3092\u5229\u7528\u3057\u3066\u30d5\u30c3\u30bf\u306b\u57cb\u3081\u8fbc\u307f\u307e\u3059\u3002 Arrow_Fdw\u3092\u4ecb\u3057\u3066Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u51fa\u3059\u969b\u3001\u4e0a\u8a18\u306emin/max\u7d71\u8a08\u60c5\u5831\u3092\u5229\u7528\u3057\u305f\u7bc4\u56f2\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30b9\u30ad\u30e3\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001Arrow_Fdw\u5916\u90e8\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b\u691c\u7d22\u6761\u4ef6\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3042\u3063\u305f\u5834\u5408\u3001 WHERE ymd BETERRN '2020-01-01'::date AND '2021-12-31'::date ymd\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6700\u5927\u5024\u304c '2020-01-01'::date \u672a\u6e80\u3067\u3042\u308bRecord Batch\u3084\u3001 ymd\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6700\u5c0f\u5024\u304c '2021-12-31 ::date`\u3088\u308a\u5927\u304d\u306aRecord Batch\u306f\u3001 \u691c\u7d22\u6761\u4ef6\u306b\u30de\u30c3\u30c1\u3057\u306a\u3044\u4e8b\u304c\u660e\u3089\u304b\u3067\u3042\u308b\u305f\u3081\u3001Arrow_Fdw\u306f\u3053\u306eRecord Batch\u3092\u8aad\u307f\u98db\u3070\u3057\u307e\u3059\u3002 \u3053\u308c\u306b\u3088\u308a\u3001\u4f8b\u3048\u3070\u30ed\u30b0\u30c7\u30fc\u30bf\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u306a\u3069\u3001\u8fd1\u3057\u3044\u5024\u3092\u6301\u3064\u30ec\u30b3\u30fc\u30c9\u304c\u8fd1\u508d\u306b\u96c6\u307e\u3063\u3066\u3044\u308b\u30d1\u30bf\u30fc\u30f3\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u304a\u3044\u3066\u306f\u3001\u7bc4\u56f2\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u7528\u3044\u305f\u7d5e\u8fbc\u307f\u3068\u540c\u7b49\u306e\u6027\u80fd\u304c\u5f97\u3089\u308c\u307e\u3059\u3002","title":"Arrow_Fdw\u306e\u7d71\u8a08\u60c5\u5831\u30b5\u30dd\u30fc\u30c8"},{"location":"release_v5.0/#_6","text":"PostgreSQL v14 \u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002v15\u4ee5\u964d\u3078\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3092\u304a\u9858\u3044\u3057\u307e\u3059\u3002 Partition-wise GpuJoin\u6a5f\u80fd\u306b\u95a2\u3057\u3066\u306f\u3001\u958b\u767a\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u4e0a\u306e\u7406\u7531\u306b\u3088\u308a\u3001v5.0\u3067\u306f\u7121\u52b9\u5316\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5c06\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u518d\u3073\u5b9f\u88c5\u3055\u308c\u308b\u4e88\u5b9a\u3067\u3059\u3002","title":"\u305d\u306e\u4ed6\u306e\u5909\u66f4\u70b9"},{"location":"release_v5.1/","text":"PG-Strom v5.1\u30ea\u30ea\u30fc\u30b9 PG-Strom Development Team (17-Apr-2024) \u6982\u8981 PG-Strom v5.1\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u5909\u66f4\u306f\u70b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3057\u305fGpuJoin/PreAgg\u306e\u30b5\u30dd\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 GPU\u30b3\u30fc\u30c9\u306e\u30d3\u30eb\u30c9\u3092\u8d77\u52d5\u6642\u306b\u5b9f\u884c\u74b0\u5883\u3067\u884c\u3046\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 pg2arrow\u304c\u4e26\u5217\u51e6\u7406\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 CUDA Stack\u306e\u30b5\u30a4\u30ba\u3092\u9069\u5fdc\u7684\u306b\u8a2d\u5b9a\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u7d2f\u7a4d\u7684\u306a\u30d0\u30b0\u306e\u4fee\u6b63 \u52d5\u4f5c\u74b0\u5883 PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d; Volta\u4ee5\u964d\u3092\u63a8\u5968) \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5bfe\u5fdc PostgreSQL\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3078\u306e\u5bfe\u5fdc\u81ea\u4f53\u306fPG-Strom v3.0\u3067\u3082\u884c\u308f\u308c\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u3046\u307e\u304f\u5b9f\u884c\u8a08\u753b\u3092\u4f5c\u6210\u3067\u304d\u306a\u3044\u4e8b\u304c\u591a\u304f\u3001\u5b9f\u9a13\u7684\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u8131\u3059\u308b\u4e8b\u306e\u3067\u304d\u306a\u3044\u3082\u306e\u3067\u3057\u305f\u3002\u305d\u3053\u3067\u3001PG-Strom v5.1\u3067\u306f\u5185\u90e8\u306e\u8a2d\u8a08\u3092\u6839\u672c\u7684\u306b\u898b\u76f4\u3057\u3066\u518d\u5ea6\u5b9f\u88c5\u3057\u3001\u518d\u3073\u6b63\u5f0f\u306a\u6a5f\u80fd\u3068\u3057\u3066\u53d6\u308a\u5165\u308c\u307e\u3057\u305f\u3002 \u4ee5\u4e0b\u306e lineorder \u30c6\u30fc\u30d6\u30eb\u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u3066\u304a\u308a\u3001 date1 \u30c6\u30fc\u30d6\u30eb\u304c\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b\u5834\u5408\u3001\u3053\u308c\u307e\u3067\u306f\u3001 lineorder \u914d\u4e0b\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u3092\u5168\u3066 Append \u30ce\u30fc\u30c9\u306b\u3088\u3063\u3066\u7d50\u5408\u3055\u308c\u305f\u5f8c\u3067\u306a\u3051\u308c\u3070JOIN\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 \u901a\u5e38\u3001PG-Strom\u306fCPU\u3092\u30d0\u30a4\u30d1\u30b9\u3057\u3066NVME-SSD\u304b\u3089GPU\u3078\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\u3057\u3066\u5404\u7a2e\u306eSQL\u51e6\u7406\u3092\u884c\u3046\uff08GPU-Direct SQL\uff09\u305f\u3081\u3001JOIN\u306b\u5148\u7acb\u3063\u3066CPU\u5074\u3078\u30c7\u30fc\u30bf\u3092\u623b\u3055\u306d\u3070\u306a\u3089\u306a\u3044\u3068\u3044\u3046\u306e\u306f\u5927\u304d\u306a\u30da\u30ca\u30eb\u30c6\u30a3\u3067\u3059\u3002 ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate -> Hash Join Hash Cond: (lineorder.lo_orderdate = date1.d_datekey) -> Append -> Custom Scan (GpuScan) on lineorder__p1992 lineorder_1 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1993 lineorder_2 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1994 lineorder_3 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1995 lineorder_4 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1996 lineorder_5 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1997 lineorder_6 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1998 lineorder_7 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on lineorder__p1999 lineorder_8 Filter: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash -> Seq Scan on date1 Filter: (d_year = 1993) (37 rows) PG-Strom v5.1\u3067\u306f\u3001\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3092\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3057\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u3068JOIN\u3057\u3066\u304b\u3089\u7d50\u679c\u3092\u8fd4\u3059\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u5834\u5408\u306b\u3088\u3063\u3066\u306fGROUP-BY\u51e6\u7406\u307e\u3067\u6e08\u307e\u305b\u305f\u4e0a\u3067CPU\u5074\u306b\u623b\u3059\u4e8b\u3082\u3067\u304d\u3001\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001\u7dcf\u65706\u5104\u4ef6\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u691c\u7d22\u6761\u4ef6\u3092\u6e80\u305f\u30597\u5343\u4e07\u884c\u3092\u8fd4\u3055\u306d\u3070\u306a\u3089\u306a\u3044\u3068\u3053\u308d\u3001\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b date1 \u3068\u306eJOIN\u3068\u3001\u305d\u306e\u6b21\u306b\u5b9f\u884c\u3059\u308b\u96c6\u7d04\u95a2\u6570 SUM() \u3092\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306b\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u4e8b\u3067\u3001CPU\u3067\u306f\u50c5\u304b8\u884c\u3092\u51e6\u7406\u3059\u308b\u3060\u3051\u3067\u6e08\u3093\u3067\u3044\u307e\u3059\u3002 INNER\u5074\u306e\u8aad\u51fa\u3057\u304c\u8907\u6570\u56de\u767a\u751f\u3059\u308b\u3068\u3044\u3046\u30c7\u30e1\u30ea\u30c3\u30c8\u306f\u3042\u308a\u307e\u3059\u304c\uff08\u203b\u5c06\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u6539\u4fee\u3055\u308c\u308b\u4e88\u5b9a\u3067\u3059\uff09\u3001\u3053\u306e\u3088\u3046\u306a\u66f8\u304d\u63db\u3048\u306b\u3088\u3063\u3066CPU\u3067\u51e6\u7406\u3059\u3079\u304d\u30c7\u30fc\u30bf\u304c\u5927\u5e45\u306b\u6e1b\u5c11\u3057\u3001\u51e6\u7406\u901f\u5ea6\u306e\u6539\u5584\u306b\u5bc4\u4e0e\u3057\u307e\u3059\u3002 ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------- Aggregate -> Append -> Custom Scan (GpuPreAgg) on lineorder__p1992 lineorder_1 GPU Projection: pgstrom.psum(((lineorder_1.lo_extendedprice * lineorder_1.lo_discount))::double precision) GPU Scan Quals: ((lineorder_1.lo_discount >= '1'::numeric) AND (lineorder_1.lo_discount <= '3'::numeric) AND (lineorder_1.lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU Join Quals [1]: (lineorder_1.lo_orderdate = date1.d_datekey) ... [nrows: 11911380 -> 1700960] GPU Outer Hash [1]: lineorder_1.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1993 lineorder_2 GPU Projection: pgstrom.psum(((lineorder_2.lo_extendedprice * lineorder_2.lo_discount))::double precision) GPU Scan Quals: ((lineorder_2.lo_discount >= '1'::numeric) AND (lineorder_2.lo_discount <= '3'::numeric) AND (lineorder_2.lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU Join Quals [1]: (lineorder_2.lo_orderdate = date1.d_datekey) ... [nrows: 11980460 -> 1710824] GPU Outer Hash [1]: lineorder_2.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1994 lineorder_3 GPU Projection: pgstrom.psum(((lineorder_3.lo_extendedprice * lineorder_3.lo_discount))::double precision) GPU Scan Quals: ((lineorder_3.lo_discount >= '1'::numeric) AND (lineorder_3.lo_discount <= '3'::numeric) AND (lineorder_3.lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU Join Quals [1]: (lineorder_3.lo_orderdate = date1.d_datekey) ... [nrows: 12150700 -> 1735135] GPU Outer Hash [1]: lineorder_3.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1995 lineorder_4 GPU Projection: pgstrom.psum(((lineorder_4.lo_extendedprice * lineorder_4.lo_discount))::double precision) GPU Scan Quals: ((lineorder_4.lo_discount >= '1'::numeric) AND (lineorder_4.lo_discount <= '3'::numeric) AND (lineorder_4.lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU Join Quals [1]: (lineorder_4.lo_orderdate = date1.d_datekey) ... [nrows: 11779920 -> 1682188] GPU Outer Hash [1]: lineorder_4.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1996 lineorder_5 GPU Projection: pgstrom.psum(((lineorder_5.lo_extendedprice * lineorder_5.lo_discount))::double precision) GPU Scan Quals: ((lineorder_5.lo_discount >= '1'::numeric) AND (lineorder_5.lo_discount <= '3'::numeric) AND (lineorder_5.lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU Join Quals [1]: (lineorder_5.lo_orderdate = date1.d_datekey) ... [nrows: 11942810 -> 1705448] GPU Outer Hash [1]: lineorder_5.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1997 lineorder_6 GPU Projection: pgstrom.psum(((lineorder_6.lo_extendedprice * lineorder_6.lo_discount))::double precision) GPU Scan Quals: ((lineorder_6.lo_discount >= '1'::numeric) AND (lineorder_6.lo_discount <= '3'::numeric) AND (lineorder_6.lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU Join Quals [1]: (lineorder_6.lo_orderdate = date1.d_datekey) ... [nrows: 12069740 -> 1723574] GPU Outer Hash [1]: lineorder_6.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1998 lineorder_7 GPU Projection: pgstrom.psum(((lineorder_7.lo_extendedprice * lineorder_7.lo_discount))::double precision) GPU Scan Quals: ((lineorder_7.lo_discount >= '1'::numeric) AND (lineorder_7.lo_discount <= '3'::numeric) AND (lineorder_7.lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU Join Quals [1]: (lineorder_7.lo_orderdate = date1.d_datekey) ... [nrows: 6898138 -> 985063] GPU Outer Hash [1]: lineorder_7.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1999 lineorder_8 GPU Projection: pgstrom.psum(((lineorder_8.lo_extendedprice * lineorder_8.lo_discount))::double precision) GPU Scan Quals: ((lineorder_8.lo_discount >= '1'::numeric) AND (lineorder_8.lo_discount <= '3'::numeric) AND (lineorder_8.lo_quantity < '25'::numeric)) [rows: 150 -> 1] GPU Join Quals [1]: (lineorder_8.lo_orderdate = date1.d_datekey) ... [nrows: 1 -> 1] GPU Outer Hash [1]: lineorder_8.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) (82 rows) GPU\u30b3\u30fc\u30c9\u306e\u8d77\u52d5\u6642\u30d3\u30eb\u30c9 \u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePG-Strom\u3067\u306f\u3001\u4e88\u3081\u30d3\u30eb\u30c9\u3055\u308c\u305fGPU\u5411\u3051\u306e\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u914d\u5e03\u3059\u308b\u65b9\u5f0f\u3092\u3068\u3063\u3066\u3044\u307e\u3057\u305f\u3002 \u3053\u308c\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u306f\u3042\u308b\u306e\u3067\u3059\u304c\u3001PG-Strom\uff08PostgreSQL\uff09\u5b9f\u884c\u74b0\u5883\u306eCUDA Toolkit\u3084NVIDIA\u30c9\u30e9\u30a4\u30d0\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u7d44\u5408\u305b\u306b\u3088\u3063\u3066\u306f\u3001GPU\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8a8d\u8b58\u3067\u304d\u305a\u5b9f\u884c\u6642\u30a8\u30e9\u30fc\u3092\u8d77\u3053\u3057\u3066\u3057\u307e\u3046\u4e8b\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u5178\u578b\u7684\u306b\u306f\u3001RPM\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30d3\u30eb\u30c9\u3057\u305f\u74b0\u5883\u3088\u308a\u3082\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306eCUDA Toolkit\u3084NVIDIA\u30c9\u30e9\u30a4\u30d0\u304c\u5b9f\u884c\u74b0\u5883\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3067\u3059\u3002 PG-Strom v5.1\u3067\u306f\u3001\u8d77\u52d5\u6642\u306bGPU\u7528\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3084CUDA Toolkit\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u3001\u5dee\u5206\u304c\u3042\u308c\u3070GPU\u5411\u3051\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30d3\u30eb\u30c9\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u306e\u4fee\u6b63\u306b\u3088\u308a\u3001PG-Strom\u306f\u5b9f\u884c\u74b0\u5883\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305fGPU\u30c7\u30d0\u30a4\u30b9\u3001\u304a\u3088\u3073CUDA Toolkit\u5411\u3051\u306eGPU\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u4e00\u90e8\u306ePG-Strom\u7528GPU\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u306f\u30d3\u30eb\u30c9\u306b\u6642\u9593\u304c\u304b\u304b\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001PG-Strom\u3084CUDA Toolkit\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u5f8c\u3001\u521d\u56de\u306e\u8d77\u52d5\u6642\u306b\u306fPG-Strom\u306e\u6a5f\u80fd\u304c\u5229\u7528\u53ef\u80fd\u3068\u306a\u308b\u307e\u3067\u6570\u5206\u306e\u6642\u9593\u304c\u304b\u304b\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002 pg2arrow\u306e\u4e26\u5217\u5b9f\u884c pg2arrow \u306f\u65b0\u305f\u306b -n|--num-workers \u30aa\u30d7\u30b7\u30e7\u30f3\u3068 -k|--parallel-keys \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 -n N_WORKERS \u306f\u6307\u5b9a\u3057\u305f\u6570\u306e\u30b9\u30ec\u30c3\u30c9\u304c\u305d\u308c\u305e\u308cPostgreSQL\u306b\u63a5\u7d9a\u3057\u3001\u4e26\u5217\u306b\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3092Apache Arrow\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002\u30af\u30a8\u30ea\u306b\u306f\u7279\u6b8a\u306a\u6587\u5b57\u5217 $(N_WORKERS) \u3068 $(WORKER_ID) \u3092\u542b\u3080\u4e8b\u304c\u3067\u304d\u3001\u3053\u308c\u3089\u306fPostgreSQL\u306b\u30af\u30a8\u30ea\u3092\u6295\u3052\u308b\u969b\u306b\u3001\u305d\u308c\u305e\u308c\u30ef\u30fc\u30ab\u30fc\u6570\u3068\u30ef\u30fc\u30ab\u30fc\u56fa\u6709\u306eID\u5024\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u307e\u3059\u3002\u30e6\u30fc\u30b6\u306f\u3053\u308c\u3092\u5229\u7528\u3057\u3066\u3001\u5404\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u8aad\u307f\u51fa\u3059\u30bf\u30d7\u30eb\u304c\u4e92\u3044\u306b\u91cd\u8907\u3057\u305f\u308a\u6b20\u640d\u3057\u305f\u308a\u3057\u306a\u3044\u3088\u3046\u306b\u8abf\u6574\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u3082\u3046\u4e00\u3064\u306e -k|--parallel-key \u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u5f15\u6570\u3067\u4e0e\u3048\u305f\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u30ad\u30fc\u5024\u306e\u305d\u308c\u305e\u308c\u306b\u5bfe\u3057\u3066\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u3092\u8d77\u52d5\u3057\u3001\u30af\u30a8\u30ea\u4e2d\u306e $(PARALLEL_KEY) \u3092\u30ad\u30fc\u3068\u7f6e\u304d\u63db\u3048\u305f\u4e0a\u3067\u3001\u3053\u308c\u3092PostgreSQL\u3067\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3092Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001 lineorder \u30c6\u30fc\u30d6\u30eb\u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u3066\u304a\u308a\u3001\u5b50\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u3001 lineorder__sun , lineorder__mon , ... lineorder__sat \u304c\u5b58\u5728\u3057\u305f\u5834\u5408\u3001\u500b\u3005\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u305d\u308c\u305e\u308c\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u3068\u3044\u3063\u305f\u5f62\u3067\u51e6\u7406\u3092\u4e26\u5217\u5316\u3067\u304d\u307e\u3059\u3002 \u3053\u306e\u5834\u5408\u3001 -k \u30aa\u30d7\u30b7\u30e7\u30f3\u306f -k sun,mon,tue,wed,thu,fri,sat \u3068\u6307\u5b9a\u3057\u3001 -c \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u306f SELECT * FROM lineorder__$(PARALLEL_KEY) \u3068\u6307\u5b9a\u3059\u308c\u3070\u30017\u500b\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u305d\u308c\u305e\u308c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 $ pg2arrow -d ssbm -c 'SELECT * FROM lineorder__$(PARALLEL_KEY)' -o /path/to/f_lineorder.arrow -k=sun,mon,tue,wed,thu,fri,sat --progress worker:1 SQL=[SELECT * FROM lineorder__sun] worker:3 SQL=[SELECT * FROM lineorder__tue] worker:2 SQL=[SELECT * FROM lineorder__mon] worker:4 SQL=[SELECT * FROM lineorder__wed] worker:5 SQL=[SELECT * FROM lineorder__thu] : :","title":"PG-Strom v5.1"},{"location":"release_v5.1/#pg-strom-v51","text":"PG-Strom Development Team (17-Apr-2024)","title":"PG-Strom v5.1\u30ea\u30ea\u30fc\u30b9"},{"location":"release_v5.1/#_1","text":"PG-Strom v5.1\u306b\u304a\u3051\u308b\u4e3b\u8981\u306a\u5909\u66f4\u306f\u70b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002 \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306b\u5bfe\u5fdc\u3057\u305fGpuJoin/PreAgg\u306e\u30b5\u30dd\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002 GPU\u30b3\u30fc\u30c9\u306e\u30d3\u30eb\u30c9\u3092\u8d77\u52d5\u6642\u306b\u5b9f\u884c\u74b0\u5883\u3067\u884c\u3046\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 pg2arrow\u304c\u4e26\u5217\u51e6\u7406\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002 CUDA Stack\u306e\u30b5\u30a4\u30ba\u3092\u9069\u5fdc\u7684\u306b\u8a2d\u5b9a\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u7d2f\u7a4d\u7684\u306a\u30d0\u30b0\u306e\u4fee\u6b63","title":"\u6982\u8981"},{"location":"release_v5.1/#_2","text":"PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 \u4ee5\u964d CUDA Toolkit\u306e\u30b5\u30dd\u30fc\u30c8\u3059\u308bLinux\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3 Intel x86 64bit \u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3(x86_64) NVIDIA GPU CC 6.0 \u4ee5\u964d (Pascal\u4ee5\u964d; Volta\u4ee5\u964d\u3092\u63a8\u5968)","title":"\u52d5\u4f5c\u74b0\u5883"},{"location":"release_v5.1/#_3","text":"PostgreSQL\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u3078\u306e\u5bfe\u5fdc\u81ea\u4f53\u306fPG-Strom v3.0\u3067\u3082\u884c\u308f\u308c\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u3046\u307e\u304f\u5b9f\u884c\u8a08\u753b\u3092\u4f5c\u6210\u3067\u304d\u306a\u3044\u4e8b\u304c\u591a\u304f\u3001\u5b9f\u9a13\u7684\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u8131\u3059\u308b\u4e8b\u306e\u3067\u304d\u306a\u3044\u3082\u306e\u3067\u3057\u305f\u3002\u305d\u3053\u3067\u3001PG-Strom v5.1\u3067\u306f\u5185\u90e8\u306e\u8a2d\u8a08\u3092\u6839\u672c\u7684\u306b\u898b\u76f4\u3057\u3066\u518d\u5ea6\u5b9f\u88c5\u3057\u3001\u518d\u3073\u6b63\u5f0f\u306a\u6a5f\u80fd\u3068\u3057\u3066\u53d6\u308a\u5165\u308c\u307e\u3057\u305f\u3002 \u4ee5\u4e0b\u306e lineorder \u30c6\u30fc\u30d6\u30eb\u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u3066\u304a\u308a\u3001 date1 \u30c6\u30fc\u30d6\u30eb\u304c\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b\u5834\u5408\u3001\u3053\u308c\u307e\u3067\u306f\u3001 lineorder \u914d\u4e0b\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u3092\u5168\u3066 Append \u30ce\u30fc\u30c9\u306b\u3088\u3063\u3066\u7d50\u5408\u3055\u308c\u305f\u5f8c\u3067\u306a\u3051\u308c\u3070JOIN\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 \u901a\u5e38\u3001PG-Strom\u306fCPU\u3092\u30d0\u30a4\u30d1\u30b9\u3057\u3066NVME-SSD\u304b\u3089GPU\u3078\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\u3057\u3066\u5404\u7a2e\u306eSQL\u51e6\u7406\u3092\u884c\u3046\uff08GPU-Direct SQL\uff09\u305f\u3081\u3001JOIN\u306b\u5148\u7acb\u3063\u3066CPU\u5074\u3078\u30c7\u30fc\u30bf\u3092\u623b\u3055\u306d\u3070\u306a\u3089\u306a\u3044\u3068\u3044\u3046\u306e\u306f\u5927\u304d\u306a\u30da\u30ca\u30eb\u30c6\u30a3\u3067\u3059\u3002 ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate -> Hash Join Hash Cond: (lineorder.lo_orderdate = date1.d_datekey) -> Append -> Custom Scan (GpuScan) on lineorder__p1992 lineorder_1 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1993 lineorder_2 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1994 lineorder_3 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1995 lineorder_4 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1996 lineorder_5 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1997 lineorder_6 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1998 lineorder_7 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on lineorder__p1999 lineorder_8 Filter: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash -> Seq Scan on date1 Filter: (d_year = 1993) (37 rows) PG-Strom v5.1\u3067\u306f\u3001\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3092\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3057\u3001\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u8aad\u307f\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u3068JOIN\u3057\u3066\u304b\u3089\u7d50\u679c\u3092\u8fd4\u3059\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u5834\u5408\u306b\u3088\u3063\u3066\u306fGROUP-BY\u51e6\u7406\u307e\u3067\u6e08\u307e\u305b\u305f\u4e0a\u3067CPU\u5074\u306b\u623b\u3059\u4e8b\u3082\u3067\u304d\u3001\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001\u7dcf\u65706\u5104\u4ef6\u306e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u691c\u7d22\u6761\u4ef6\u3092\u6e80\u305f\u30597\u5343\u4e07\u884c\u3092\u8fd4\u3055\u306d\u3070\u306a\u3089\u306a\u3044\u3068\u3053\u308d\u3001\u975e\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u3067\u3042\u308b date1 \u3068\u306eJOIN\u3068\u3001\u305d\u306e\u6b21\u306b\u5b9f\u884c\u3059\u308b\u96c6\u7d04\u95a2\u6570 SUM() \u3092\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5b50\u30c6\u30fc\u30d6\u30eb\u306b\u30d7\u30c3\u30b7\u30e5\u30c0\u30a6\u30f3\u3059\u308b\u4e8b\u3067\u3001CPU\u3067\u306f\u50c5\u304b8\u884c\u3092\u51e6\u7406\u3059\u308b\u3060\u3051\u3067\u6e08\u3093\u3067\u3044\u307e\u3059\u3002 INNER\u5074\u306e\u8aad\u51fa\u3057\u304c\u8907\u6570\u56de\u767a\u751f\u3059\u308b\u3068\u3044\u3046\u30c7\u30e1\u30ea\u30c3\u30c8\u306f\u3042\u308a\u307e\u3059\u304c\uff08\u203b\u5c06\u6765\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u6539\u4fee\u3055\u308c\u308b\u4e88\u5b9a\u3067\u3059\uff09\u3001\u3053\u306e\u3088\u3046\u306a\u66f8\u304d\u63db\u3048\u306b\u3088\u3063\u3066CPU\u3067\u51e6\u7406\u3059\u3079\u304d\u30c7\u30fc\u30bf\u304c\u5927\u5e45\u306b\u6e1b\u5c11\u3057\u3001\u51e6\u7406\u901f\u5ea6\u306e\u6539\u5584\u306b\u5bc4\u4e0e\u3057\u307e\u3059\u3002 ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------- Aggregate -> Append -> Custom Scan (GpuPreAgg) on lineorder__p1992 lineorder_1 GPU Projection: pgstrom.psum(((lineorder_1.lo_extendedprice * lineorder_1.lo_discount))::double precision) GPU Scan Quals: ((lineorder_1.lo_discount >= '1'::numeric) AND (lineorder_1.lo_discount <= '3'::numeric) AND (lineorder_1.lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU Join Quals [1]: (lineorder_1.lo_orderdate = date1.d_datekey) ... [nrows: 11911380 -> 1700960] GPU Outer Hash [1]: lineorder_1.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1993 lineorder_2 GPU Projection: pgstrom.psum(((lineorder_2.lo_extendedprice * lineorder_2.lo_discount))::double precision) GPU Scan Quals: ((lineorder_2.lo_discount >= '1'::numeric) AND (lineorder_2.lo_discount <= '3'::numeric) AND (lineorder_2.lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU Join Quals [1]: (lineorder_2.lo_orderdate = date1.d_datekey) ... [nrows: 11980460 -> 1710824] GPU Outer Hash [1]: lineorder_2.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1994 lineorder_3 GPU Projection: pgstrom.psum(((lineorder_3.lo_extendedprice * lineorder_3.lo_discount))::double precision) GPU Scan Quals: ((lineorder_3.lo_discount >= '1'::numeric) AND (lineorder_3.lo_discount <= '3'::numeric) AND (lineorder_3.lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU Join Quals [1]: (lineorder_3.lo_orderdate = date1.d_datekey) ... [nrows: 12150700 -> 1735135] GPU Outer Hash [1]: lineorder_3.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1995 lineorder_4 GPU Projection: pgstrom.psum(((lineorder_4.lo_extendedprice * lineorder_4.lo_discount))::double precision) GPU Scan Quals: ((lineorder_4.lo_discount >= '1'::numeric) AND (lineorder_4.lo_discount <= '3'::numeric) AND (lineorder_4.lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU Join Quals [1]: (lineorder_4.lo_orderdate = date1.d_datekey) ... [nrows: 11779920 -> 1682188] GPU Outer Hash [1]: lineorder_4.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1996 lineorder_5 GPU Projection: pgstrom.psum(((lineorder_5.lo_extendedprice * lineorder_5.lo_discount))::double precision) GPU Scan Quals: ((lineorder_5.lo_discount >= '1'::numeric) AND (lineorder_5.lo_discount <= '3'::numeric) AND (lineorder_5.lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU Join Quals [1]: (lineorder_5.lo_orderdate = date1.d_datekey) ... [nrows: 11942810 -> 1705448] GPU Outer Hash [1]: lineorder_5.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1997 lineorder_6 GPU Projection: pgstrom.psum(((lineorder_6.lo_extendedprice * lineorder_6.lo_discount))::double precision) GPU Scan Quals: ((lineorder_6.lo_discount >= '1'::numeric) AND (lineorder_6.lo_discount <= '3'::numeric) AND (lineorder_6.lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU Join Quals [1]: (lineorder_6.lo_orderdate = date1.d_datekey) ... [nrows: 12069740 -> 1723574] GPU Outer Hash [1]: lineorder_6.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1998 lineorder_7 GPU Projection: pgstrom.psum(((lineorder_7.lo_extendedprice * lineorder_7.lo_discount))::double precision) GPU Scan Quals: ((lineorder_7.lo_discount >= '1'::numeric) AND (lineorder_7.lo_discount <= '3'::numeric) AND (lineorder_7.lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU Join Quals [1]: (lineorder_7.lo_orderdate = date1.d_datekey) ... [nrows: 6898138 -> 985063] GPU Outer Hash [1]: lineorder_7.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1999 lineorder_8 GPU Projection: pgstrom.psum(((lineorder_8.lo_extendedprice * lineorder_8.lo_discount))::double precision) GPU Scan Quals: ((lineorder_8.lo_discount >= '1'::numeric) AND (lineorder_8.lo_discount <= '3'::numeric) AND (lineorder_8.lo_quantity < '25'::numeric)) [rows: 150 -> 1] GPU Join Quals [1]: (lineorder_8.lo_orderdate = date1.d_datekey) ... [nrows: 1 -> 1] GPU Outer Hash [1]: lineorder_8.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) (82 rows)","title":"\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5bfe\u5fdc"},{"location":"release_v5.1/#gpu","text":"\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePG-Strom\u3067\u306f\u3001\u4e88\u3081\u30d3\u30eb\u30c9\u3055\u308c\u305fGPU\u5411\u3051\u306e\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u914d\u5e03\u3059\u308b\u65b9\u5f0f\u3092\u3068\u3063\u3066\u3044\u307e\u3057\u305f\u3002 \u3053\u308c\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u306f\u3042\u308b\u306e\u3067\u3059\u304c\u3001PG-Strom\uff08PostgreSQL\uff09\u5b9f\u884c\u74b0\u5883\u306eCUDA Toolkit\u3084NVIDIA\u30c9\u30e9\u30a4\u30d0\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u7d44\u5408\u305b\u306b\u3088\u3063\u3066\u306f\u3001GPU\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8a8d\u8b58\u3067\u304d\u305a\u5b9f\u884c\u6642\u30a8\u30e9\u30fc\u3092\u8d77\u3053\u3057\u3066\u3057\u307e\u3046\u4e8b\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u5178\u578b\u7684\u306b\u306f\u3001RPM\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30d3\u30eb\u30c9\u3057\u305f\u74b0\u5883\u3088\u308a\u3082\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306eCUDA Toolkit\u3084NVIDIA\u30c9\u30e9\u30a4\u30d0\u304c\u5b9f\u884c\u74b0\u5883\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3067\u3059\u3002 PG-Strom v5.1\u3067\u306f\u3001\u8d77\u52d5\u6642\u306bGPU\u7528\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3084CUDA Toolkit\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u3001\u5dee\u5206\u304c\u3042\u308c\u3070GPU\u5411\u3051\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30d3\u30eb\u30c9\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u306e\u4fee\u6b63\u306b\u3088\u308a\u3001PG-Strom\u306f\u5b9f\u884c\u74b0\u5883\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305fGPU\u30c7\u30d0\u30a4\u30b9\u3001\u304a\u3088\u3073CUDA Toolkit\u5411\u3051\u306eGPU\u30d0\u30a4\u30ca\u30ea\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u4e00\u90e8\u306ePG-Strom\u7528GPU\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u306f\u30d3\u30eb\u30c9\u306b\u6642\u9593\u304c\u304b\u304b\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001PG-Strom\u3084CUDA Toolkit\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u5f8c\u3001\u521d\u56de\u306e\u8d77\u52d5\u6642\u306b\u306fPG-Strom\u306e\u6a5f\u80fd\u304c\u5229\u7528\u53ef\u80fd\u3068\u306a\u308b\u307e\u3067\u6570\u5206\u306e\u6642\u9593\u304c\u304b\u304b\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002","title":"GPU\u30b3\u30fc\u30c9\u306e\u8d77\u52d5\u6642\u30d3\u30eb\u30c9"},{"location":"release_v5.1/#pg2arrow","text":"pg2arrow \u306f\u65b0\u305f\u306b -n|--num-workers \u30aa\u30d7\u30b7\u30e7\u30f3\u3068 -k|--parallel-keys \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 -n N_WORKERS \u306f\u6307\u5b9a\u3057\u305f\u6570\u306e\u30b9\u30ec\u30c3\u30c9\u304c\u305d\u308c\u305e\u308cPostgreSQL\u306b\u63a5\u7d9a\u3057\u3001\u4e26\u5217\u306b\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3092Apache Arrow\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002\u30af\u30a8\u30ea\u306b\u306f\u7279\u6b8a\u306a\u6587\u5b57\u5217 $(N_WORKERS) \u3068 $(WORKER_ID) \u3092\u542b\u3080\u4e8b\u304c\u3067\u304d\u3001\u3053\u308c\u3089\u306fPostgreSQL\u306b\u30af\u30a8\u30ea\u3092\u6295\u3052\u308b\u969b\u306b\u3001\u305d\u308c\u305e\u308c\u30ef\u30fc\u30ab\u30fc\u6570\u3068\u30ef\u30fc\u30ab\u30fc\u56fa\u6709\u306eID\u5024\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u307e\u3059\u3002\u30e6\u30fc\u30b6\u306f\u3053\u308c\u3092\u5229\u7528\u3057\u3066\u3001\u5404\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u8aad\u307f\u51fa\u3059\u30bf\u30d7\u30eb\u304c\u4e92\u3044\u306b\u91cd\u8907\u3057\u305f\u308a\u6b20\u640d\u3057\u305f\u308a\u3057\u306a\u3044\u3088\u3046\u306b\u8abf\u6574\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u3082\u3046\u4e00\u3064\u306e -k|--parallel-key \u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u5f15\u6570\u3067\u4e0e\u3048\u305f\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u30ad\u30fc\u5024\u306e\u305d\u308c\u305e\u308c\u306b\u5bfe\u3057\u3066\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u3092\u8d77\u52d5\u3057\u3001\u30af\u30a8\u30ea\u4e2d\u306e $(PARALLEL_KEY) \u3092\u30ad\u30fc\u3068\u7f6e\u304d\u63db\u3048\u305f\u4e0a\u3067\u3001\u3053\u308c\u3092PostgreSQL\u3067\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3092Apache Arrow\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001 lineorder \u30c6\u30fc\u30d6\u30eb\u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u5316\u3055\u308c\u3066\u304a\u308a\u3001\u5b50\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u3001 lineorder__sun , lineorder__mon , ... lineorder__sat \u304c\u5b58\u5728\u3057\u305f\u5834\u5408\u3001\u500b\u3005\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u305d\u308c\u305e\u308c\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u3068\u3044\u3063\u305f\u5f62\u3067\u51e6\u7406\u3092\u4e26\u5217\u5316\u3067\u304d\u307e\u3059\u3002 \u3053\u306e\u5834\u5408\u3001 -k \u30aa\u30d7\u30b7\u30e7\u30f3\u306f -k sun,mon,tue,wed,thu,fri,sat \u3068\u6307\u5b9a\u3057\u3001 -c \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u306f SELECT * FROM lineorder__$(PARALLEL_KEY) \u3068\u6307\u5b9a\u3059\u308c\u3070\u30017\u500b\u306e\u30ef\u30fc\u30ab\u30fc\u30b9\u30ec\u30c3\u30c9\u304c\u305d\u308c\u305e\u308c\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u5b50\u30c6\u30fc\u30d6\u30eb\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 $ pg2arrow -d ssbm -c 'SELECT * FROM lineorder__$(PARALLEL_KEY)' -o /path/to/f_lineorder.arrow -k=sun,mon,tue,wed,thu,fri,sat --progress worker:1 SQL=[SELECT * FROM lineorder__sun] worker:3 SQL=[SELECT * FROM lineorder__tue] worker:2 SQL=[SELECT * FROM lineorder__mon] worker:4 SQL=[SELECT * FROM lineorder__wed] worker:5 SQL=[SELECT * FROM lineorder__thu] : :","title":"pg2arrow\u306e\u4e26\u5217\u5b9f\u884c"},{"location":"ssd2gpu/","text":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c \u6982\u8981 SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u9ad8\u901f\u306b\u51e6\u7406\u3059\u308b\u306b\u306f\u3001\u30d7\u30ed\u30bb\u30c3\u30b5\u304c\u52b9\u7387\u3088\u304f\u51e6\u7406\u3092\u884c\u3046\u306e\u3068\u540c\u69d8\u306b\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3084\u30e1\u30e2\u30ea\u304b\u3089\u30d7\u30ed\u30bb\u30c3\u30b5\u3078\u9ad8\u901f\u306b\u30c7\u30fc\u30bf\u3092\u4f9b\u7d66\u3059\u308b\u4e8b\u304c\u91cd\u8981\u3067\u3059\u3002\u51e6\u7406\u3059\u3079\u304d\u30c7\u30fc\u30bf\u304c\u30d7\u30ed\u30bb\u30c3\u30b5\u306b\u5c4a\u3044\u3066\u3044\u306a\u3051\u308c\u3070\u3001\u30d7\u30ed\u30bb\u30c3\u30b5\u306f\u624b\u6301\u3061\u7121\u6c99\u6c70\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u6a5f\u80fd\u306f\u3001PCIe\u30d0\u30b9\u306b\u76f4\u7d50\u3059\u308b\u4e8b\u3067\u9ad8\u901f\u306aI/O\u51e6\u7406\u3092\u5b9f\u73fe\u3059\u308bNVMe-SSD\u3068\u3001\u540c\u3058PCIe\u30d0\u30b9\u4e0a\u306b\u63a5\u7d9a\u3055\u308c\u305fGPU\u3092\u30c0\u30a4\u30ec\u30af\u30c8\u306b\u63a5\u7d9a\u3057\u3001\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9650\u754c\u306b\u8fd1\u3044\u901f\u5ea6\u3067\u30c7\u30fc\u30bf\u3092\u30d7\u30ed\u30bb\u30c3\u30b5\u306b\u4f9b\u7d66\u3059\u308b\u4e8b\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u9ad8\u901f\u306b\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002 \u901a\u5e38\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u4e0a\u306b\u683c\u7d0d\u3055\u308c\u305fPostgreSQL\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u306f\u3001PCIe\u30d0\u30b9\u3092\u901a\u3057\u3066\u3044\u3063\u305f\u3093CPU/RAM\u3078\u3068\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002\u305d\u306e\u5f8c\u3001\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u306b\u3057\u305f\u304c\u3063\u3066WHERE\u53e5\u306b\u3088\u308b\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3084JOIN/GROUP BY\u3068\u3044\u3063\u305f\u51e6\u7406\u3092\u884c\u3046\u308f\u3051\u3067\u3059\u304c\u3001\u96c6\u8a08\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u7279\u6027\u4e0a\u3001\u5165\u529b\u3059\u308b\u30c7\u30fc\u30bf\u4ef6\u6570\u3088\u308a\u51fa\u529b\u3059\u308b\u30c7\u30fc\u30bf\u4ef6\u6570\u306e\u65b9\u304c\u306f\u308b\u304b\u306b\u5c11\u306a\u3044\u4ef6\u6570\u3068\u306a\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u6570\u5341\u5104\u884c\u3092\u8aad\u307f\u51fa\u3057\u305f\u7d50\u679c\u3092GROUP BY\u3067\u96c6\u7d04\u3057\u305f\u7d50\u679c\u304c\u9ad8\u3005\u6570\u767e\u884c\u3068\u3044\u3046\u4e8b\u3082\u73cd\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002 \u8a00\u3044\u63db\u3048\u308c\u3070\u3001\u6211\u3005\u306f\u30b4\u30df\u30c7\u30fc\u30bf\u3092\u904b\u3076\u305f\u3081\u306bPCIe\u30d0\u30b9\u4e0a\u306e\u5e2f\u57df\u3092\u6d88\u8cbb\u3057\u3066\u3044\u308b\u3068\u3082\u8a00\u3048\u307e\u3059\u304c\u3001CPU\u304c\u30ec\u30b3\u30fc\u30c9\u306e\u4e2d\u8eab\u3092\u8abf\u3079\u308b\u307e\u3067\u306f\u3001\u305d\u306e\u8981\u4e0d\u8981\u3092\u5224\u65ad\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u4e00\u822c\u7684\u306a\u5b9f\u88c5\u3067\u306f\u3053\u308c\u306f\u4e0d\u53ef\u907f\u3068\u8a00\u3048\u307e\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u30c7\u30fc\u30bf\u306e\u6d41\u308c\u3092\u5909\u3048\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u4e0a\u306e\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092PCIe\u30d0\u30b9\u4e0a\u306eP2P DMA\u3092\u7528\u3044\u3066GPU\u306b\u76f4\u63a5\u8ee2\u9001\u3057\u3001GPU\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u51e6\u7406\u3059\u308b\u4e8b\u3067CPU\u304c\u51e6\u7406\u3059\u3079\u304d\u30ec\u30b3\u30fc\u30c9\u6570\u3092\u6e1b\u3089\u3059\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002\u3044\u308f\u3070\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3068CPU/RAM\u306e\u9593\u306b\u4f4d\u7f6e\u3057\u3066SQL\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u30d7\u30ea\u30d7\u30ed\u30bb\u30c3\u30b5\u3068\u3057\u3066GPU\u3092\u6d3b\u7528\u3057\u3001\u7d50\u679c\u3068\u3057\u3066I/O\u51e6\u7406\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u3059\u3002 \u672c\u6a5f\u80fd\u306f\u3001\u5185\u90e8\u7684\u306bNVIDIA GPUDirect Storage\u30e2\u30b8\u30e5\u30fc\u30eb\uff08 nvidia-fs \uff09\u3092\u4f7f\u7528\u3057\u3066\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u3068NVME\u30b9\u30c8\u30ec\u30fc\u30b8\u3068\u306e\u9593\u3067P2P\u306e\u30c7\u30fc\u30bf\u8ee2\u9001\u3092\u884c\u3044\u307e\u3059\u3002 \u3057\u305f\u304c\u3063\u3066\u3001\u672c\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u3001PostgreSQL\u306e\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3042\u308bPG-Strom\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u4e0a\u8a18\u306eLinux kernel\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002 \u307e\u305f\u3001\u672c\u6a5f\u80fd\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u306e\u306fNVME\u4ed5\u69d8\u306eSSD\u3084\u3001NVME-oF\u3067\u63a5\u7d9a\u3055\u308c\u305f\u30ea\u30e2\u30fc\u30c8\u30c7\u30d0\u30a4\u30b9\u306e\u307f\u3067\u3059\u3002 SAS\u3084SATA\u3068\u3044\u3063\u305f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3067\u63a5\u7d9a\u3055\u308c\u305f\u65e7\u5f0f\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002 \u4eca\u307e\u3067\u306b\u52d5\u4f5c\u5b9f\u7e3e\u306e\u3042\u308bNVME-SSD\u306b\u3064\u3044\u3066\u306f 002: HW Validation List \u304c\u53c2\u8003\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002 \u521d\u671f\u8a2d\u5b9a \u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u4ee5\u524d\u306ePG-Strom\u3067\u306f\u3001GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306e\u5229\u7528\u306b\u306fHeteroDB\u793e\u306e\u958b\u767a\u3057\u305f\u72ec\u81ea\u306eLinux kernel\u30c9\u30e9\u30a4\u30d0\u304c\u5fc5\u8981\u3067\u3057\u305f\u304c\u3001v3.0\u4ee5\u964d\u3067\u306fNVIDIA\u306e\u63d0\u4f9b\u3059\u308bGPUDirect Storage\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u8a2d\u8a08\u3092\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002GPUDirect Storage\u7528\u306eLinux kernel\u30c9\u30e9\u30a4\u30d0\uff08 nvidia-fs \uff09\u306fCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d7\u30ed\u30bb\u30b9\u306b\u7d71\u5408\u3055\u308c\u3001\u672c\u30de\u30cb\u30e5\u30a2\u30eb\u306e\u300c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d\u306e\u7ae0\u306b\u8a18\u8f09\u306e\u624b\u9806\u3067\u30b7\u30b9\u30c6\u30e0\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u305f\u5834\u5408\u3001\u7279\u306b\u8ffd\u52a0\u306e\u8a2d\u5b9a\u306f\u5fc5\u8981\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u5fc5\u8981\u306aLinux kernel\u30c9\u30e9\u30a4\u30d0\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3001 modinfo \u30b3\u30de\u30f3\u30c9\u3084 lsmod \u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u3066\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 $ modinfo nvidia-fs filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/nvidia-fs.ko.xz description: NVIDIA GPUDirect Storage license: GPL v2 version: 2.20.5 rhelversion: 9.4 srcversion: 096A726CAEC0A059E24049E depends: retpoline: Y name: nvidia_fs vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions sig_id: PKCS#7 signer: DKMS module signing key sig_key: 18:B4:AE:27:B8:7D:74:4F:C2:27:68:2A:EB:E0:6A:F0:84:B2:94:EE sig_hashalgo: sha512 : : $ lsmod | grep nvidia nvidia_fs 323584 32 nvidia_uvm 6877184 4 nvidia 8822784 43 nvidia_uvm,nvidia_fs drm 741376 2 drm_kms_helper,nvidia \u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306e\u8a2d\u8a08 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u4ee5\u4e0b\u306e\u6761\u4ef6\u3067\u767a\u52d5\u3057\u307e\u3059\u3002 \u30b9\u30ad\u30e3\u30f3\u5bfe\u8c61\u306e\u30c6\u30fc\u30d6\u30eb\u304cNVMe-SSD\u3067\u69cb\u6210\u3055\u308c\u305f\u533a\u753b\u306b\u914d\u7f6e\u3055\u308c\u3066\u3044\u308b\u3002 /dev/nvmeXXXX \u30d6\u30ed\u30c3\u30af\u30c7\u30d0\u30a4\u30b9\u3001\u307e\u305f\u306f /dev/nvmeXXXX \u30d6\u30ed\u30c3\u30af\u30c7\u30d0\u30a4\u30b9\u306e\u307f\u304b\u3089\u69cb\u6210\u3055\u308c\u305fmd-raid0\u533a\u753b\u304c\u5bfe\u8c61\u3067\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u30b5\u30a4\u30ba\u304c pg_strom.gpudirect_threshold \u3088\u308a\u3082\u5927\u304d\u3044\u4e8b\u3002 \u3053\u306e\u8a2d\u5b9a\u5024\u306f\u4efb\u610f\u306b\u5909\u66f4\u53ef\u80fd\u3067\u3059\u304c\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f\u672c\u4f53\u642d\u8f09\u7269\u7406\u30e1\u30e2\u30ea\u306b shared_buffers \u306e\u8a2d\u5b9a\u5024\u306e1/3\u3092\u52a0\u3048\u305f\u5927\u304d\u3055\u3067\u3059\u3002 Note md-raid0\u3092\u7528\u3044\u3066\u8907\u6570\u306eNVMe-SSD\u533a\u753b\u304b\u3089\u30b9\u30c8\u30e9\u30a4\u30d4\u30f3\u30b0\u8aad\u51fa\u3057\u3092\u884c\u3046\u306b\u306f\u3001HeteroDB\u793e\u306e\u63d0\u4f9b\u3059\u308b\u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30ba\u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3\u306e\u9069\u7528\u304c\u5fc5\u8981\u3067\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u3092NVMe-SSD\u3067\u69cb\u6210\u3055\u308c\u305f\u533a\u753b\u306b\u914d\u7f6e\u3059\u308b\u306b\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u5168\u4f53\u3092NVMe-SSD\u30dc\u30ea\u30e5\u30fc\u30e0\u306b\u683c\u7d0d\u3059\u308b\u4ee5\u5916\u306b\u3082\u3001PostgreSQL\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u6a5f\u80fd\u3092\u7528\u3044\u3066\u7279\u5b9a\u306e\u30c6\u30fc\u30d6\u30eb\u3084\u7279\u5b9a\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u307f\u3092NVMe-SSD\u30dc\u30ea\u30e5\u30fc\u30e0\u306b\u914d\u7f6e\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4f8b\u3048\u3070 /opt/nvme \u306bNVMe-SSD\u30dc\u30ea\u30e5\u30fc\u30e0\u304c\u30de\u30a6\u30f3\u30c8\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 PostgreSQL\u306e\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u306e\u6a29\u9650\u3067\u5f53\u8a72\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u66f8\u304d\u3067\u304d\u308b\u3088\u3046\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 CREATE TABLESPACE my_nvme LOCATION '/opt/nvme'; \u3053\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u4e0a\u306b\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001 CREATE TABLE \u69cb\u6587\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002 CREATE TABLE my_table (...) TABLESPACE my_nvme; \u3042\u308b\u3044\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u3092\u5909\u66f4\u3059\u308b\u306b\u306f\u3001 ALTER DATABASE \u69cb\u6587\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u306e\u5834\u5408\u3001\u65e2\u5b58\u30c6\u30fc\u30d6\u30eb\u306e\u914d\u7f6e\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306f\u5909\u66f4\u3055\u308c\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 ALTER DATABASE my_database SET TABLESPACE my_nvme; \u904b\u7528 GPU\u3068NVME-SSD\u9593\u306e\u8ddd\u96e2 \u30b5\u30fc\u30d0\u306e\u9078\u5b9a\u3068GPU\u304a\u3088\u3073NVME-SSD\u306e\u642d\u8f09\u306b\u3042\u305f\u308a\u3001\u30c7\u30d0\u30a4\u30b9\u306e\u6301\u3064\u6027\u80fd\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059\u306b\u306f\u3001\u30c7\u30d0\u30a4\u30b9\u9593\u306e\u8ddd\u96e2\u3092\u610f\u8b58\u3057\u305f\u30b3\u30f3\u30d5\u30a3\u30b0\u304c\u5fc5\u8981\u3067\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u304c\u305d\u306e\u57fa\u76e4\u3068\u3057\u3066\u4f7f\u7528\u3057\u3066\u3044\u308b NVIDIA GPUDirect RDMA \u306f\u3001P2P DMA\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u4e92\u3044\u306e\u30c7\u30d0\u30a4\u30b9\u304c\u540c\u3058PCIe root complex\u306e\u914d\u4e0b\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u8981\u6c42\u3057\u3066\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u30c7\u30e5\u30a2\u30ebCPU\u30b7\u30b9\u30c6\u30e0\u3067NVME-SSD\u304cCPU1\u306b\u3001GPU\u304cCPU2\u306b\u63a5\u7d9a\u3055\u308c\u3066\u304a\u308a\u3001P2P DMA\u304cCPU\u9593\u306eQPI\u3092\u6a2a\u5207\u308b\u3088\u3046\u69cb\u6210\u3059\u308b\u4e8b\u306f\u3067\u304d\u307e\u305b\u3093\u3002 \u307e\u305f\u3001\u6027\u80fd\u306e\u89b3\u70b9\u304b\u3089\u306fCPU\u5185\u8535\u306ePCIe\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3088\u308a\u3082\u3001\u5c02\u7528\u306ePCIe\u30b9\u30a4\u30c3\u30c1\u3092\u4ecb\u3057\u3066\u4e92\u3044\u306e\u30c7\u30d0\u30a4\u30b9\u3092\u63a5\u7d9a\u3059\u308b\u65b9\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u5199\u771f\u306fHPC\u5411\u3051\u30b5\u30fc\u30d0\u306e\u30de\u30b6\u30fc\u30dc\u30fc\u30c9\u3067\u30018\u672c\u306ePCIe x16\u30b9\u30ed\u30c3\u30c8\u304cPCIe\u30b9\u30a4\u30c3\u30c1\u3092\u4ecb\u3057\u3066\u4e92\u3044\u306b\u5bfe\u3068\u306a\u308b\u30b9\u30ed\u30c3\u30c8\u3068\u63a5\u7d9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u5199\u771f\u306e\u5de6\u5074\u306e\u30b9\u30ed\u30c3\u30c8\u306fCPU1\u306b\u3001\u53f3\u5074\u306e\u30b9\u30ed\u30c3\u30c8\u306fCPU2\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001SSD-2\u4e0a\u306b\u69cb\u7bc9\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3092\u7528\u3044\u3066\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u5834\u5408\u3001\u6700\u9069\u306aGPU\u306e\u9078\u629e\u306fGPU-2\u3067\u3057\u3087\u3046\u3002\u307e\u305fGPU-1\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001GPUDirect RDMA\u306e\u5236\u7d04\u304b\u3089\u3001GPU-3\u3068GPU-4\u306e\u4f7f\u7528\u306f\u907f\u3051\u306d\u3070\u306a\u308a\u307e\u305b\u3093\u3002 PG-Strom\u306f\u8d77\u52d5\u6642\u306b\u30b7\u30b9\u30c6\u30e0\u306ePCIe\u30d0\u30b9\u30c8\u30dd\u30ed\u30b8\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3001GPU\u3068NVME-SSD\u9593\u306e\u8ad6\u7406\u7684\u306a\u8ddd\u96e2\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8d77\u52d5\u6642\u306e\u30ed\u30b0\u306b\u8a18\u9332\u3055\u308c\u3066\u304a\u308a\u3001\u4f8b\u3048\u3070 /dev/nvme2 \u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u6642\u306fGPU1\u3068\u3044\u3063\u305f\u5177\u5408\u306b\u3001\u5404NVME-SSD\u3054\u3068\u306b\u6700\u3082\u8ddd\u96e2\u306e\u8fd1\u3044GPU\u3092\u512a\u5148\u3057\u3066\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 $ pg_ctl restart : LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78> LOG: [0000:81:00:0] nvme0 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] LOG: [0000:82:00:0] nvme2 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c2:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c6:00:0] nvme5 (Corsair MP600 CORE) --> GPU0 [dist=9] LOG: [0000:c3:00:0] nvme4 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c1:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c4:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] \u901a\u5e38\u306f\u81ea\u52d5\u8a2d\u5b9a\u3067\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002 \u305f\u3060\u3001NVME-over-Fabric(RDMA)\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306fPCIe\u30d0\u30b9\u4e0a\u306envme\u30c7\u30d0\u30a4\u30b9\u306e\u4f4d\u7f6e\u3092\u53d6\u5f97\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u624b\u52d5\u3067NVME-SSD\u3068GPU\u306e\u4f4d\u7f6e\u95a2\u4fc2\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u4f8b\u3048\u3070 nvme1 \u306b\u306f gpu2 \u3092\u3001 nvme2 \u3068 nvme3 \u306b\u306f gpu1 \u3092\u5272\u308a\u5f53\u3066\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092 postgresql.conf \u3078\u8a18\u8ff0\u3057\u307e\u3059\u3002\u3053\u306e\u624b\u52d5\u8a2d\u5b9a\u306f\u3001\u81ea\u52d5\u8a2d\u5b9a\u3088\u308a\u3082\u512a\u5148\u3059\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 pg_strom.nvme_distance_map = 'nvme1=gpu2,nvme2=gpu1,nvme3=gpu1' \u30ed\u30fc\u30ab\u30eb\u306eNVME-SSD\u30c7\u30d0\u30a4\u30b9\u4ee5\u5916\u3001\u4f8b\u3048\u3070100Gb\u30a4\u30fc\u30b5\u30cd\u30c3\u30c8\u3067\u63a5\u7d9a\u3055\u308c\u305f\u30b9\u30c8\u30ec\u30fc\u30b8\u30b5\u30fc\u30d0\u304b\u3089GPU-Direct SQL\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u306a\u3069\u3001PCI-E\u30d0\u30b9\u4e0a\u306e\u8ddd\u96e2\u306e\u6982\u5ff5\u304c\u5f53\u3066\u306f\u307e\u3089\u306a\u3044\u5834\u5408\u306f\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u304c\u30de\u30a6\u30f3\u30c8\u3055\u308c\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u3001\u305d\u3053\u306b\u95a2\u9023\u4ed8\u3051\u308bGPU\u3092\u6307\u5b9a\u3059\u308b\u4e8b\u3082\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306f\u8a2d\u5b9a\u4f8b\u3067\u3059\u3002 pg_strom.nvme_distance_map = '/mnt/0=gpu0,/mnt/1=gpu1' GUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308b\u5236\u5fa1 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306b\u95a2\u9023\u3059\u308bGUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306f2\u3064\u3042\u308a\u307e\u3059\u3002 \u4e00\u3064\u306f pg_strom.gpudirect_enabled \u3067\u3001GPU\u30c0\u30a4\u30ec\u30af\u30c8\u6a5f\u80fd\u306e\u6709\u52b9/\u7121\u52b9\u3092\u5358\u7d14\u306bon/off\u3057\u307e\u3059\u3002 \u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u304c off \u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b5\u30a4\u30ba\u3084\u7269\u7406\u914d\u7f6e\u3068\u306f\u7121\u95a2\u4fc2\u306bGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u4f7f\u7528\u3055\u308c\u307e\u305b\u3093\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f on \u3067\u3059\u3002 \u3082\u3046\u4e00\u3064\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f pg_strom.gpudirect_threshold \u3067\u3001GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u304c\u4f7f\u308f\u308c\u308b\u3079\u304d\u6700\u5c0f\u306e\u30c6\u30fc\u30d6\u30eb\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u306e\u7269\u7406\u914d\u7f6e\u304cNVME-SSD\u533a\u753b\uff08\u307e\u305f\u306f\u3001NVME-SSD\u306e\u307f\u3067\u69cb\u6210\u3055\u308c\u305fmd-raid0\u533a\u753b\uff09\u4e0a\u306b\u5b58\u5728\u3057\u3001\u304b\u3064\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b5\u30a4\u30ba\u304c\u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u6307\u5b9a\u5024\u3088\u308a\u3082\u5927\u304d\u306a\u5834\u5408\u3001PG-Strom\u306fGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3092\u9078\u629e\u3057\u307e\u3059\u3002 \u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f 2GB \u3067\u3059\u3002\u3064\u307e\u308a\u3001\u660e\u3089\u304b\u306b\u5c0f\u3055\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u306fGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3067\u306f\u306a\u304f\u3001PostgreSQL\u306e\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3059\u4e8b\u3092\u512a\u5148\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u3001\u4e00\u56de\u306e\u8aad\u307f\u51fa\u3057\u3067\u3042\u308c\u3070GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306b\u512a\u4f4d\u6027\u304c\u3042\u3063\u305f\u3068\u3057\u3066\u3082\u3001\u30aa\u30f3\u30e1\u30e2\u30ea\u51e6\u7406\u304c\u3067\u304d\u308b\u7a0b\u5ea6\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u306f\u3001\u4e8c\u56de\u76ee\u4ee5\u964d\u306e\u30c7\u30a3\u30b9\u30af\u30ad\u30e3\u30c3\u30b7\u30e5\u5229\u7528\u3092\u8003\u616e\u3059\u308b\u3068\u3001\u5fc5\u305a\u3057\u3082\u512a\u4f4d\u3068\u306f\u8a00\u3048\u306a\u3044\u3068\u3044\u3046\u4eee\u5b9a\u306b\u7acb\u3063\u3066\u3044\u308b\u3068\u3044\u3046\u4e8b\u3067\u3059\u3002 \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u7279\u6027\u306b\u3088\u3063\u3066\u306f\u5fc5\u305a\u3057\u3082\u3053\u306e\u8a2d\u5b9a\u304c\u6b63\u3057\u3044\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306e\u5229\u7528\u3092\u78ba\u8a8d\u3059\u308b EXPLAIN \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u5f53\u8a72\u30af\u30a8\u30ea\u3067GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u304c\u5229\u7528\u3055\u308c\u308b\u306e\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u306e\u4f8b\u3067\u306f\u3001 Custom Scan (GpuJoin) \u306b\u3088\u308b lineorder \u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b\u30b9\u30ad\u30e3\u30f3\u306b NVMe-Strom: enabled \u3068\u306e\u8868\u793a\u304c\u51fa\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001 lineorder \u30c6\u30fc\u30d6\u30eb\u304b\u3089\u306e\u8aad\u51fa\u3057\u306b\u306fGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u304c\u5229\u7528\u3055\u308c\u307e\u3059\u3002 # explain (costs off) select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_category = 'MFGR#12' and s_region = 'AMERICA' group by d_year, p_brand1 order by d_year, p_brand1; QUERY PLAN ---------------------------------------------------------------------------------------------- GroupAggregate Group Key: date1.d_year, part.p_brand1 -> Sort Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuPreAgg) Reduction: Local GPU Projection: pgstrom.psum((lo_revenue)::double precision), d_year, p_brand1 Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on lineorder GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue Outer Scan: lineorder Depth 1: GpuHashJoin (nrows 2406009600...97764190) HashKeys: lineorder.lo_partkey JoinQuals: (lineorder.lo_partkey = part.p_partkey) KDS-Hash (size: 10.67MB) Depth 2: GpuHashJoin (nrows 97764190...18544060) HashKeys: lineorder.lo_suppkey JoinQuals: (lineorder.lo_suppkey = supplier.s_suppkey) KDS-Hash (size: 131.59MB) Depth 3: GpuHashJoin (nrows 18544060...18544060) HashKeys: lineorder.lo_orderdate JoinQuals: (lineorder.lo_orderdate = date1.d_datekey) KDS-Hash (size: 461.89KB) NVMe-Strom: enabled -> Custom Scan (GpuScan) on part GPU Projection: p_brand1, p_partkey GPU Filter: (p_category = 'MFGR#12'::bpchar) -> Custom Scan (GpuScan) on supplier GPU Projection: s_suppkey GPU Filter: (s_region = 'AMERICA'::bpchar) -> Seq Scan on date1 (31 rows) Visibility Map\u306b\u95a2\u3059\u308b\u6ce8\u610f\u4e8b\u9805 \u73fe\u5728\u306e\u3068\u3053\u308d\u3001PG-Strom\u306eGPU\u5074\u51e6\u7406\u3067\u306f\u884c\u5358\u4f4d\u306eMVCC\u53ef\u8996\u6027\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001\u53ef\u8996\u6027\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u305f\u3081\u306b\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u69cb\u9020\u304c\u30db\u30b9\u30c8\u5074\u3060\u3051\u306b\u5b58\u5728\u3059\u308b\u305f\u3081\u3067\u3059\u304c\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u4e0a\u306e\u30d6\u30ed\u30c3\u30af\u3092\u76f4\u63a5GPU\u306b\u8ee2\u9001\u3059\u308b\u5834\u5408\u3001\u5c11\u3005\u5384\u4ecb\u306a\u554f\u984c\u304c\u751f\u3058\u307e\u3059\u3002 NVMe-SSD\u306bP2P DMA\u3092\u8981\u6c42\u3059\u308b\u6642\u70b9\u3067\u306f\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u30d6\u30ed\u30c3\u30af\u306e\u5185\u5bb9\u306f\u307e\u3060CPU/RAM\u3078\u3068\u8aad\u307f\u51fa\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u5177\u4f53\u7684\u306b\u3069\u306e\u884c\u304c\u53ef\u8996\u3067\u3042\u308b\u306e\u304b\u3001\u3069\u306e\u884c\u304c\u4e0d\u53ef\u8996\u3067\u3042\u308b\u306e\u304b\u3092\u5224\u5225\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001PostgreSQL\u304c\u30ec\u30b3\u30fc\u30c9\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u3078\u66f8\u304d\u51fa\u3059\u969b\u306bMVCC\u95a2\u9023\u306e\u5c5e\u6027\u3068\u5171\u306b\u66f8\u304d\u8fbc\u3093\u3067\u3044\u308b\u305f\u3081\u3067\u3001\u4f3c\u305f\u3088\u3046\u306a\u554f\u984c\u304cIndexOnlyScan\u3092\u5b9f\u88c5\u3059\u308b\u969b\u306b\u8868\u9762\u5316\u3057\u307e\u3057\u305f\u3002 \u3053\u308c\u306b\u5bfe\u51e6\u3059\u308b\u305f\u3081\u3001PostgreSQL\u306fVisibility Map\u3068\u547c\u3070\u308c\u308b\u30a4\u30f3\u30d5\u30e9\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u3042\u308b\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u4e2d\u306b\u5b58\u5728\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u304c\u5168\u3066\u306e\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u304b\u3089\u53ef\u8996\u3067\u3042\u308b\u4e8b\u304c\u660e\u3089\u304b\u3067\u3042\u308c\u3070\u3001\u8a72\u5f53\u3059\u308b\u30d3\u30c3\u30c8\u3092\u7acb\u3066\u308b\u4e8b\u3067\u3001\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092\u8aad\u3080\u3053\u3068\u306a\u304f\u5f53\u8a72\u30d6\u30ed\u30c3\u30af\u306bMVCC\u4e0d\u53ef\u8996\u306a\u30ec\u30b3\u30fc\u30c9\u304c\u5b58\u5728\u3059\u308b\u304b\u5426\u304b\u3092\u5224\u5b9a\u3059\u308b\u4e8b\u3092\u53ef\u80fd\u3068\u3059\u308b\u3082\u306e\u3067\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u3053\u306e\u30a4\u30f3\u30d5\u30e9\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u3001Visibility Map\u304c\u30bb\u30c3\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\"all-visible\"\u3067\u3042\u308b\u30d6\u30ed\u30c3\u30af\u3060\u3051\u304cP2P DMA\u3067\u8aad\u307f\u51fa\u3059\u3088\u3046\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u9001\u51fa\u3055\u308c\u307e\u3059\u3002 Visibility Map\u306fVACUUM\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u4f5c\u6210\u3055\u308c\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u660e\u793a\u7684\u306bVACUUM\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u3067\u5f37\u5236\u7684\u306bVisibility Map\u3092\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 VACUUM ANALYZE linerorder;","title":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL"},{"location":"ssd2gpu/#gpusql","text":"","title":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c"},{"location":"ssd2gpu/#_1","text":"SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u9ad8\u901f\u306b\u51e6\u7406\u3059\u308b\u306b\u306f\u3001\u30d7\u30ed\u30bb\u30c3\u30b5\u304c\u52b9\u7387\u3088\u304f\u51e6\u7406\u3092\u884c\u3046\u306e\u3068\u540c\u69d8\u306b\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3084\u30e1\u30e2\u30ea\u304b\u3089\u30d7\u30ed\u30bb\u30c3\u30b5\u3078\u9ad8\u901f\u306b\u30c7\u30fc\u30bf\u3092\u4f9b\u7d66\u3059\u308b\u4e8b\u304c\u91cd\u8981\u3067\u3059\u3002\u51e6\u7406\u3059\u3079\u304d\u30c7\u30fc\u30bf\u304c\u30d7\u30ed\u30bb\u30c3\u30b5\u306b\u5c4a\u3044\u3066\u3044\u306a\u3051\u308c\u3070\u3001\u30d7\u30ed\u30bb\u30c3\u30b5\u306f\u624b\u6301\u3061\u7121\u6c99\u6c70\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u6a5f\u80fd\u306f\u3001PCIe\u30d0\u30b9\u306b\u76f4\u7d50\u3059\u308b\u4e8b\u3067\u9ad8\u901f\u306aI/O\u51e6\u7406\u3092\u5b9f\u73fe\u3059\u308bNVMe-SSD\u3068\u3001\u540c\u3058PCIe\u30d0\u30b9\u4e0a\u306b\u63a5\u7d9a\u3055\u308c\u305fGPU\u3092\u30c0\u30a4\u30ec\u30af\u30c8\u306b\u63a5\u7d9a\u3057\u3001\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u9650\u754c\u306b\u8fd1\u3044\u901f\u5ea6\u3067\u30c7\u30fc\u30bf\u3092\u30d7\u30ed\u30bb\u30c3\u30b5\u306b\u4f9b\u7d66\u3059\u308b\u4e8b\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u9ad8\u901f\u306b\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002 \u901a\u5e38\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u4e0a\u306b\u683c\u7d0d\u3055\u308c\u305fPostgreSQL\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u306f\u3001PCIe\u30d0\u30b9\u3092\u901a\u3057\u3066\u3044\u3063\u305f\u3093CPU/RAM\u3078\u3068\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002\u305d\u306e\u5f8c\u3001\u30af\u30a8\u30ea\u5b9f\u884c\u8a08\u753b\u306b\u3057\u305f\u304c\u3063\u3066WHERE\u53e5\u306b\u3088\u308b\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3084JOIN/GROUP BY\u3068\u3044\u3063\u305f\u51e6\u7406\u3092\u884c\u3046\u308f\u3051\u3067\u3059\u304c\u3001\u96c6\u8a08\u7cfb\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u7279\u6027\u4e0a\u3001\u5165\u529b\u3059\u308b\u30c7\u30fc\u30bf\u4ef6\u6570\u3088\u308a\u51fa\u529b\u3059\u308b\u30c7\u30fc\u30bf\u4ef6\u6570\u306e\u65b9\u304c\u306f\u308b\u304b\u306b\u5c11\u306a\u3044\u4ef6\u6570\u3068\u306a\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u6570\u5341\u5104\u884c\u3092\u8aad\u307f\u51fa\u3057\u305f\u7d50\u679c\u3092GROUP BY\u3067\u96c6\u7d04\u3057\u305f\u7d50\u679c\u304c\u9ad8\u3005\u6570\u767e\u884c\u3068\u3044\u3046\u4e8b\u3082\u73cd\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002 \u8a00\u3044\u63db\u3048\u308c\u3070\u3001\u6211\u3005\u306f\u30b4\u30df\u30c7\u30fc\u30bf\u3092\u904b\u3076\u305f\u3081\u306bPCIe\u30d0\u30b9\u4e0a\u306e\u5e2f\u57df\u3092\u6d88\u8cbb\u3057\u3066\u3044\u308b\u3068\u3082\u8a00\u3048\u307e\u3059\u304c\u3001CPU\u304c\u30ec\u30b3\u30fc\u30c9\u306e\u4e2d\u8eab\u3092\u8abf\u3079\u308b\u307e\u3067\u306f\u3001\u305d\u306e\u8981\u4e0d\u8981\u3092\u5224\u65ad\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u4e00\u822c\u7684\u306a\u5b9f\u88c5\u3067\u306f\u3053\u308c\u306f\u4e0d\u53ef\u907f\u3068\u8a00\u3048\u307e\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u30c7\u30fc\u30bf\u306e\u6d41\u308c\u3092\u5909\u3048\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u4e0a\u306e\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092PCIe\u30d0\u30b9\u4e0a\u306eP2P DMA\u3092\u7528\u3044\u3066GPU\u306b\u76f4\u63a5\u8ee2\u9001\u3057\u3001GPU\u3067SQL\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u51e6\u7406\u3059\u308b\u4e8b\u3067CPU\u304c\u51e6\u7406\u3059\u3079\u304d\u30ec\u30b3\u30fc\u30c9\u6570\u3092\u6e1b\u3089\u3059\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002\u3044\u308f\u3070\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3068CPU/RAM\u306e\u9593\u306b\u4f4d\u7f6e\u3057\u3066SQL\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u30d7\u30ea\u30d7\u30ed\u30bb\u30c3\u30b5\u3068\u3057\u3066GPU\u3092\u6d3b\u7528\u3057\u3001\u7d50\u679c\u3068\u3057\u3066I/O\u51e6\u7406\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u3059\u3002 \u672c\u6a5f\u80fd\u306f\u3001\u5185\u90e8\u7684\u306bNVIDIA GPUDirect Storage\u30e2\u30b8\u30e5\u30fc\u30eb\uff08 nvidia-fs \uff09\u3092\u4f7f\u7528\u3057\u3066\u3001GPU\u30c7\u30d0\u30a4\u30b9\u30e1\u30e2\u30ea\u3068NVME\u30b9\u30c8\u30ec\u30fc\u30b8\u3068\u306e\u9593\u3067P2P\u306e\u30c7\u30fc\u30bf\u8ee2\u9001\u3092\u884c\u3044\u307e\u3059\u3002 \u3057\u305f\u304c\u3063\u3066\u3001\u672c\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u3001PostgreSQL\u306e\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3042\u308bPG-Strom\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u4e0a\u8a18\u306eLinux kernel\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002 \u307e\u305f\u3001\u672c\u6a5f\u80fd\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u306e\u306fNVME\u4ed5\u69d8\u306eSSD\u3084\u3001NVME-oF\u3067\u63a5\u7d9a\u3055\u308c\u305f\u30ea\u30e2\u30fc\u30c8\u30c7\u30d0\u30a4\u30b9\u306e\u307f\u3067\u3059\u3002 SAS\u3084SATA\u3068\u3044\u3063\u305f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3067\u63a5\u7d9a\u3055\u308c\u305f\u65e7\u5f0f\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002 \u4eca\u307e\u3067\u306b\u52d5\u4f5c\u5b9f\u7e3e\u306e\u3042\u308bNVME-SSD\u306b\u3064\u3044\u3066\u306f 002: HW Validation List \u304c\u53c2\u8003\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002","title":"\u6982\u8981"},{"location":"ssd2gpu/#_2","text":"","title":"\u521d\u671f\u8a2d\u5b9a"},{"location":"ssd2gpu/#_3","text":"\u4ee5\u524d\u306ePG-Strom\u3067\u306f\u3001GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u306e\u5229\u7528\u306b\u306fHeteroDB\u793e\u306e\u958b\u767a\u3057\u305f\u72ec\u81ea\u306eLinux kernel\u30c9\u30e9\u30a4\u30d0\u304c\u5fc5\u8981\u3067\u3057\u305f\u304c\u3001v3.0\u4ee5\u964d\u3067\u306fNVIDIA\u306e\u63d0\u4f9b\u3059\u308bGPUDirect Storage\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u8a2d\u8a08\u3092\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002GPUDirect Storage\u7528\u306eLinux kernel\u30c9\u30e9\u30a4\u30d0\uff08 nvidia-fs \uff09\u306fCUDA Toolkit\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d7\u30ed\u30bb\u30b9\u306b\u7d71\u5408\u3055\u308c\u3001\u672c\u30de\u30cb\u30e5\u30a2\u30eb\u306e\u300c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d\u306e\u7ae0\u306b\u8a18\u8f09\u306e\u624b\u9806\u3067\u30b7\u30b9\u30c6\u30e0\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u305f\u5834\u5408\u3001\u7279\u306b\u8ffd\u52a0\u306e\u8a2d\u5b9a\u306f\u5fc5\u8981\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u5fc5\u8981\u306aLinux kernel\u30c9\u30e9\u30a4\u30d0\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3001 modinfo \u30b3\u30de\u30f3\u30c9\u3084 lsmod \u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u3066\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 $ modinfo nvidia-fs filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/nvidia-fs.ko.xz description: NVIDIA GPUDirect Storage license: GPL v2 version: 2.20.5 rhelversion: 9.4 srcversion: 096A726CAEC0A059E24049E depends: retpoline: Y name: nvidia_fs vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions sig_id: PKCS#7 signer: DKMS module signing key sig_key: 18:B4:AE:27:B8:7D:74:4F:C2:27:68:2A:EB:E0:6A:F0:84:B2:94:EE sig_hashalgo: sha512 : : $ lsmod | grep nvidia nvidia_fs 323584 32 nvidia_uvm 6877184 4 nvidia 8822784 43 nvidia_uvm,nvidia_fs drm 741376 2 drm_kms_helper,nvidia","title":"\u30c9\u30e9\u30a4\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"ssd2gpu/#_4","text":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u4ee5\u4e0b\u306e\u6761\u4ef6\u3067\u767a\u52d5\u3057\u307e\u3059\u3002 \u30b9\u30ad\u30e3\u30f3\u5bfe\u8c61\u306e\u30c6\u30fc\u30d6\u30eb\u304cNVMe-SSD\u3067\u69cb\u6210\u3055\u308c\u305f\u533a\u753b\u306b\u914d\u7f6e\u3055\u308c\u3066\u3044\u308b\u3002 /dev/nvmeXXXX \u30d6\u30ed\u30c3\u30af\u30c7\u30d0\u30a4\u30b9\u3001\u307e\u305f\u306f /dev/nvmeXXXX \u30d6\u30ed\u30c3\u30af\u30c7\u30d0\u30a4\u30b9\u306e\u307f\u304b\u3089\u69cb\u6210\u3055\u308c\u305fmd-raid0\u533a\u753b\u304c\u5bfe\u8c61\u3067\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u30b5\u30a4\u30ba\u304c pg_strom.gpudirect_threshold \u3088\u308a\u3082\u5927\u304d\u3044\u4e8b\u3002 \u3053\u306e\u8a2d\u5b9a\u5024\u306f\u4efb\u610f\u306b\u5909\u66f4\u53ef\u80fd\u3067\u3059\u304c\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f\u672c\u4f53\u642d\u8f09\u7269\u7406\u30e1\u30e2\u30ea\u306b shared_buffers \u306e\u8a2d\u5b9a\u5024\u306e1/3\u3092\u52a0\u3048\u305f\u5927\u304d\u3055\u3067\u3059\u3002 Note md-raid0\u3092\u7528\u3044\u3066\u8907\u6570\u306eNVMe-SSD\u533a\u753b\u304b\u3089\u30b9\u30c8\u30e9\u30a4\u30d4\u30f3\u30b0\u8aad\u51fa\u3057\u3092\u884c\u3046\u306b\u306f\u3001HeteroDB\u793e\u306e\u63d0\u4f9b\u3059\u308b\u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30ba\u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3\u306e\u9069\u7528\u304c\u5fc5\u8981\u3067\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u3092NVMe-SSD\u3067\u69cb\u6210\u3055\u308c\u305f\u533a\u753b\u306b\u914d\u7f6e\u3059\u308b\u306b\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u5168\u4f53\u3092NVMe-SSD\u30dc\u30ea\u30e5\u30fc\u30e0\u306b\u683c\u7d0d\u3059\u308b\u4ee5\u5916\u306b\u3082\u3001PostgreSQL\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u6a5f\u80fd\u3092\u7528\u3044\u3066\u7279\u5b9a\u306e\u30c6\u30fc\u30d6\u30eb\u3084\u7279\u5b9a\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u307f\u3092NVMe-SSD\u30dc\u30ea\u30e5\u30fc\u30e0\u306b\u914d\u7f6e\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4f8b\u3048\u3070 /opt/nvme \u306bNVMe-SSD\u30dc\u30ea\u30e5\u30fc\u30e0\u304c\u30de\u30a6\u30f3\u30c8\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 PostgreSQL\u306e\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u306e\u6a29\u9650\u3067\u5f53\u8a72\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u66f8\u304d\u3067\u304d\u308b\u3088\u3046\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 CREATE TABLESPACE my_nvme LOCATION '/opt/nvme'; \u3053\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u4e0a\u306b\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001 CREATE TABLE \u69cb\u6587\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002 CREATE TABLE my_table (...) TABLESPACE my_nvme; \u3042\u308b\u3044\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u3092\u5909\u66f4\u3059\u308b\u306b\u306f\u3001 ALTER DATABASE \u69cb\u6587\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u306e\u5834\u5408\u3001\u65e2\u5b58\u30c6\u30fc\u30d6\u30eb\u306e\u914d\u7f6e\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306f\u5909\u66f4\u3055\u308c\u306a\u3044\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 ALTER DATABASE my_database SET TABLESPACE my_nvme;","title":"\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u306e\u8a2d\u8a08"},{"location":"ssd2gpu/#_5","text":"","title":"\u904b\u7528"},{"location":"ssd2gpu/#gpunvme-ssd","text":"\u30b5\u30fc\u30d0\u306e\u9078\u5b9a\u3068GPU\u304a\u3088\u3073NVME-SSD\u306e\u642d\u8f09\u306b\u3042\u305f\u308a\u3001\u30c7\u30d0\u30a4\u30b9\u306e\u6301\u3064\u6027\u80fd\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059\u306b\u306f\u3001\u30c7\u30d0\u30a4\u30b9\u9593\u306e\u8ddd\u96e2\u3092\u610f\u8b58\u3057\u305f\u30b3\u30f3\u30d5\u30a3\u30b0\u304c\u5fc5\u8981\u3067\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u6a5f\u80fd\u304c\u305d\u306e\u57fa\u76e4\u3068\u3057\u3066\u4f7f\u7528\u3057\u3066\u3044\u308b NVIDIA GPUDirect RDMA \u306f\u3001P2P DMA\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u4e92\u3044\u306e\u30c7\u30d0\u30a4\u30b9\u304c\u540c\u3058PCIe root complex\u306e\u914d\u4e0b\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u8981\u6c42\u3057\u3066\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u30c7\u30e5\u30a2\u30ebCPU\u30b7\u30b9\u30c6\u30e0\u3067NVME-SSD\u304cCPU1\u306b\u3001GPU\u304cCPU2\u306b\u63a5\u7d9a\u3055\u308c\u3066\u304a\u308a\u3001P2P DMA\u304cCPU\u9593\u306eQPI\u3092\u6a2a\u5207\u308b\u3088\u3046\u69cb\u6210\u3059\u308b\u4e8b\u306f\u3067\u304d\u307e\u305b\u3093\u3002 \u307e\u305f\u3001\u6027\u80fd\u306e\u89b3\u70b9\u304b\u3089\u306fCPU\u5185\u8535\u306ePCIe\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3088\u308a\u3082\u3001\u5c02\u7528\u306ePCIe\u30b9\u30a4\u30c3\u30c1\u3092\u4ecb\u3057\u3066\u4e92\u3044\u306e\u30c7\u30d0\u30a4\u30b9\u3092\u63a5\u7d9a\u3059\u308b\u65b9\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u5199\u771f\u306fHPC\u5411\u3051\u30b5\u30fc\u30d0\u306e\u30de\u30b6\u30fc\u30dc\u30fc\u30c9\u3067\u30018\u672c\u306ePCIe x16\u30b9\u30ed\u30c3\u30c8\u304cPCIe\u30b9\u30a4\u30c3\u30c1\u3092\u4ecb\u3057\u3066\u4e92\u3044\u306b\u5bfe\u3068\u306a\u308b\u30b9\u30ed\u30c3\u30c8\u3068\u63a5\u7d9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u5199\u771f\u306e\u5de6\u5074\u306e\u30b9\u30ed\u30c3\u30c8\u306fCPU1\u306b\u3001\u53f3\u5074\u306e\u30b9\u30ed\u30c3\u30c8\u306fCPU2\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001SSD-2\u4e0a\u306b\u69cb\u7bc9\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3092\u7528\u3044\u3066\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u5834\u5408\u3001\u6700\u9069\u306aGPU\u306e\u9078\u629e\u306fGPU-2\u3067\u3057\u3087\u3046\u3002\u307e\u305fGPU-1\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001GPUDirect RDMA\u306e\u5236\u7d04\u304b\u3089\u3001GPU-3\u3068GPU-4\u306e\u4f7f\u7528\u306f\u907f\u3051\u306d\u3070\u306a\u308a\u307e\u305b\u3093\u3002 PG-Strom\u306f\u8d77\u52d5\u6642\u306b\u30b7\u30b9\u30c6\u30e0\u306ePCIe\u30d0\u30b9\u30c8\u30dd\u30ed\u30b8\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3001GPU\u3068NVME-SSD\u9593\u306e\u8ad6\u7406\u7684\u306a\u8ddd\u96e2\u3092\u7b97\u51fa\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8d77\u52d5\u6642\u306e\u30ed\u30b0\u306b\u8a18\u9332\u3055\u308c\u3066\u304a\u308a\u3001\u4f8b\u3048\u3070 /dev/nvme2 \u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u6642\u306fGPU1\u3068\u3044\u3063\u305f\u5177\u5408\u306b\u3001\u5404NVME-SSD\u3054\u3068\u306b\u6700\u3082\u8ddd\u96e2\u306e\u8fd1\u3044GPU\u3092\u512a\u5148\u3057\u3066\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 $ pg_ctl restart : LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78> LOG: [0000:81:00:0] nvme0 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] LOG: [0000:82:00:0] nvme2 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c2:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c6:00:0] nvme5 (Corsair MP600 CORE) --> GPU0 [dist=9] LOG: [0000:c3:00:0] nvme4 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c1:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c4:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] \u901a\u5e38\u306f\u81ea\u52d5\u8a2d\u5b9a\u3067\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002 \u305f\u3060\u3001NVME-over-Fabric(RDMA)\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306fPCIe\u30d0\u30b9\u4e0a\u306envme\u30c7\u30d0\u30a4\u30b9\u306e\u4f4d\u7f6e\u3092\u53d6\u5f97\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u624b\u52d5\u3067NVME-SSD\u3068GPU\u306e\u4f4d\u7f6e\u95a2\u4fc2\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u4f8b\u3048\u3070 nvme1 \u306b\u306f gpu2 \u3092\u3001 nvme2 \u3068 nvme3 \u306b\u306f gpu1 \u3092\u5272\u308a\u5f53\u3066\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092 postgresql.conf \u3078\u8a18\u8ff0\u3057\u307e\u3059\u3002\u3053\u306e\u624b\u52d5\u8a2d\u5b9a\u306f\u3001\u81ea\u52d5\u8a2d\u5b9a\u3088\u308a\u3082\u512a\u5148\u3059\u308b\u4e8b\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 pg_strom.nvme_distance_map = 'nvme1=gpu2,nvme2=gpu1,nvme3=gpu1' \u30ed\u30fc\u30ab\u30eb\u306eNVME-SSD\u30c7\u30d0\u30a4\u30b9\u4ee5\u5916\u3001\u4f8b\u3048\u3070100Gb\u30a4\u30fc\u30b5\u30cd\u30c3\u30c8\u3067\u63a5\u7d9a\u3055\u308c\u305f\u30b9\u30c8\u30ec\u30fc\u30b8\u30b5\u30fc\u30d0\u304b\u3089GPU-Direct SQL\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u306a\u3069\u3001PCI-E\u30d0\u30b9\u4e0a\u306e\u8ddd\u96e2\u306e\u6982\u5ff5\u304c\u5f53\u3066\u306f\u307e\u3089\u306a\u3044\u5834\u5408\u306f\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u304c\u30de\u30a6\u30f3\u30c8\u3055\u308c\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u3001\u305d\u3053\u306b\u95a2\u9023\u4ed8\u3051\u308bGPU\u3092\u6307\u5b9a\u3059\u308b\u4e8b\u3082\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306f\u8a2d\u5b9a\u4f8b\u3067\u3059\u3002 pg_strom.nvme_distance_map = '/mnt/0=gpu0,/mnt/1=gpu1'","title":"GPU\u3068NVME-SSD\u9593\u306e\u8ddd\u96e2"},{"location":"ssd2gpu/#guc","text":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306b\u95a2\u9023\u3059\u308bGUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306f2\u3064\u3042\u308a\u307e\u3059\u3002 \u4e00\u3064\u306f pg_strom.gpudirect_enabled \u3067\u3001GPU\u30c0\u30a4\u30ec\u30af\u30c8\u6a5f\u80fd\u306e\u6709\u52b9/\u7121\u52b9\u3092\u5358\u7d14\u306bon/off\u3057\u307e\u3059\u3002 \u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u304c off \u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b5\u30a4\u30ba\u3084\u7269\u7406\u914d\u7f6e\u3068\u306f\u7121\u95a2\u4fc2\u306bGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u4f7f\u7528\u3055\u308c\u307e\u305b\u3093\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f on \u3067\u3059\u3002 \u3082\u3046\u4e00\u3064\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f pg_strom.gpudirect_threshold \u3067\u3001GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u304c\u4f7f\u308f\u308c\u308b\u3079\u304d\u6700\u5c0f\u306e\u30c6\u30fc\u30d6\u30eb\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u30c6\u30fc\u30d6\u30eb\u306e\u7269\u7406\u914d\u7f6e\u304cNVME-SSD\u533a\u753b\uff08\u307e\u305f\u306f\u3001NVME-SSD\u306e\u307f\u3067\u69cb\u6210\u3055\u308c\u305fmd-raid0\u533a\u753b\uff09\u4e0a\u306b\u5b58\u5728\u3057\u3001\u304b\u3064\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30b5\u30a4\u30ba\u304c\u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u6307\u5b9a\u5024\u3088\u308a\u3082\u5927\u304d\u306a\u5834\u5408\u3001PG-Strom\u306fGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u3092\u9078\u629e\u3057\u307e\u3059\u3002 \u672c\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f 2GB \u3067\u3059\u3002\u3064\u307e\u308a\u3001\u660e\u3089\u304b\u306b\u5c0f\u3055\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u306fGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u3067\u306f\u306a\u304f\u3001PostgreSQL\u306e\u30d0\u30c3\u30d5\u30a1\u304b\u3089\u8aad\u307f\u51fa\u3059\u4e8b\u3092\u512a\u5148\u3057\u307e\u3059\u3002 \u3053\u308c\u306f\u3001\u4e00\u56de\u306e\u8aad\u307f\u51fa\u3057\u3067\u3042\u308c\u3070GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306b\u512a\u4f4d\u6027\u304c\u3042\u3063\u305f\u3068\u3057\u3066\u3082\u3001\u30aa\u30f3\u30e1\u30e2\u30ea\u51e6\u7406\u304c\u3067\u304d\u308b\u7a0b\u5ea6\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u306f\u3001\u4e8c\u56de\u76ee\u4ee5\u964d\u306e\u30c7\u30a3\u30b9\u30af\u30ad\u30e3\u30c3\u30b7\u30e5\u5229\u7528\u3092\u8003\u616e\u3059\u308b\u3068\u3001\u5fc5\u305a\u3057\u3082\u512a\u4f4d\u3068\u306f\u8a00\u3048\u306a\u3044\u3068\u3044\u3046\u4eee\u5b9a\u306b\u7acb\u3063\u3066\u3044\u308b\u3068\u3044\u3046\u4e8b\u3067\u3059\u3002 \u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u7279\u6027\u306b\u3088\u3063\u3066\u306f\u5fc5\u305a\u3057\u3082\u3053\u306e\u8a2d\u5b9a\u304c\u6b63\u3057\u3044\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002","title":"GUC\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u308b\u5236\u5fa1"},{"location":"ssd2gpu/#gpusql_1","text":"EXPLAIN \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u5f53\u8a72\u30af\u30a8\u30ea\u3067GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u304c\u5229\u7528\u3055\u308c\u308b\u306e\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u306e\u4f8b\u3067\u306f\u3001 Custom Scan (GpuJoin) \u306b\u3088\u308b lineorder \u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3059\u308b\u30b9\u30ad\u30e3\u30f3\u306b NVMe-Strom: enabled \u3068\u306e\u8868\u793a\u304c\u51fa\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001 lineorder \u30c6\u30fc\u30d6\u30eb\u304b\u3089\u306e\u8aad\u51fa\u3057\u306b\u306fGPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u304c\u5229\u7528\u3055\u308c\u307e\u3059\u3002 # explain (costs off) select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_category = 'MFGR#12' and s_region = 'AMERICA' group by d_year, p_brand1 order by d_year, p_brand1; QUERY PLAN ---------------------------------------------------------------------------------------------- GroupAggregate Group Key: date1.d_year, part.p_brand1 -> Sort Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuPreAgg) Reduction: Local GPU Projection: pgstrom.psum((lo_revenue)::double precision), d_year, p_brand1 Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on lineorder GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue Outer Scan: lineorder Depth 1: GpuHashJoin (nrows 2406009600...97764190) HashKeys: lineorder.lo_partkey JoinQuals: (lineorder.lo_partkey = part.p_partkey) KDS-Hash (size: 10.67MB) Depth 2: GpuHashJoin (nrows 97764190...18544060) HashKeys: lineorder.lo_suppkey JoinQuals: (lineorder.lo_suppkey = supplier.s_suppkey) KDS-Hash (size: 131.59MB) Depth 3: GpuHashJoin (nrows 18544060...18544060) HashKeys: lineorder.lo_orderdate JoinQuals: (lineorder.lo_orderdate = date1.d_datekey) KDS-Hash (size: 461.89KB) NVMe-Strom: enabled -> Custom Scan (GpuScan) on part GPU Projection: p_brand1, p_partkey GPU Filter: (p_category = 'MFGR#12'::bpchar) -> Custom Scan (GpuScan) on supplier GPU Projection: s_suppkey GPU Filter: (s_region = 'AMERICA'::bpchar) -> Seq Scan on date1 (31 rows)","title":"GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306e\u5229\u7528\u3092\u78ba\u8a8d\u3059\u308b"},{"location":"ssd2gpu/#visibility-map","text":"\u73fe\u5728\u306e\u3068\u3053\u308d\u3001PG-Strom\u306eGPU\u5074\u51e6\u7406\u3067\u306f\u884c\u5358\u4f4d\u306eMVCC\u53ef\u8996\u6027\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001\u53ef\u8996\u6027\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u305f\u3081\u306b\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u69cb\u9020\u304c\u30db\u30b9\u30c8\u5074\u3060\u3051\u306b\u5b58\u5728\u3059\u308b\u305f\u3081\u3067\u3059\u304c\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u4e0a\u306e\u30d6\u30ed\u30c3\u30af\u3092\u76f4\u63a5GPU\u306b\u8ee2\u9001\u3059\u308b\u5834\u5408\u3001\u5c11\u3005\u5384\u4ecb\u306a\u554f\u984c\u304c\u751f\u3058\u307e\u3059\u3002 NVMe-SSD\u306bP2P DMA\u3092\u8981\u6c42\u3059\u308b\u6642\u70b9\u3067\u306f\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u30d6\u30ed\u30c3\u30af\u306e\u5185\u5bb9\u306f\u307e\u3060CPU/RAM\u3078\u3068\u8aad\u307f\u51fa\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u5177\u4f53\u7684\u306b\u3069\u306e\u884c\u304c\u53ef\u8996\u3067\u3042\u308b\u306e\u304b\u3001\u3069\u306e\u884c\u304c\u4e0d\u53ef\u8996\u3067\u3042\u308b\u306e\u304b\u3092\u5224\u5225\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001PostgreSQL\u304c\u30ec\u30b3\u30fc\u30c9\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u3078\u66f8\u304d\u51fa\u3059\u969b\u306bMVCC\u95a2\u9023\u306e\u5c5e\u6027\u3068\u5171\u306b\u66f8\u304d\u8fbc\u3093\u3067\u3044\u308b\u305f\u3081\u3067\u3001\u4f3c\u305f\u3088\u3046\u306a\u554f\u984c\u304cIndexOnlyScan\u3092\u5b9f\u88c5\u3059\u308b\u969b\u306b\u8868\u9762\u5316\u3057\u307e\u3057\u305f\u3002 \u3053\u308c\u306b\u5bfe\u51e6\u3059\u308b\u305f\u3081\u3001PostgreSQL\u306fVisibility Map\u3068\u547c\u3070\u308c\u308b\u30a4\u30f3\u30d5\u30e9\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u3042\u308b\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u4e2d\u306b\u5b58\u5728\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u304c\u5168\u3066\u306e\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u304b\u3089\u53ef\u8996\u3067\u3042\u308b\u4e8b\u304c\u660e\u3089\u304b\u3067\u3042\u308c\u3070\u3001\u8a72\u5f53\u3059\u308b\u30d3\u30c3\u30c8\u3092\u7acb\u3066\u308b\u4e8b\u3067\u3001\u30c7\u30fc\u30bf\u30d6\u30ed\u30c3\u30af\u3092\u8aad\u3080\u3053\u3068\u306a\u304f\u5f53\u8a72\u30d6\u30ed\u30c3\u30af\u306bMVCC\u4e0d\u53ef\u8996\u306a\u30ec\u30b3\u30fc\u30c9\u304c\u5b58\u5728\u3059\u308b\u304b\u5426\u304b\u3092\u5224\u5b9a\u3059\u308b\u4e8b\u3092\u53ef\u80fd\u3068\u3059\u308b\u3082\u306e\u3067\u3059\u3002 GPU\u30c0\u30a4\u30ec\u30af\u30c8SQL\u5b9f\u884c\u306f\u3053\u306e\u30a4\u30f3\u30d5\u30e9\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u3001Visibility Map\u304c\u30bb\u30c3\u30c8\u3055\u308c\u3066\u304a\u308a\u3001\"all-visible\"\u3067\u3042\u308b\u30d6\u30ed\u30c3\u30af\u3060\u3051\u304cP2P DMA\u3067\u8aad\u307f\u51fa\u3059\u3088\u3046\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u9001\u51fa\u3055\u308c\u307e\u3059\u3002 Visibility Map\u306fVACUUM\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u4f5c\u6210\u3055\u308c\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u660e\u793a\u7684\u306bVACUUM\u3092\u5b9f\u884c\u3059\u308b\u4e8b\u3067\u5f37\u5236\u7684\u306bVisibility Map\u3092\u69cb\u7bc9\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 VACUUM ANALYZE linerorder;","title":"Visibility Map\u306b\u95a2\u3059\u308b\u6ce8\u610f\u4e8b\u9805"},{"location":"troubles/","text":"\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0 \u554f\u984c\u306e\u5207\u308a\u5206\u3051 \u7279\u5b9a\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u305f\u969b\u306b\u4f55\u304c\u3057\u304b\u306e\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u305d\u308c\u304c\u4f55\u306b\u8d77\u56e0\u3059\u308b\u3082\u306e\u3067\u3042\u308b\u306e\u304b\u3092\u7279\u5b9a\u3059\u308b\u306e\u306f\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u7b2c\u4e00\u6b69\u3067\u3059\u3002 \u6b8b\u5ff5\u306a\u304c\u3089\u3001PostgreSQL\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3068\u6bd4\u3079PG-Strom\u306e\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306f\u975e\u5e38\u306b\u5c11\u306a\u3044\u6570\u306e\u958b\u767a\u8005\u306b\u3088\u3063\u3066\u652f\u3048\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u54c1\u8cea\u3084\u5b9f\u7e3e\u3068\u3044\u3063\u305f\u89b3\u70b9\u304b\u3089\u3001\u307e\u305aPG-Strom\u304c\u60aa\u3055\u3092\u3057\u3066\u3044\u306a\u3044\u304b\u7591\u3046\u306e\u306f\u59a5\u5f53\u306a\u5224\u65ad\u3067\u3059\u3002 PG-Strom\u306e\u5168\u6a5f\u80fd\u3092\u4e00\u5ea6\u306b\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u306b\u306f pg_strom.enabled \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u4e8b\u3067PG-Strom\u306f\u7121\u52b9\u5316\u3055\u308c\u3001\u6a19\u6e96\u306ePostgreSQL\u3068\u5168\u304f\u540c\u4e00\u306e\u72b6\u614b\u3068\u306a\u308a\u307e\u3059\u3002 \u305d\u308c\u3067\u3082\u306a\u304a\u554f\u984c\u304c\u518d\u73fe\u3059\u308b\u304b\u3069\u3046\u304b\u306f\u4e00\u3064\u306e\u5224\u65ad\u6750\u6599\u3068\u306a\u308b\u3067\u3057\u3087\u3046\u3002 # SET pg_strom.enabled = off; \u3053\u306e\u4ed6\u306b\u3082\u3001GpuScan\u3001GpuJoin\u3001GpuPreAgg\u3068\u3044\u3063\u305f\u7279\u5b9a\u306e\u5b9f\u884c\u8a08\u753b\u306e\u307f\u3092\u7121\u52b9\u5316\u3059\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u8a73\u7d30\u306f \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9/GPU\u30d1\u30e9\u30e1\u30fc\u30bf \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u63a1\u53d6 \u30b7\u30b9\u30c6\u30e0\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3059\u3088\u3046\u306a\u91cd\u5927\u306a\u30c8\u30e9\u30d6\u30eb\u306e\u89e3\u6790\u306b\u306f\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u63a1\u53d6\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002 \u672c\u7bc0\u3067\u306f\u3001PostgreSQL\u3068PG-Strom\u30d7\u30ed\u30bb\u30b9\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(CPU\u5074)\u3001\u304a\u3088\u3073PG-Strom\u306eGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(GPU\u5074)\u3092\u53d6\u5f97\u3057\u3001\u969c\u5bb3\u767a\u751f\u6642\u306e\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u63a1\u53d6\u3059\u308b\u305f\u3081\u306e\u624b\u6bb5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002 PostgreSQL\u8d77\u52d5\u6642\u8a2d\u5b9a\u306e\u8ffd\u52a0 \u30d7\u30ed\u30bb\u30b9\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u6642\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(CPU\u5074)\u3092\u751f\u6210\u3059\u308b\u306b\u306f\u3001PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u304c\u751f\u6210\u3059\u308b\u4e8b\u306e\u3067\u304d\u308b core \u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u3092\u7121\u5236\u9650\u306b\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306fPostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u3092\u8d77\u52d5\u3059\u308b\u30b7\u30a7\u30eb\u4e0a\u3067 ulimit -c \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u5909\u66f4\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30a8\u30e9\u30fc\u6642\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(GPU\u5074)\u3092\u751f\u6210\u3059\u308b\u306b\u306f\u3001PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u304c\u74b0\u5883\u5909\u6570 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u306b 1 \u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 systemd\u304b\u3089PostgreSQL\u3092\u8d77\u52d5\u3059\u308b\u5834\u5408\u3001 /etc/systemd/system/postgresql-.service.d/ \u4ee5\u4e0b\u306b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u3053\u308c\u3089\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 RPM\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u5185\u5bb9\u306e pg_strom.conf \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002 [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1 CUDA9.1\u306b\u304a\u3044\u3066\u306f\u3001\u901a\u5e38\u3001GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u751f\u6210\u306b\u306f\u6570\u5206\u4ee5\u4e0a\u306e\u6642\u9593\u3092\u8981\u3057\u3001\u305d\u306e\u9593\u3001\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3057\u305fPostgreSQL\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u5fdc\u7b54\u306f\u5b8c\u5168\u306b\u505c\u6b62\u3057\u3066\u3057\u307e\u3057\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001\u306f\u7279\u5b9a\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u306b\u304a\u3044\u3066\u767a\u751f\u3059\u308bGPU\u30ab\u30fc\u30cd\u30eb\u306b\u8d77\u56e0\u3059\u308b\u30a8\u30e9\u30fc\u306e\u539f\u56e0\u8abf\u67fb\u3092\u884c\u3046\u5834\u5408\u306b\u3060\u3051\u3001 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u74b0\u5883\u5909\u6570\u3092\u8a2d\u5b9a\u3059\u308b\u4e8b\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002 RPM\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u304a\u3051\u308b\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u306f\u3001 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u74b0\u5883\u5909\u6570\u306e\u884c\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u3044\u307e\u3059\u3002 PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u3092\u518d\u8d77\u52d5\u3059\u308b\u3068\u3001 Max core file size \u304cunlimited\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 # cat /proc//limits Limit Soft Limit Hard Limit Units : : : : Max core file size unlimited unlimited bytes : : : : debuginfo\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u304b\u3089\u610f\u5473\u306e\u3042\u308b\u60c5\u5831\u3092\u8aad\u307f\u53d6\u308b\u306b\u306f\u30b7\u30f3\u30dc\u30eb\u60c5\u5831\u304c\u5fc5\u8981\u3067\u3059\u3002 \u3053\u308c\u3089\u306f -debuginfo \u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u683c\u7d0d\u3055\u308c\u3066\u304a\u308a\u3001\u30b7\u30b9\u30c6\u30e0\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308bPostgreSQL\u304a\u3088\u3073PG-Strom\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u5fdc\u3058\u3066\u305d\u308c\u305e\u308c\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002 # yum install postgresql10-debuginfo pg_strom-PG10-debuginfo : ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: pg_strom-PG10-debuginfo x86_64 1.9-180301.el7 heterodb-debuginfo 766 k postgresql10-debuginfo x86_64 10.3-1PGDG.rhel7 pgdg10 9.7 M Transaction Summary ================================================================================ Install 2 Packages : Installed: pg_strom-PG10-debuginfo.x86_64 0:1.9-180301.el7 postgresql10-debuginfo.x86_64 0:10.3-1PGDG.rhel7 Complete! CPU\u5074\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u306e\u78ba\u8a8d \u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u4f5c\u6210\u3055\u308c\u308b\u30d1\u30b9\u306f\u3001\u30ab\u30fc\u30cd\u30eb\u30d1\u30e9\u30e1\u30fc\u30bf kernel.core_pattern \u304a\u3088\u3073 kernel.core_uses_pid \u306e\u5024\u306b\u3088\u3063\u3066\u6c7a\u307e\u308a\u307e\u3059\u3002 \u901a\u5e38\u306f\u30d7\u30ed\u30bb\u30b9\u306e\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u4f5c\u6210\u3055\u308c\u307e\u3059\u306e\u3067\u3001systemd\u304b\u3089PostgreSQL\u3092\u8d77\u52d5\u3057\u305f\u5834\u5408\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u304c\u69cb\u7bc9\u3055\u308c\u308b /var/lib/pgdata \u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 core. \u30d5\u30a1\u30a4\u30eb\u304c\u751f\u6210\u3055\u308c\u3066\u3044\u308b\u306e\u3092\u78ba\u8a8d\u3057\u305f\u3089\u3001 gdb \u3092\u7528\u3044\u3066\u30af\u30e9\u30c3\u30b7\u30e5\u306b\u81f3\u308b\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002 gdb \u306e -c \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30b3\u30a2\u30d5\u30a1\u30a4\u30eb\u3092\u3001 -f \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 # gdb -c /var/lib/pgdata/core.134680 -f /usr/pgsql-10/bin/postgres GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7_4.1 : (gdb) bt #0 0x00007fb942af3903 in __epoll_wait_nocancel () from /lib64/libc.so.6 #1 0x00000000006f71ae in WaitEventSetWaitBlock (nevents=1, occurred_events=0x7ffee51e1d70, cur_timeout=-1, set=0x2833298) at latch.c:1048 #2 WaitEventSetWait (set=0x2833298, timeout=timeout@entry-1, occurred_events=occurred_events@entry0x7ffee51e1d70, nevents=nevents@entry1, wait_event_info=wait_event_info@entry100663296) at latch.c:1000 #3 0x00000000006210fb in secure_read (port=0x2876120, ptr=0xcaa7e0 , len=8192) at be-secure.c:166 #4 0x000000000062b6e8 in pq_recvbuf () at pqcomm.c:963 #5 0x000000000062c345 in pq_getbyte () at pqcomm.c:1006 #6 0x0000000000718682 in SocketBackend (inBuf=0x7ffee51e1ef0) at postgres.c:328 #7 ReadCommand (inBuf=0x7ffee51e1ef0) at postgres.c:501 #8 PostgresMain (argc=, argv=argv@entry0x287bb68, dbname=0x28333f8 \"postgres\", username=) at postgres.c:4030 #9 0x000000000047adbc in BackendRun (port=0x2876120) at postmaster.c:4405 #10 BackendStartup (port=0x2876120) at postmaster.c:4077 #11 ServerLoop () at postmaster.c:1755 #12 0x00000000006afb7f in PostmasterMain (argc=argc@entry3, argv=argv@entry0x2831280) at postmaster.c:1363 #13 0x000000000047bbef in main (argc=3, argv=0x2831280) at main.c:228 gdb\u306e bt \u30b3\u30de\u30f3\u30c9\u3067\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002 \u3053\u306e\u30b1\u30fc\u30b9\u3067\u306f\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u306e\u30af\u30a8\u30ea\u3092\u5f85\u3063\u3066\u3044\u308b\u72b6\u614b\u306ePostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306b SIGSEGV \u30b7\u30b0\u30ca\u30eb\u3092\u9001\u51fa\u3057\u3066\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3057\u305f\u305f\u3081\u3001 WaitEventSetWait \u5ef6\u9577\u4e0a\u306e __epoll_wait_nocancel \u3067\u30d7\u30ed\u30bb\u30b9\u304c\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u3066\u3044\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002 GPU\u5074\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u306e\u78ba\u8a8d GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306f\u3001\uff08 CUDA_COREDUMP_FILE \u74b0\u5883\u5909\u6570\u3092\u7528\u3044\u3066\u660e\u793a\u7684\u306b\u6307\u5b9a\u3057\u306a\u3051\u308c\u3070\uff09PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u306e\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u751f\u6210\u3055\u308c\u307e\u3059\u3002 systemd\u304b\u3089PostgreSQL\u3092\u8d77\u52d5\u3057\u305f\u5834\u5408\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u304c\u69cb\u7bc9\u3055\u308c\u308b /var/lib/pgdata \u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ee5\u4e0b\u306e\u540d\u524d\u3067GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u304c\u751f\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002 core___.nvcudmp \u306a\u304a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u3067\u306fGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306b\u306f\u30b7\u30f3\u30dc\u30eb\u60c5\u5831\u306a\u3069\u306e\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u3053\u306e\u72b6\u614b\u3067\u306f\u969c\u5bb3\u89e3\u6790\u3092\u884c\u3046\u4e8b\u306f\u307b\u3068\u3093\u3069\u4e0d\u53ef\u80fd\u3067\u3059\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066PG-Strom\u304c\u751f\u6210\u3059\u308bGPU\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u3092\u542b\u3081\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u305f\u3060\u3057\u3001\u3053\u306e\u8a2d\u5b9a\u306f\u5b9f\u884c\u6642\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u4f4e\u4e0b\u3055\u305b\u308b\u305f\u3081\u3001\u6052\u5e38\u7684\u306a\u4f7f\u7528\u306f\u975e\u63a8\u5968\u3067\u3059\u3002 \u30c8\u30e9\u30d6\u30eb\u89e3\u6790\u6642\u306b\u3060\u3051\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 nvme=# set pg_strom.debug_jit_compile_options = on; SET \u751f\u6210\u3055\u308c\u305fGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f cuda-gdb \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 # /usr/local/cuda/bin/cuda-gdb NVIDIA (R) CUDA Debugger 9.1 release Portions Copyright (C) 2007-2017 NVIDIA Corporation : For help, type \"help\". Type \"apropos word\" to search for commands related to \"word\". (cuda-gdb) \u5f15\u6570\u306a\u3057\u3067 cuda-gdb \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001\u30d7\u30ed\u30f3\u30d7\u30c8\u4e0a\u3067 target \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u5148\u307b\u3069\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002 (cuda-gdb) target cudacore /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp Opening GPU coredump: /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp [New Thread 216240] CUDA Exception: Warp Illegal Address The exception was triggered at PC 0x7ff4dc82f930 (cuda_gpujoin.h:1159) [Current focus set to CUDA kernel 0, grid 1, block (0,0,0), thread (0,0,0), device 0, sm 0, warp 0, lane 0] #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 1159 while (khitem && khitem->hash != hash_value) \u3053\u306e\u72b6\u614b\u3067 bt \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3001\u554f\u984c\u767a\u751f\u500b\u6240\u3078\u306e\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u63a1\u53d6\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 (cuda-gdb) bt #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 #1 0x00007ff4dc9428f0 in gpujoin_main<<<(30,1,1),(256,1,1)>>> (kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, kds_dst=0x7fe9e8800030, kparams_gpreagg=0x0) at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1347 \u3088\u308a\u8a73\u7d30\u306a cuda-gdb \u30b3\u30de\u30f3\u30c9\u306e\u5229\u7528\u6cd5\u306f CUDA Toolkit Documentation - CUDA-GDB \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0"},{"location":"troubles/#_1","text":"","title":"\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0"},{"location":"troubles/#_2","text":"\u7279\u5b9a\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u305f\u969b\u306b\u4f55\u304c\u3057\u304b\u306e\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u305d\u308c\u304c\u4f55\u306b\u8d77\u56e0\u3059\u308b\u3082\u306e\u3067\u3042\u308b\u306e\u304b\u3092\u7279\u5b9a\u3059\u308b\u306e\u306f\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u7b2c\u4e00\u6b69\u3067\u3059\u3002 \u6b8b\u5ff5\u306a\u304c\u3089\u3001PostgreSQL\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3068\u6bd4\u3079PG-Strom\u306e\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306f\u975e\u5e38\u306b\u5c11\u306a\u3044\u6570\u306e\u958b\u767a\u8005\u306b\u3088\u3063\u3066\u652f\u3048\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u54c1\u8cea\u3084\u5b9f\u7e3e\u3068\u3044\u3063\u305f\u89b3\u70b9\u304b\u3089\u3001\u307e\u305aPG-Strom\u304c\u60aa\u3055\u3092\u3057\u3066\u3044\u306a\u3044\u304b\u7591\u3046\u306e\u306f\u59a5\u5f53\u306a\u5224\u65ad\u3067\u3059\u3002 PG-Strom\u306e\u5168\u6a5f\u80fd\u3092\u4e00\u5ea6\u306b\u6709\u52b9\u5316/\u7121\u52b9\u5316\u3059\u308b\u306b\u306f pg_strom.enabled \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u4e8b\u3067PG-Strom\u306f\u7121\u52b9\u5316\u3055\u308c\u3001\u6a19\u6e96\u306ePostgreSQL\u3068\u5168\u304f\u540c\u4e00\u306e\u72b6\u614b\u3068\u306a\u308a\u307e\u3059\u3002 \u305d\u308c\u3067\u3082\u306a\u304a\u554f\u984c\u304c\u518d\u73fe\u3059\u308b\u304b\u3069\u3046\u304b\u306f\u4e00\u3064\u306e\u5224\u65ad\u6750\u6599\u3068\u306a\u308b\u3067\u3057\u3087\u3046\u3002 # SET pg_strom.enabled = off; \u3053\u306e\u4ed6\u306b\u3082\u3001GpuScan\u3001GpuJoin\u3001GpuPreAgg\u3068\u3044\u3063\u305f\u7279\u5b9a\u306e\u5b9f\u884c\u8a08\u753b\u306e\u307f\u3092\u7121\u52b9\u5316\u3059\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u8a73\u7d30\u306f \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9/GPU\u30d1\u30e9\u30e1\u30fc\u30bf \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"\u554f\u984c\u306e\u5207\u308a\u5206\u3051"},{"location":"troubles/#_3","text":"\u30b7\u30b9\u30c6\u30e0\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3059\u3088\u3046\u306a\u91cd\u5927\u306a\u30c8\u30e9\u30d6\u30eb\u306e\u89e3\u6790\u306b\u306f\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u63a1\u53d6\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002 \u672c\u7bc0\u3067\u306f\u3001PostgreSQL\u3068PG-Strom\u30d7\u30ed\u30bb\u30b9\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(CPU\u5074)\u3001\u304a\u3088\u3073PG-Strom\u306eGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(GPU\u5074)\u3092\u53d6\u5f97\u3057\u3001\u969c\u5bb3\u767a\u751f\u6642\u306e\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u63a1\u53d6\u3059\u308b\u305f\u3081\u306e\u624b\u6bb5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002","title":"\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u63a1\u53d6"},{"location":"troubles/#postgresql","text":"\u30d7\u30ed\u30bb\u30b9\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u6642\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(CPU\u5074)\u3092\u751f\u6210\u3059\u308b\u306b\u306f\u3001PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u304c\u751f\u6210\u3059\u308b\u4e8b\u306e\u3067\u304d\u308b core \u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u3092\u7121\u5236\u9650\u306b\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306fPostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u3092\u8d77\u52d5\u3059\u308b\u30b7\u30a7\u30eb\u4e0a\u3067 ulimit -c \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u5909\u66f4\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30a8\u30e9\u30fc\u6642\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7(GPU\u5074)\u3092\u751f\u6210\u3059\u308b\u306b\u306f\u3001PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u304c\u74b0\u5883\u5909\u6570 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u306b 1 \u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 systemd\u304b\u3089PostgreSQL\u3092\u8d77\u52d5\u3059\u308b\u5834\u5408\u3001 /etc/systemd/system/postgresql-.service.d/ \u4ee5\u4e0b\u306b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u3053\u308c\u3089\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 RPM\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u5185\u5bb9\u306e pg_strom.conf \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002 [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1 CUDA9.1\u306b\u304a\u3044\u3066\u306f\u3001\u901a\u5e38\u3001GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u751f\u6210\u306b\u306f\u6570\u5206\u4ee5\u4e0a\u306e\u6642\u9593\u3092\u8981\u3057\u3001\u305d\u306e\u9593\u3001\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3057\u305fPostgreSQL\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u5fdc\u7b54\u306f\u5b8c\u5168\u306b\u505c\u6b62\u3057\u3066\u3057\u307e\u3057\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001\u306f\u7279\u5b9a\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u306b\u304a\u3044\u3066\u767a\u751f\u3059\u308bGPU\u30ab\u30fc\u30cd\u30eb\u306b\u8d77\u56e0\u3059\u308b\u30a8\u30e9\u30fc\u306e\u539f\u56e0\u8abf\u67fb\u3092\u884c\u3046\u5834\u5408\u306b\u3060\u3051\u3001 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u74b0\u5883\u5909\u6570\u3092\u8a2d\u5b9a\u3059\u308b\u4e8b\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002 RPM\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u304a\u3051\u308b\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u306f\u3001 CUDA_ENABLE_COREDUMP_ON_EXCEPTION \u74b0\u5883\u5909\u6570\u306e\u884c\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u3044\u307e\u3059\u3002 PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u3092\u518d\u8d77\u52d5\u3059\u308b\u3068\u3001 Max core file size \u304cunlimited\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 # cat /proc//limits Limit Soft Limit Hard Limit Units : : : : Max core file size unlimited unlimited bytes : : : :","title":"PostgreSQL\u8d77\u52d5\u6642\u8a2d\u5b9a\u306e\u8ffd\u52a0"},{"location":"troubles/#debuginfo","text":"\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u304b\u3089\u610f\u5473\u306e\u3042\u308b\u60c5\u5831\u3092\u8aad\u307f\u53d6\u308b\u306b\u306f\u30b7\u30f3\u30dc\u30eb\u60c5\u5831\u304c\u5fc5\u8981\u3067\u3059\u3002 \u3053\u308c\u3089\u306f -debuginfo \u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u683c\u7d0d\u3055\u308c\u3066\u304a\u308a\u3001\u30b7\u30b9\u30c6\u30e0\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308bPostgreSQL\u304a\u3088\u3073PG-Strom\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u5fdc\u3058\u3066\u305d\u308c\u305e\u308c\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002 # yum install postgresql10-debuginfo pg_strom-PG10-debuginfo : ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: pg_strom-PG10-debuginfo x86_64 1.9-180301.el7 heterodb-debuginfo 766 k postgresql10-debuginfo x86_64 10.3-1PGDG.rhel7 pgdg10 9.7 M Transaction Summary ================================================================================ Install 2 Packages : Installed: pg_strom-PG10-debuginfo.x86_64 0:1.9-180301.el7 postgresql10-debuginfo.x86_64 0:10.3-1PGDG.rhel7 Complete!","title":"debuginfo\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},{"location":"troubles/#cpu","text":"\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306e\u4f5c\u6210\u3055\u308c\u308b\u30d1\u30b9\u306f\u3001\u30ab\u30fc\u30cd\u30eb\u30d1\u30e9\u30e1\u30fc\u30bf kernel.core_pattern \u304a\u3088\u3073 kernel.core_uses_pid \u306e\u5024\u306b\u3088\u3063\u3066\u6c7a\u307e\u308a\u307e\u3059\u3002 \u901a\u5e38\u306f\u30d7\u30ed\u30bb\u30b9\u306e\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u4f5c\u6210\u3055\u308c\u307e\u3059\u306e\u3067\u3001systemd\u304b\u3089PostgreSQL\u3092\u8d77\u52d5\u3057\u305f\u5834\u5408\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u304c\u69cb\u7bc9\u3055\u308c\u308b /var/lib/pgdata \u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 core. \u30d5\u30a1\u30a4\u30eb\u304c\u751f\u6210\u3055\u308c\u3066\u3044\u308b\u306e\u3092\u78ba\u8a8d\u3057\u305f\u3089\u3001 gdb \u3092\u7528\u3044\u3066\u30af\u30e9\u30c3\u30b7\u30e5\u306b\u81f3\u308b\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002 gdb \u306e -c \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30b3\u30a2\u30d5\u30a1\u30a4\u30eb\u3092\u3001 -f \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 # gdb -c /var/lib/pgdata/core.134680 -f /usr/pgsql-10/bin/postgres GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7_4.1 : (gdb) bt #0 0x00007fb942af3903 in __epoll_wait_nocancel () from /lib64/libc.so.6 #1 0x00000000006f71ae in WaitEventSetWaitBlock (nevents=1, occurred_events=0x7ffee51e1d70, cur_timeout=-1, set=0x2833298) at latch.c:1048 #2 WaitEventSetWait (set=0x2833298, timeout=timeout@entry-1, occurred_events=occurred_events@entry0x7ffee51e1d70, nevents=nevents@entry1, wait_event_info=wait_event_info@entry100663296) at latch.c:1000 #3 0x00000000006210fb in secure_read (port=0x2876120, ptr=0xcaa7e0 , len=8192) at be-secure.c:166 #4 0x000000000062b6e8 in pq_recvbuf () at pqcomm.c:963 #5 0x000000000062c345 in pq_getbyte () at pqcomm.c:1006 #6 0x0000000000718682 in SocketBackend (inBuf=0x7ffee51e1ef0) at postgres.c:328 #7 ReadCommand (inBuf=0x7ffee51e1ef0) at postgres.c:501 #8 PostgresMain (argc=, argv=argv@entry0x287bb68, dbname=0x28333f8 \"postgres\", username=) at postgres.c:4030 #9 0x000000000047adbc in BackendRun (port=0x2876120) at postmaster.c:4405 #10 BackendStartup (port=0x2876120) at postmaster.c:4077 #11 ServerLoop () at postmaster.c:1755 #12 0x00000000006afb7f in PostmasterMain (argc=argc@entry3, argv=argv@entry0x2831280) at postmaster.c:1363 #13 0x000000000047bbef in main (argc=3, argv=0x2831280) at main.c:228 gdb\u306e bt \u30b3\u30de\u30f3\u30c9\u3067\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002 \u3053\u306e\u30b1\u30fc\u30b9\u3067\u306f\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u306e\u30af\u30a8\u30ea\u3092\u5f85\u3063\u3066\u3044\u308b\u72b6\u614b\u306ePostgreSQL\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306b SIGSEGV \u30b7\u30b0\u30ca\u30eb\u3092\u9001\u51fa\u3057\u3066\u30af\u30e9\u30c3\u30b7\u30e5\u3092\u5f15\u304d\u8d77\u3053\u3057\u305f\u305f\u3081\u3001 WaitEventSetWait \u5ef6\u9577\u4e0a\u306e __epoll_wait_nocancel \u3067\u30d7\u30ed\u30bb\u30b9\u304c\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u3066\u3044\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002","title":"CPU\u5074\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u306e\u78ba\u8a8d"},{"location":"troubles/#gpu","text":"GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306f\u3001\uff08 CUDA_COREDUMP_FILE \u74b0\u5883\u5909\u6570\u3092\u7528\u3044\u3066\u660e\u793a\u7684\u306b\u6307\u5b9a\u3057\u306a\u3051\u308c\u3070\uff09PostgreSQL\u30b5\u30fc\u30d0\u30d7\u30ed\u30bb\u30b9\u306e\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u751f\u6210\u3055\u308c\u307e\u3059\u3002 systemd\u304b\u3089PostgreSQL\u3092\u8d77\u52d5\u3057\u305f\u5834\u5408\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\u304c\u69cb\u7bc9\u3055\u308c\u308b /var/lib/pgdata \u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ee5\u4e0b\u306e\u540d\u524d\u3067GPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u304c\u751f\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002 core___.nvcudmp \u306a\u304a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u3067\u306fGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u306b\u306f\u30b7\u30f3\u30dc\u30eb\u60c5\u5831\u306a\u3069\u306e\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u3053\u306e\u72b6\u614b\u3067\u306f\u969c\u5bb3\u89e3\u6790\u3092\u884c\u3046\u4e8b\u306f\u307b\u3068\u3093\u3069\u4e0d\u53ef\u80fd\u3067\u3059\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066PG-Strom\u304c\u751f\u6210\u3059\u308bGPU\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u3092\u542b\u3081\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u305f\u3060\u3057\u3001\u3053\u306e\u8a2d\u5b9a\u306f\u5b9f\u884c\u6642\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u4f4e\u4e0b\u3055\u305b\u308b\u305f\u3081\u3001\u6052\u5e38\u7684\u306a\u4f7f\u7528\u306f\u975e\u63a8\u5968\u3067\u3059\u3002 \u30c8\u30e9\u30d6\u30eb\u89e3\u6790\u6642\u306b\u3060\u3051\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 nvme=# set pg_strom.debug_jit_compile_options = on; SET \u751f\u6210\u3055\u308c\u305fGPU\u30ab\u30fc\u30cd\u30eb\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f cuda-gdb \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 # /usr/local/cuda/bin/cuda-gdb NVIDIA (R) CUDA Debugger 9.1 release Portions Copyright (C) 2007-2017 NVIDIA Corporation : For help, type \"help\". Type \"apropos word\" to search for commands related to \"word\". (cuda-gdb) \u5f15\u6570\u306a\u3057\u3067 cuda-gdb \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001\u30d7\u30ed\u30f3\u30d7\u30c8\u4e0a\u3067 target \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u5148\u307b\u3069\u306e\u30af\u30e9\u30c3\u30b7\u30e5\u30c0\u30f3\u30d7\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002 (cuda-gdb) target cudacore /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp Opening GPU coredump: /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp [New Thread 216240] CUDA Exception: Warp Illegal Address The exception was triggered at PC 0x7ff4dc82f930 (cuda_gpujoin.h:1159) [Current focus set to CUDA kernel 0, grid 1, block (0,0,0), thread (0,0,0), device 0, sm 0, warp 0, lane 0] #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 1159 while (khitem && khitem->hash != hash_value) \u3053\u306e\u72b6\u614b\u3067 bt \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3001\u554f\u984c\u767a\u751f\u500b\u6240\u3078\u306e\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u63a1\u53d6\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002 (cuda-gdb) bt #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 #1 0x00007ff4dc9428f0 in gpujoin_main<<<(30,1,1),(256,1,1)>>> (kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, kds_dst=0x7fe9e8800030, kparams_gpreagg=0x0) at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1347 \u3088\u308a\u8a73\u7d30\u306a cuda-gdb \u30b3\u30de\u30f3\u30c9\u306e\u5229\u7528\u6cd5\u306f CUDA Toolkit Documentation - CUDA-GDB \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002","title":"GPU\u5074\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u306e\u78ba\u8a8d"}]} \ No newline at end of file diff --git a/docs/search/search_index.json b/docs/search/search_index.json index 83ab2217..2fe48b24 100644 --- a/docs/search/search_index.json +++ b/docs/search/search_index.json @@ -1 +1 @@ -{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Home This chapter introduces the overview of PG-Strom, and developer's community. What is PG-Strom? PG-Strom is an extension module of PostgreSQL designed for version 15 or later. By utilization of GPU (Graphic Processor Unit) device which has thousands cores per chip, it enables to accelerate SQL workloads for data analytics or batch processing to big data set. Its core features are GPU code generator that automatically generates GPU program according to the SQL commands and asynchronous parallel execution engine to run SQL workloads on GPU device. The latest version supports SCAN (evaluation of WHERE-clause), JOIN and GROUP BY workloads. In the case when GPU-processing has advantage, PG-Strom replaces the vanilla implementation of PostgreSQL and transparentlly works from users and applications. PG-Strom has two storage options. The first one is the heap storage system of PostgreSQL. It is not always optimal for aggregation / analysis workloads because of its row data format, on the other hands, it has an advantage to run aggregation workloads without data transfer from the transactional database. The other one is Apache Arrow files, that have structured columnar format. Even though it is not suitable for update per row basis, it enables to import large amount of data efficiently, and efficiently search / aggregate the data through foreign data wrapper (FDW). One of the characteristic feature of PG-Strom is GPUDirect SQL that bypasses the CPU/RAM to read the data from NVME / NVME-oF to the GPU directly. SQL processing on the GPU maximizes the bandwidth of these devices. PG-Strom v3.0 newly supports NVIDIA GPUDirect Storage, it allows to support SDS (Software Defined Storage) over the NVME-oF protocol and shared filesystems. The v3.0 newly supports execution of some PostGIS function and GiST index search on the GPU side. Along with the GPU cache, that duplicates the table contents often updated very frequently, it enables search / analysis processing based on the real-time locational information. The v5.0 entirely revised the software architecture design, like update of the process model (multi-process to multi-thread), or switch from the CUDA C++ native code to the portable pseudo code. It improves overall performance and stability. License and Copyright PG-Strom is an open source software distributed under the PostgreSQL License. See LICENSE for the license details. Community Please post your questions, requests and trouble reports to the Discussion of GitHub\u306e . Please pay attention it is a public board for world wide. So, it is your own responsibility not to disclose confidential information. The primary language of the discussion board is English. On the other hands, we know major portion of PG-Strom users are Japanese because of its development history, so we admit to have a discussion on the list in Japanese language. In this case, please don't forget to attach (JP) prefix on the subject like, for non-Japanese speakers to skip messages. Bug or troubles report If you got troubles like incorrect results, system crash / lockup, or something strange behavior, please open a new issue at the PG-Strom Issue Tracker . Please ensure the items below on bug reports. Whether you can reproduce the same problem on the latest revision? Hopefully, we recommend to test on the latest OS, CUDA, PostgreSQL and related software. Whether you can reproduce the same problem if PG-Strom is disabled? GUC option pg_strom.enabled can turn on/off PG-Strom. Is there any known issues on the issue tracker of GitHub? Please don't forget to search closed issues The information below are helpful for bug-reports. Steps to reproduce the problem (Data and Query) Output of EXPLAIN VERBOSE for the queries in trouble. Data structure of the tables involved with \\d+
on psql command. Log messages (verbose messages are more helpful) Status of GUC options you modified from the default configurations. Hardware configuration - GPU model and host RAM size especially. If you are not certain whether the strange behavior on your site is bug or not, please report it to the discussion board prior to the open a new issue ticket. Developers may be able to suggest you next action - like a request for extra information. New features proposition If you have any ideas of new features, please open a new issue with feature tag at the PG-Strom Issue Tracker , then have a discussion with other developers. A preferable design proposal will contain the items below. What is your problem to solve / improve? How much serious is it on your workloads / user case? Way to implement your idea? Expected downside, if any. Once we could make a consensus about its necessity, coordinator will attach accepted tag and the issue ticket is used to track rest of the development. Elsewhere, the issue ticket got rejected tag and closed. Once a proposal got rejected, we may have different decision in the future. If comprehensive circumstance would be changed, you don't need to hesitate revised proposition again. On the development stage, please attach patch file on the issue ticket. We don't use pull request. Support Policy The PG-Strom development team will support the latest release which are distributed from the HeteroDB Software Distribution Center only. So, people who met troubles needs to ensure the problems can be reproduced with the latest release. Please note that it is volunteer based community support policy, so our support is best effort and no SLA definition. If you need commercial support, contact to HeteroDB,Inc (contact@heterodbcom).","title":"Home"},{"location":"#home","text":"This chapter introduces the overview of PG-Strom, and developer's community.","title":"Home"},{"location":"#what-is-pg-strom","text":"PG-Strom is an extension module of PostgreSQL designed for version 15 or later. By utilization of GPU (Graphic Processor Unit) device which has thousands cores per chip, it enables to accelerate SQL workloads for data analytics or batch processing to big data set. Its core features are GPU code generator that automatically generates GPU program according to the SQL commands and asynchronous parallel execution engine to run SQL workloads on GPU device. The latest version supports SCAN (evaluation of WHERE-clause), JOIN and GROUP BY workloads. In the case when GPU-processing has advantage, PG-Strom replaces the vanilla implementation of PostgreSQL and transparentlly works from users and applications. PG-Strom has two storage options. The first one is the heap storage system of PostgreSQL. It is not always optimal for aggregation / analysis workloads because of its row data format, on the other hands, it has an advantage to run aggregation workloads without data transfer from the transactional database. The other one is Apache Arrow files, that have structured columnar format. Even though it is not suitable for update per row basis, it enables to import large amount of data efficiently, and efficiently search / aggregate the data through foreign data wrapper (FDW). One of the characteristic feature of PG-Strom is GPUDirect SQL that bypasses the CPU/RAM to read the data from NVME / NVME-oF to the GPU directly. SQL processing on the GPU maximizes the bandwidth of these devices. PG-Strom v3.0 newly supports NVIDIA GPUDirect Storage, it allows to support SDS (Software Defined Storage) over the NVME-oF protocol and shared filesystems. The v3.0 newly supports execution of some PostGIS function and GiST index search on the GPU side. Along with the GPU cache, that duplicates the table contents often updated very frequently, it enables search / analysis processing based on the real-time locational information. The v5.0 entirely revised the software architecture design, like update of the process model (multi-process to multi-thread), or switch from the CUDA C++ native code to the portable pseudo code. It improves overall performance and stability.","title":"What is PG-Strom?"},{"location":"#license-and-copyright","text":"PG-Strom is an open source software distributed under the PostgreSQL License. See LICENSE for the license details.","title":"License and Copyright"},{"location":"#community","text":"Please post your questions, requests and trouble reports to the Discussion of GitHub\u306e . Please pay attention it is a public board for world wide. So, it is your own responsibility not to disclose confidential information. The primary language of the discussion board is English. On the other hands, we know major portion of PG-Strom users are Japanese because of its development history, so we admit to have a discussion on the list in Japanese language. In this case, please don't forget to attach (JP) prefix on the subject like, for non-Japanese speakers to skip messages.","title":"Community"},{"location":"#bug-or-troubles-report","text":"If you got troubles like incorrect results, system crash / lockup, or something strange behavior, please open a new issue at the PG-Strom Issue Tracker . Please ensure the items below on bug reports. Whether you can reproduce the same problem on the latest revision? Hopefully, we recommend to test on the latest OS, CUDA, PostgreSQL and related software. Whether you can reproduce the same problem if PG-Strom is disabled? GUC option pg_strom.enabled can turn on/off PG-Strom. Is there any known issues on the issue tracker of GitHub? Please don't forget to search closed issues The information below are helpful for bug-reports. Steps to reproduce the problem (Data and Query) Output of EXPLAIN VERBOSE for the queries in trouble. Data structure of the tables involved with \\d+
on psql command. Log messages (verbose messages are more helpful) Status of GUC options you modified from the default configurations. Hardware configuration - GPU model and host RAM size especially. If you are not certain whether the strange behavior on your site is bug or not, please report it to the discussion board prior to the open a new issue ticket. Developers may be able to suggest you next action - like a request for extra information.","title":"Bug or troubles report"},{"location":"#new-features-proposition","text":"If you have any ideas of new features, please open a new issue with feature tag at the PG-Strom Issue Tracker , then have a discussion with other developers. A preferable design proposal will contain the items below. What is your problem to solve / improve? How much serious is it on your workloads / user case? Way to implement your idea? Expected downside, if any. Once we could make a consensus about its necessity, coordinator will attach accepted tag and the issue ticket is used to track rest of the development. Elsewhere, the issue ticket got rejected tag and closed. Once a proposal got rejected, we may have different decision in the future. If comprehensive circumstance would be changed, you don't need to hesitate revised proposition again. On the development stage, please attach patch file on the issue ticket. We don't use pull request.","title":"New features proposition"},{"location":"#support-policy","text":"The PG-Strom development team will support the latest release which are distributed from the HeteroDB Software Distribution Center only. So, people who met troubles needs to ensure the problems can be reproduced with the latest release. Please note that it is volunteer based community support policy, so our support is best effort and no SLA definition. If you need commercial support, contact to HeteroDB,Inc (contact@heterodbcom).","title":"Support Policy"},{"location":"arrow_fdw/","text":"Apache Arrow (Columnar Store) Overview PostgreSQL tables internally consist of 8KB blocks 1 , and block contains tuples which is a data structure of all the attributes and metadata per row. It collocates date of a row closely, so it works effectively for INSERT/UPDATE-major workloads, but not suitable for summarizing or analytics of mass-data. It is not usual to reference all the columns in a table on mass-data processing, and we tend to reference a part of columns in most cases. In this case, the storage I/O bandwidth consumed by unreferenced columns are waste, however, we have no easy way to fetch only particular columns referenced from the row-oriented data structure. In case of column oriented data structure, in an opposite manner, it has extreme disadvantage on INSERT/UPDATE-major workloads, however, it can pull out maximum performance of storage I/O on mass-data processing workloads because it can loads only referenced columns. From the standpoint of processor efficiency also, column-oriented data structure looks like a flat array that pulls out maximum bandwidth of memory subsystem for GPU, by special memory access pattern called Coalesced Memory Access. What is Apache Arrow? Apache Arrow is a data format of structured data to save in columnar-form and to exchange other applications. Some applications for big-data processing support the format, and it is easy for self-developed applications to use Apache Arrow format since they provides libraries for major programming languages like C,C++ or Python. Apache Arrow format file internally contains Schema portion to define data structure, and one or more RecordBatch to save columnar-data based on the schema definition. For data types, it supports integers, strint (variable-length), date/time types and so on. Indivisual columnar data has its internal representation according to the data types. Data representation in Apache Arrow is not identical with the representation in PostgreSQL. For example, epoch of timestamp in Arrow is 1970-01-01 and it supports multiple precision. In contrast, epoch of timestamp in PostgreSQL is 2001-01-01 and it has microseconds accuracy. Arrow_Fdw allows to read Apache Arrow files on PostgreSQL using foreign table mechanism. If an Arrow file contains 8 of record batches that has million items for each column data, for example, we can access 8 million rows on the Arrow files through the foreign table. Operations Creation of foreign tables Usually it takes the 3 steps below to create a foreign table. Define a foreign-data-wrapper using CREATE FOREIGN DATA WRAPPER command Define a foreign server using CREATE SERVER command Define a foreign table using CREATE FOREIGN TABLE command The first 2 steps above are included in the CREATE EXTENSION pg_strom command. All you need to run individually is CREATE FOREIGN TABLE command last. CREATE FOREIGN TABLE flogdata ( ts timestamp, sensor_id int, signal1 smallint, signal2 smallint, signal3 smallint, signal4 smallint, ) SERVER arrow_fdw OPTIONS (file '/path/to/logdata.arrow'); Data type of columns specified by the CREATE FOREIGN TABLE command must be matched to schema definition of the Arrow files to be mapped. Arrow_Fdw also supports a useful manner using IMPORT FOREIGN SCHEMA statement. It automatically generates a foreign table definition using schema definition of the Arrow files. It specifies the foreign table name, schema name to import, and path name of the Arrow files using OPTION-clause. Schema definition of Arrow files contains data types and optional column name for each column. It declares a new foreign table using these information. IMPORT FOREIGN SCHEMA flogdata FROM SERVER arrow_fdw INTO public OPTIONS (file '/path/to/logdata.arrow'); Foreign table options Arrow_Fdw supports the options below. Right now, all the options are for foreign tables. file=PATHNAME It maps an Arrow file specified on the foreign table. files=PATHNAME1[,PATHNAME2...] It maps multiple Arrow files specified by comma (,) separated files list on the foreign table. dir=DIRNAME It maps all the Arrow files in the directory specified on the foreign table. suffix=SUFFIX When dir option is given, it maps only files with the specified suffix, like .arrow` for example. parallel_workers=N_WORKERS It tells the number of workers that should be used to assist a parallel scan of this foreign table; equivalent to parallel_workers storage parameter at normal tables. writable=(true|false) It allows execution of INSERT command on the foreign table. See the section of \"Writable Arrow_Fdw\" Data type mapping Arrow data types are mapped on PostgreSQL data types as follows. Int mapped to either of int1 , int2 , int4 or int8 according to the bitWidth attribute. is_signed attribute shall be ignored. int1 is an enhanced data type by PG-Strom. FloatingPoint mapped to either of float2 , float4 or float8 according to the precision attribute. float2 is an enhanced data type by PG-Strom. Binary mapped to bytea data type Decimal mapped to numeric data type Date mapped to date data type; to be adjusted as if it has unit=Day precision. Time mapped to time data type; to be adjusted as if it has unit=MicroSecond precision. Timestamp mapped to timestamp data type; to be adjusted as if it has unit=MicroSecond precision. Interval mapped to interval data type. List mapped to 1-dimensional array of the element data type. Struct mapped to compatible composite data type; that shall be defined preliminary. FixedSizeBinary mapped to char(n) data type according to the byteWidth attribute. If pg_type=TYPENAME is configured, PG-Strom may assign the configured data type. Right now, inet and macaddr are supported. Union , Map , Duration , LargeBinary , LargeUtf8 , LargeList Right now, PG-Strom cannot map these Arrow data types onto any of PostgreSQL data types. How to read EXPLAIN EXPLAIN command show us information about Arrow files reading. The example below is an output of query execution plan that includes f_lineorder foreign table that mapps an Arrow file of 503GB. =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) -> Custom Scan (GpuPreAgg) on f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..78.95 rows=365 width=4) Filter: (d_year = 1993) (12 rows) According to the EXPLAIN output, we can see Custom Scan (GpuPreAgg) scans f_lineorder foreign table. file0 item shows the filename ( /opt/nvme/lineorder_s999.arrow ) on behalf of the foreign table and its size. If multiple files are mapped, any files are individually shown, like file1 , file2 , ... The referenced item shows the list of referenced columns. We can see this query touches lo_orderdate , lo_quantity , lo_extendedprice and lo_discount columns. In addition, GPU-Direct SQL: enabled (GPU-0) shows us the scan on f_lineorder uses GPU-Direct SQL mechanism. VERBOSE option outputs more detailed information. =# EXPLAIN VERBOSE SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) Output: pgstrom.sum_int((pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint))) -> Custom Scan (GpuPreAgg) on public.f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) Output: (pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint)) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) lo_orderdate: 22.35GB lo_quantity: 22.35GB lo_extendedprice: 22.35GB lo_discount: 22.35GB GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , , , KVecs-Buffer: nbytes: 51200, ndims: 3, items=[kvec0=<0x0000-27ff, type='int4', expr='lo_discount'>, kvec1=<0x2800-4fff, type='int4', expr='lo_quantity'>, kvec2=<0x5000-77ff, type='int4', expr='lo_extendedprice'>, kvec3=<0x7800-9fff, type='int4', expr='lo_orderdate'>, kvec4=<0xa000-c7ff, type='int4', expr='d_datekey'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, , , ]}, items[1]={LoadVars(depth=1): kvars=[]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, , ]}}, items[1]={MoveVars(depth=1): items=[, ]}}} Scan Quals OpCode: {Bool::AND args=[{Func(bool)::int4ge args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='1'}]}, {Func(bool)::int4le args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='3'}]}, {Func(bool)::int4lt args=[{Var(int4): slot=1, expr='lo_quantity'}, {Const(int4): value='25'}]}]} Join Quals OpCode: {Packed items[1]={JoinQuals: {Func(bool)::int4eq args=[{Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}, {Var(int4): slot=5, expr='d_datekey'}]}}} Join HashValue OpCode: {Packed items[1]={HashValue arg={Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}}} Partial Aggregation OpCode: {AggFuncs arg={SaveExpr: arg={Func(int8)::int8 arg={Func(int4)::int4mul args=[{Var(int4): kvec=0x5000-7800, expr='lo_extendedprice'}, {Var(int4): kvec=0x0000-2800, expr='lo_discount'}]}}}} Partial Function BufSz: 16 -> Seq Scan on public.date1 (cost=0.00..78.95 rows=365 width=4) Output: date1.d_datekey Filter: (date1.d_year = 1993) (28 rows) The verbose output additionally displays amount of column-data to be loaded on reference of columns. The load of lo_orderdate , lo_quantity , lo_extendedprice and lo_discount columns needs to read 89.41GB in total. It is 17.8% towards the filesize (502.93GB). How to make Arrow files This section introduces the way to transform dataset already stored in PostgreSQL database system into Apache Arrow file. Using PyArrow+Pandas A pair of PyArrow module, developed by Arrow developers community, and Pandas data frame can dump PostgreSQL database into an Arrow file. The example below reads all the data in table t0 , then write out them into /tmp/t0.arrow . import pyarrow as pa import pandas as pd X = pd.read_sql(sql=\"SELECT * FROM t0\", con=\"postgresql://localhost/postgres\") Y = pa.Table.from_pandas(X) f = pa.RecordBatchFileWriter('/tmp/t0.arrow', Y.schema) f.write_table(Y,1000000) # RecordBatch for each million rows f.close() Please note that the above operation once keeps query result of the SQL on memory, so should pay attention on memory consumption if you want to transfer massive rows at once. Using Pg2Arrow On the other hand, pg2arrow command, developed by PG-Strom Development Team, enables us to write out query result into Arrow file. This tool is designed to write out massive amount of data into storage device like NVME-SSD. It fetch query results from PostgreSQL database system, and write out Record Batches of Arrow format for each data size specified by the -s|--segment-size option. Thus, its memory consumption is relatively reasonable. pg2arrow command is distributed with PG-Strom. It shall be installed on the bin directory of PostgreSQL related utilities. $ pg2arrow --help Usage: pg2arrow [OPTION] [database] [username] General options: -d, --dbname=DBNAME Database name to connect to -c, --command=COMMAND SQL command to run -t, --table=TABLENAME Equivalent to '-c SELECT * FROM TABLENAME' (-c and -t are exclusive, either of them must be given) --inner-join=SUB_COMMAND --outer-join=SUB_COMMAND -o, --output=FILENAME result file in Apache Arrow format --append=FILENAME result Apache Arrow file to be appended (--output and --append are exclusive. If neither of them are given, it creates a temporary file.) -S, --stat[=COLUMNS] embeds min/max statistics for each record batch COLUMNS is a comma-separated list of the target columns if partially enabled. Arrow format options: -s, --segment-size=SIZE size of record batch for each Connection options: -h, --host=HOSTNAME database server host -p, --port=PORT database server port -u, --user=USERNAME database user name -w, --no-password never prompt for password -W, --password force password prompt Other options: --dump=FILENAME dump information of arrow file --progress shows progress of the job --set=NAME:VALUE config option to set before SQL execution --help shows this message Report bugs to . The -h or -U option specifies the connection parameters of PostgreSQL, like psql or pg_dump . The simplest usage of this command is running a SQL command specified by -c|--command option on PostgreSQL server, then write out results into the file specified by -o|--output option in Arrow format. --append option is available, instead of -o|--output option. It means appending data to existing Apache Arrow file. In this case, the target Apache Arrow file must have fully identical schema definition towards the specified SQL command. The example below reads all the data in table t0 , then write out them into the file /tmp/t0.arrow . $ pg2arrow -U kaigai -d postgres -c \"SELECT * FROM t0\" -o /tmp/t0.arrow Although it is an option for developers, --dump prints schema definition and record-batch location and size of Arrow file in human readable form. --progress option enables to show progress of the task. It is useful when a huge table is transformed to Apache Arrow format. Advanced Usage SSDtoGPU Direct SQL In case when all the Arrow files mapped on the Arrow_Fdw foreign table satisfies the terms below, PG-Strom enables SSD-to-GPU Direct SQL to load columnar data. Arrow files are on NVME-SSD volume. NVME-SSD volume is managed by Ext4 filesystem. Total size of Arrow files exceeds the pg_strom.nvme_strom_threshold configuration. Partition configuration Arrow_Fdw foreign tables can be used as a part of partition leafs. Usual PostgreSQL tables can be mixtured with Arrow_Fdw foreign tables. So, pay attention Arrow_Fdw foreign table does not support any writer operations. And, make boundary condition of the partition consistent to the contents of the mapped Arrow file. It is a responsibility of the database administrators. A typical usage scenario is processing of long-standing accumulated log-data. Unlike transactional data, log-data is mostly write-once and will never be updated / deleted. Thus, by migration of the log-data after a lapse of certain period into Arrow_Fdw foreign table that is read-only but rapid processing, we can accelerate summarizing and analytics workloads. In addition, log-data likely have timestamp, so it is quite easy design to add partition leafs periodically, like monthly, weekly or others. The example below defines a partitioned table that mixes a normal PostgreSQL table and Arrow_Fdw foreign tables. The normal PostgreSQL table, is read-writable, is specified as default partition, so DBA can migrate only past log-data into Arrow_Fdw foreign table under the database system operations. CREATE TABLE lineorder ( lo_orderkey numeric, lo_linenumber integer, lo_custkey numeric, lo_partkey integer, lo_suppkey numeric, lo_orderdate integer, lo_orderpriority character(15), lo_shippriority character(1), lo_quantity numeric, lo_extendedprice numeric, lo_ordertotalprice numeric, lo_discount numeric, lo_revenue numeric, lo_supplycost numeric, lo_tax numeric, lo_commit_date character(8), lo_shipmode character(10) ) PARTITION BY RANGE (lo_orderdate); CREATE TABLE lineorder__now PARTITION OF lineorder default; CREATE FOREIGN TABLE lineorder__1993 PARTITION OF lineorder FOR VALUES FROM (19930101) TO (19940101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1993.arrow'); CREATE FOREIGN TABLE lineorder__1994 PARTITION OF lineorder FOR VALUES FROM (19940101) TO (19950101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1994.arrow'); CREATE FOREIGN TABLE lineorder__1995 PARTITION OF lineorder FOR VALUES FROM (19950101) TO (19960101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1995.arrow'); CREATE FOREIGN TABLE lineorder__1996 PARTITION OF lineorder FOR VALUES FROM (19960101) TO (19970101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1996.arrow'); Below is the query execution plan towards the table. By the query condition lo_orderdate between 19950701 and 19960630 that touches boundary condition of the partition, the partition leaf lineorder__1993 and lineorder__1994 are pruned, so it makes a query execution plan to read other (foreign) tables only. =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM lineorder,date1 WHERE lo_orderdate = d_datekey AND lo_orderdate between 19950701 and 19960630 AND lo_discount between 1 and 3 ABD lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=172088.90..172088.91 rows=1 width=32) -> Hash Join (cost=10548.86..172088.51 rows=77 width=64) Hash Cond: (lineorder__1995.lo_orderdate = date1.d_datekey) -> Append (cost=10444.35..171983.80 rows=77 width=67) -> Custom Scan (GpuScan) on lineorder__1995 (cost=10444.35..33671.87 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1995.arrow (size: 892.57MB) -> Custom Scan (GpuScan) on lineorder__1996 (cost=10444.62..33849.21 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1996.arrow (size: 897.87MB) -> Custom Scan (GpuScan) on lineorder__now (cost=11561.33..104462.33 rows=1 width=18) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash (cost=72.56..72.56 rows=2556 width=4) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=4) (16 rows) The operation below extracts the data in 1997 from lineorder__now table, then move to a new Arrow_Fdw foreign table. $ pg2arrow -d sample -o /opt/tmp/lineorder_1997.arrow \\ -c \"SELECT * FROM lineorder WHERE lo_orderdate between 19970101 and 19971231\" pg2arrow command extracts the data in 1997 from the lineorder table into a new Arrow file. BEGIN; -- -- remove rows in 1997 from the read-writable table -- DELETE FROM lineorder WHERE lo_orderdate BETWEEN 19970101 AND 19971231; -- -- define a new partition leaf which maps log-data in 1997 -- CREATE FOREIGN TABLE lineorder__1997 PARTITION OF lineorder FOR VALUES FROM (19970101) TO (19980101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1997.arrow'); COMMIT; A series of operations above delete the data in 1997 from lineorder__new that is a PostgreSQL table, then maps an Arrow file ( /opt/tmp/lineorder_1997.arrow ) which contains an identical contents as a foreign table lineorder__1997 . For correctness, block size is configurable on build from 4KB to 32KB. \u21a9","title":"Apache Arrow"},{"location":"arrow_fdw/#apache-arrow-columnar-store","text":"","title":"Apache Arrow (Columnar Store)"},{"location":"arrow_fdw/#overview","text":"PostgreSQL tables internally consist of 8KB blocks 1 , and block contains tuples which is a data structure of all the attributes and metadata per row. It collocates date of a row closely, so it works effectively for INSERT/UPDATE-major workloads, but not suitable for summarizing or analytics of mass-data. It is not usual to reference all the columns in a table on mass-data processing, and we tend to reference a part of columns in most cases. In this case, the storage I/O bandwidth consumed by unreferenced columns are waste, however, we have no easy way to fetch only particular columns referenced from the row-oriented data structure. In case of column oriented data structure, in an opposite manner, it has extreme disadvantage on INSERT/UPDATE-major workloads, however, it can pull out maximum performance of storage I/O on mass-data processing workloads because it can loads only referenced columns. From the standpoint of processor efficiency also, column-oriented data structure looks like a flat array that pulls out maximum bandwidth of memory subsystem for GPU, by special memory access pattern called Coalesced Memory Access.","title":"Overview"},{"location":"arrow_fdw/#what-is-apache-arrow","text":"Apache Arrow is a data format of structured data to save in columnar-form and to exchange other applications. Some applications for big-data processing support the format, and it is easy for self-developed applications to use Apache Arrow format since they provides libraries for major programming languages like C,C++ or Python. Apache Arrow format file internally contains Schema portion to define data structure, and one or more RecordBatch to save columnar-data based on the schema definition. For data types, it supports integers, strint (variable-length), date/time types and so on. Indivisual columnar data has its internal representation according to the data types. Data representation in Apache Arrow is not identical with the representation in PostgreSQL. For example, epoch of timestamp in Arrow is 1970-01-01 and it supports multiple precision. In contrast, epoch of timestamp in PostgreSQL is 2001-01-01 and it has microseconds accuracy. Arrow_Fdw allows to read Apache Arrow files on PostgreSQL using foreign table mechanism. If an Arrow file contains 8 of record batches that has million items for each column data, for example, we can access 8 million rows on the Arrow files through the foreign table.","title":"What is Apache Arrow?"},{"location":"arrow_fdw/#operations","text":"","title":"Operations"},{"location":"arrow_fdw/#creation-of-foreign-tables","text":"Usually it takes the 3 steps below to create a foreign table. Define a foreign-data-wrapper using CREATE FOREIGN DATA WRAPPER command Define a foreign server using CREATE SERVER command Define a foreign table using CREATE FOREIGN TABLE command The first 2 steps above are included in the CREATE EXTENSION pg_strom command. All you need to run individually is CREATE FOREIGN TABLE command last. CREATE FOREIGN TABLE flogdata ( ts timestamp, sensor_id int, signal1 smallint, signal2 smallint, signal3 smallint, signal4 smallint, ) SERVER arrow_fdw OPTIONS (file '/path/to/logdata.arrow'); Data type of columns specified by the CREATE FOREIGN TABLE command must be matched to schema definition of the Arrow files to be mapped. Arrow_Fdw also supports a useful manner using IMPORT FOREIGN SCHEMA statement. It automatically generates a foreign table definition using schema definition of the Arrow files. It specifies the foreign table name, schema name to import, and path name of the Arrow files using OPTION-clause. Schema definition of Arrow files contains data types and optional column name for each column. It declares a new foreign table using these information. IMPORT FOREIGN SCHEMA flogdata FROM SERVER arrow_fdw INTO public OPTIONS (file '/path/to/logdata.arrow');","title":"Creation of foreign tables"},{"location":"arrow_fdw/#foreign-table-options","text":"Arrow_Fdw supports the options below. Right now, all the options are for foreign tables. file=PATHNAME It maps an Arrow file specified on the foreign table. files=PATHNAME1[,PATHNAME2...] It maps multiple Arrow files specified by comma (,) separated files list on the foreign table. dir=DIRNAME It maps all the Arrow files in the directory specified on the foreign table. suffix=SUFFIX When dir option is given, it maps only files with the specified suffix, like .arrow` for example. parallel_workers=N_WORKERS It tells the number of workers that should be used to assist a parallel scan of this foreign table; equivalent to parallel_workers storage parameter at normal tables. writable=(true|false) It allows execution of INSERT command on the foreign table. See the section of \"Writable Arrow_Fdw\"","title":"Foreign table options"},{"location":"arrow_fdw/#data-type-mapping","text":"Arrow data types are mapped on PostgreSQL data types as follows. Int mapped to either of int1 , int2 , int4 or int8 according to the bitWidth attribute. is_signed attribute shall be ignored. int1 is an enhanced data type by PG-Strom. FloatingPoint mapped to either of float2 , float4 or float8 according to the precision attribute. float2 is an enhanced data type by PG-Strom. Binary mapped to bytea data type Decimal mapped to numeric data type Date mapped to date data type; to be adjusted as if it has unit=Day precision. Time mapped to time data type; to be adjusted as if it has unit=MicroSecond precision. Timestamp mapped to timestamp data type; to be adjusted as if it has unit=MicroSecond precision. Interval mapped to interval data type. List mapped to 1-dimensional array of the element data type. Struct mapped to compatible composite data type; that shall be defined preliminary. FixedSizeBinary mapped to char(n) data type according to the byteWidth attribute. If pg_type=TYPENAME is configured, PG-Strom may assign the configured data type. Right now, inet and macaddr are supported. Union , Map , Duration , LargeBinary , LargeUtf8 , LargeList Right now, PG-Strom cannot map these Arrow data types onto any of PostgreSQL data types.","title":"Data type mapping"},{"location":"arrow_fdw/#how-to-read-explain","text":"EXPLAIN command show us information about Arrow files reading. The example below is an output of query execution plan that includes f_lineorder foreign table that mapps an Arrow file of 503GB. =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) -> Custom Scan (GpuPreAgg) on f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..78.95 rows=365 width=4) Filter: (d_year = 1993) (12 rows) According to the EXPLAIN output, we can see Custom Scan (GpuPreAgg) scans f_lineorder foreign table. file0 item shows the filename ( /opt/nvme/lineorder_s999.arrow ) on behalf of the foreign table and its size. If multiple files are mapped, any files are individually shown, like file1 , file2 , ... The referenced item shows the list of referenced columns. We can see this query touches lo_orderdate , lo_quantity , lo_extendedprice and lo_discount columns. In addition, GPU-Direct SQL: enabled (GPU-0) shows us the scan on f_lineorder uses GPU-Direct SQL mechanism. VERBOSE option outputs more detailed information. =# EXPLAIN VERBOSE SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) Output: pgstrom.sum_int((pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint))) -> Custom Scan (GpuPreAgg) on public.f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) Output: (pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint)) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) lo_orderdate: 22.35GB lo_quantity: 22.35GB lo_extendedprice: 22.35GB lo_discount: 22.35GB GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , , , KVecs-Buffer: nbytes: 51200, ndims: 3, items=[kvec0=<0x0000-27ff, type='int4', expr='lo_discount'>, kvec1=<0x2800-4fff, type='int4', expr='lo_quantity'>, kvec2=<0x5000-77ff, type='int4', expr='lo_extendedprice'>, kvec3=<0x7800-9fff, type='int4', expr='lo_orderdate'>, kvec4=<0xa000-c7ff, type='int4', expr='d_datekey'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, , , ]}, items[1]={LoadVars(depth=1): kvars=[]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, , ]}}, items[1]={MoveVars(depth=1): items=[, ]}}} Scan Quals OpCode: {Bool::AND args=[{Func(bool)::int4ge args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='1'}]}, {Func(bool)::int4le args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='3'}]}, {Func(bool)::int4lt args=[{Var(int4): slot=1, expr='lo_quantity'}, {Const(int4): value='25'}]}]} Join Quals OpCode: {Packed items[1]={JoinQuals: {Func(bool)::int4eq args=[{Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}, {Var(int4): slot=5, expr='d_datekey'}]}}} Join HashValue OpCode: {Packed items[1]={HashValue arg={Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}}} Partial Aggregation OpCode: {AggFuncs arg={SaveExpr: arg={Func(int8)::int8 arg={Func(int4)::int4mul args=[{Var(int4): kvec=0x5000-7800, expr='lo_extendedprice'}, {Var(int4): kvec=0x0000-2800, expr='lo_discount'}]}}}} Partial Function BufSz: 16 -> Seq Scan on public.date1 (cost=0.00..78.95 rows=365 width=4) Output: date1.d_datekey Filter: (date1.d_year = 1993) (28 rows) The verbose output additionally displays amount of column-data to be loaded on reference of columns. The load of lo_orderdate , lo_quantity , lo_extendedprice and lo_discount columns needs to read 89.41GB in total. It is 17.8% towards the filesize (502.93GB).","title":"How to read EXPLAIN"},{"location":"arrow_fdw/#how-to-make-arrow-files","text":"This section introduces the way to transform dataset already stored in PostgreSQL database system into Apache Arrow file.","title":"How to make Arrow files"},{"location":"arrow_fdw/#using-pyarrowpandas","text":"A pair of PyArrow module, developed by Arrow developers community, and Pandas data frame can dump PostgreSQL database into an Arrow file. The example below reads all the data in table t0 , then write out them into /tmp/t0.arrow . import pyarrow as pa import pandas as pd X = pd.read_sql(sql=\"SELECT * FROM t0\", con=\"postgresql://localhost/postgres\") Y = pa.Table.from_pandas(X) f = pa.RecordBatchFileWriter('/tmp/t0.arrow', Y.schema) f.write_table(Y,1000000) # RecordBatch for each million rows f.close() Please note that the above operation once keeps query result of the SQL on memory, so should pay attention on memory consumption if you want to transfer massive rows at once.","title":"Using PyArrow+Pandas"},{"location":"arrow_fdw/#using-pg2arrow","text":"On the other hand, pg2arrow command, developed by PG-Strom Development Team, enables us to write out query result into Arrow file. This tool is designed to write out massive amount of data into storage device like NVME-SSD. It fetch query results from PostgreSQL database system, and write out Record Batches of Arrow format for each data size specified by the -s|--segment-size option. Thus, its memory consumption is relatively reasonable. pg2arrow command is distributed with PG-Strom. It shall be installed on the bin directory of PostgreSQL related utilities. $ pg2arrow --help Usage: pg2arrow [OPTION] [database] [username] General options: -d, --dbname=DBNAME Database name to connect to -c, --command=COMMAND SQL command to run -t, --table=TABLENAME Equivalent to '-c SELECT * FROM TABLENAME' (-c and -t are exclusive, either of them must be given) --inner-join=SUB_COMMAND --outer-join=SUB_COMMAND -o, --output=FILENAME result file in Apache Arrow format --append=FILENAME result Apache Arrow file to be appended (--output and --append are exclusive. If neither of them are given, it creates a temporary file.) -S, --stat[=COLUMNS] embeds min/max statistics for each record batch COLUMNS is a comma-separated list of the target columns if partially enabled. Arrow format options: -s, --segment-size=SIZE size of record batch for each Connection options: -h, --host=HOSTNAME database server host -p, --port=PORT database server port -u, --user=USERNAME database user name -w, --no-password never prompt for password -W, --password force password prompt Other options: --dump=FILENAME dump information of arrow file --progress shows progress of the job --set=NAME:VALUE config option to set before SQL execution --help shows this message Report bugs to . The -h or -U option specifies the connection parameters of PostgreSQL, like psql or pg_dump . The simplest usage of this command is running a SQL command specified by -c|--command option on PostgreSQL server, then write out results into the file specified by -o|--output option in Arrow format. --append option is available, instead of -o|--output option. It means appending data to existing Apache Arrow file. In this case, the target Apache Arrow file must have fully identical schema definition towards the specified SQL command. The example below reads all the data in table t0 , then write out them into the file /tmp/t0.arrow . $ pg2arrow -U kaigai -d postgres -c \"SELECT * FROM t0\" -o /tmp/t0.arrow Although it is an option for developers, --dump prints schema definition and record-batch location and size of Arrow file in human readable form. --progress option enables to show progress of the task. It is useful when a huge table is transformed to Apache Arrow format.","title":"Using Pg2Arrow"},{"location":"arrow_fdw/#advanced-usage","text":"","title":"Advanced Usage"},{"location":"arrow_fdw/#ssdtogpu-direct-sql","text":"In case when all the Arrow files mapped on the Arrow_Fdw foreign table satisfies the terms below, PG-Strom enables SSD-to-GPU Direct SQL to load columnar data. Arrow files are on NVME-SSD volume. NVME-SSD volume is managed by Ext4 filesystem. Total size of Arrow files exceeds the pg_strom.nvme_strom_threshold configuration.","title":"SSDtoGPU Direct SQL"},{"location":"arrow_fdw/#partition-configuration","text":"Arrow_Fdw foreign tables can be used as a part of partition leafs. Usual PostgreSQL tables can be mixtured with Arrow_Fdw foreign tables. So, pay attention Arrow_Fdw foreign table does not support any writer operations. And, make boundary condition of the partition consistent to the contents of the mapped Arrow file. It is a responsibility of the database administrators. A typical usage scenario is processing of long-standing accumulated log-data. Unlike transactional data, log-data is mostly write-once and will never be updated / deleted. Thus, by migration of the log-data after a lapse of certain period into Arrow_Fdw foreign table that is read-only but rapid processing, we can accelerate summarizing and analytics workloads. In addition, log-data likely have timestamp, so it is quite easy design to add partition leafs periodically, like monthly, weekly or others. The example below defines a partitioned table that mixes a normal PostgreSQL table and Arrow_Fdw foreign tables. The normal PostgreSQL table, is read-writable, is specified as default partition, so DBA can migrate only past log-data into Arrow_Fdw foreign table under the database system operations. CREATE TABLE lineorder ( lo_orderkey numeric, lo_linenumber integer, lo_custkey numeric, lo_partkey integer, lo_suppkey numeric, lo_orderdate integer, lo_orderpriority character(15), lo_shippriority character(1), lo_quantity numeric, lo_extendedprice numeric, lo_ordertotalprice numeric, lo_discount numeric, lo_revenue numeric, lo_supplycost numeric, lo_tax numeric, lo_commit_date character(8), lo_shipmode character(10) ) PARTITION BY RANGE (lo_orderdate); CREATE TABLE lineorder__now PARTITION OF lineorder default; CREATE FOREIGN TABLE lineorder__1993 PARTITION OF lineorder FOR VALUES FROM (19930101) TO (19940101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1993.arrow'); CREATE FOREIGN TABLE lineorder__1994 PARTITION OF lineorder FOR VALUES FROM (19940101) TO (19950101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1994.arrow'); CREATE FOREIGN TABLE lineorder__1995 PARTITION OF lineorder FOR VALUES FROM (19950101) TO (19960101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1995.arrow'); CREATE FOREIGN TABLE lineorder__1996 PARTITION OF lineorder FOR VALUES FROM (19960101) TO (19970101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1996.arrow'); Below is the query execution plan towards the table. By the query condition lo_orderdate between 19950701 and 19960630 that touches boundary condition of the partition, the partition leaf lineorder__1993 and lineorder__1994 are pruned, so it makes a query execution plan to read other (foreign) tables only. =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM lineorder,date1 WHERE lo_orderdate = d_datekey AND lo_orderdate between 19950701 and 19960630 AND lo_discount between 1 and 3 ABD lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=172088.90..172088.91 rows=1 width=32) -> Hash Join (cost=10548.86..172088.51 rows=77 width=64) Hash Cond: (lineorder__1995.lo_orderdate = date1.d_datekey) -> Append (cost=10444.35..171983.80 rows=77 width=67) -> Custom Scan (GpuScan) on lineorder__1995 (cost=10444.35..33671.87 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1995.arrow (size: 892.57MB) -> Custom Scan (GpuScan) on lineorder__1996 (cost=10444.62..33849.21 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1996.arrow (size: 897.87MB) -> Custom Scan (GpuScan) on lineorder__now (cost=11561.33..104462.33 rows=1 width=18) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash (cost=72.56..72.56 rows=2556 width=4) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=4) (16 rows) The operation below extracts the data in 1997 from lineorder__now table, then move to a new Arrow_Fdw foreign table. $ pg2arrow -d sample -o /opt/tmp/lineorder_1997.arrow \\ -c \"SELECT * FROM lineorder WHERE lo_orderdate between 19970101 and 19971231\" pg2arrow command extracts the data in 1997 from the lineorder table into a new Arrow file. BEGIN; -- -- remove rows in 1997 from the read-writable table -- DELETE FROM lineorder WHERE lo_orderdate BETWEEN 19970101 AND 19971231; -- -- define a new partition leaf which maps log-data in 1997 -- CREATE FOREIGN TABLE lineorder__1997 PARTITION OF lineorder FOR VALUES FROM (19970101) TO (19980101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1997.arrow'); COMMIT; A series of operations above delete the data in 1997 from lineorder__new that is a PostgreSQL table, then maps an Arrow file ( /opt/tmp/lineorder_1997.arrow ) which contains an identical contents as a foreign table lineorder__1997 . For correctness, block size is configurable on build from 4KB to 32KB. \u21a9","title":"Partition configuration"},{"location":"brin/","text":"Index Support Overview PostgreSQL supports several index strategies. The default is B-tree that can rapidly fetch records with a particular value. Elsewhere, it also supports Hash, BRIN, GiST, GIN and others that have own characteristics for each. PG-Strom supports only BRIN-index right now. BRIN-index works efficiently on the dataset we can expect physically neighbor records have similar key values, like timestamp values of time-series data. It allows to skip blocks-range if any records in the range obviously don't match to the scan qualifiers, then, also enables to reduce the amount of I/O due to full table scan. PG-Strom also utilizes the feature of BRIN-index, to skip obviously unnecessary blocks from the ones to be loaded to GPU. Configuration No special configurations are needed to use BRIN-index. PG-Strom automatically applies BRIN-index based scan if BRIN-index is configured on the referenced columns and scan qualifiers are suitable to the index. Also see the PostgreSQL Documentation for the BRIN-index feature. By the GUC parameters below, PG-Strom enables/disables usage of BRIN-index. It usually don't need to change from the default configuration, except for debugging or trouble shooting. Parameter Type Default Description pg_strom.enable_brin bool on enables/disables usage of BRIN-index Operations By EXPLAIN , we can check whether BRIN-index is in use. postgres=# EXPLAIN ANALYZE SELECT * FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' AND cat LIKE '%aaa%'; QUERY PLAN -------------------------------------------------------------------------------- Custom Scan (GpuScan) on dt (cost=94810.93..176275.00 rows=169992 width=44) (actual time=1777.819..1901.537 rows=175277 loops=1) GPU Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date) AND (cat ~~ '%aaa%'::text)) Rows Removed by GPU Filter: 4385491 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 0.529 ms Execution time: 2323.063 ms (7 rows) In the example above, BRIN-index is configured on the ymd column. BRIN cond shows the qualifier of BRIN-index for concentration. BRIN skipped shows the number of skipped blocks actually. In this case, 424704 blocks are skipped, then, it filters out 4385491 rows in the loaded blocks by the scan qualifiers. GpuJoin and GpuPreAgg often pulls up its underlying table scan and runs the scan by itself, to reduce inefficient data transfer. In this case, it also uses the BRIN-index to concentrate the scan. The example below shows a usage of BRIN-index in a query which includes GROUP BY. postgres=# EXPLAIN ANALYZE SELECT cat,count(*) FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=6149.78..6151.86 rows=26 width=12) (actual time=427.482..427.499 rows=26 loops=1) Group Key: cat -> Sort (cost=6149.78..6150.24 rows=182 width=12) (actual time=427.465..427.467 rows=26 loops=1) Sort Key: cat Sort Method: quicksort Memory: 26kB -> Custom Scan (GpuPreAgg) on dt (cost=6140.68..6142.95 rows=182 width=12) (actual time=427.331..427.339 rows=26 loops=1) Reduction: Local Outer Scan: dt (cost=4000.00..4011.99 rows=4541187 width=4) (actual time=78.573..415.961 rows=4560768 loops=1) Outer Scan Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) Rows Removed by Outer Scan Filter: 15564 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 30.992 ms Execution time: 818.994 ms (14 rows)","title":"BRIN Index"},{"location":"brin/#index-support","text":"","title":"Index Support"},{"location":"brin/#overview","text":"PostgreSQL supports several index strategies. The default is B-tree that can rapidly fetch records with a particular value. Elsewhere, it also supports Hash, BRIN, GiST, GIN and others that have own characteristics for each. PG-Strom supports only BRIN-index right now. BRIN-index works efficiently on the dataset we can expect physically neighbor records have similar key values, like timestamp values of time-series data. It allows to skip blocks-range if any records in the range obviously don't match to the scan qualifiers, then, also enables to reduce the amount of I/O due to full table scan. PG-Strom also utilizes the feature of BRIN-index, to skip obviously unnecessary blocks from the ones to be loaded to GPU.","title":"Overview"},{"location":"brin/#configuration","text":"No special configurations are needed to use BRIN-index. PG-Strom automatically applies BRIN-index based scan if BRIN-index is configured on the referenced columns and scan qualifiers are suitable to the index. Also see the PostgreSQL Documentation for the BRIN-index feature. By the GUC parameters below, PG-Strom enables/disables usage of BRIN-index. It usually don't need to change from the default configuration, except for debugging or trouble shooting. Parameter Type Default Description pg_strom.enable_brin bool on enables/disables usage of BRIN-index","title":"Configuration"},{"location":"brin/#operations","text":"By EXPLAIN , we can check whether BRIN-index is in use. postgres=# EXPLAIN ANALYZE SELECT * FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' AND cat LIKE '%aaa%'; QUERY PLAN -------------------------------------------------------------------------------- Custom Scan (GpuScan) on dt (cost=94810.93..176275.00 rows=169992 width=44) (actual time=1777.819..1901.537 rows=175277 loops=1) GPU Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date) AND (cat ~~ '%aaa%'::text)) Rows Removed by GPU Filter: 4385491 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 0.529 ms Execution time: 2323.063 ms (7 rows) In the example above, BRIN-index is configured on the ymd column. BRIN cond shows the qualifier of BRIN-index for concentration. BRIN skipped shows the number of skipped blocks actually. In this case, 424704 blocks are skipped, then, it filters out 4385491 rows in the loaded blocks by the scan qualifiers. GpuJoin and GpuPreAgg often pulls up its underlying table scan and runs the scan by itself, to reduce inefficient data transfer. In this case, it also uses the BRIN-index to concentrate the scan. The example below shows a usage of BRIN-index in a query which includes GROUP BY. postgres=# EXPLAIN ANALYZE SELECT cat,count(*) FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=6149.78..6151.86 rows=26 width=12) (actual time=427.482..427.499 rows=26 loops=1) Group Key: cat -> Sort (cost=6149.78..6150.24 rows=182 width=12) (actual time=427.465..427.467 rows=26 loops=1) Sort Key: cat Sort Method: quicksort Memory: 26kB -> Custom Scan (GpuPreAgg) on dt (cost=6140.68..6142.95 rows=182 width=12) (actual time=427.331..427.339 rows=26 loops=1) Reduction: Local Outer Scan: dt (cost=4000.00..4011.99 rows=4541187 width=4) (actual time=78.573..415.961 rows=4560768 loops=1) Outer Scan Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) Rows Removed by Outer Scan Filter: 15564 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 30.992 ms Execution time: 818.994 ms (14 rows)","title":"Operations"},{"location":"fluentd/","text":"connect with Fluentd This chapter introduces the cooperation with Fluentd via Apache Arrow data format for the efficient importing of IoT/M2M log data. Overview In the technological domain known as IoT/M2M, various software has been developed to store and analyze the large amount of log data generated by devices such as cell phones, automobiles, and various sensors, as well as PCs and servers. This is because the data generated by a large number of devices from time-by-time tend to grow up huge, and special architecture/technology is required to process it in a practical amount of time. PG-Strom's features are designed and implemented for high-speed processing of log data of such a scale. On the other hand, it tends to be a time-consuming job to transfer and import these data into a database in order to make it searchable/summarizable on such a scale. Therefore, PG-Strom includes a fluent-plugin-arrow-file module for Fluentd that outputs the data in Apache Arrow format, and tries to deal with the problem. Fluentd is a log collection tool developed by Sadayuki Furuhashi. It is the de facto standard for collecting and storing a wide variety of log data, ranging from server logs like Syslog to device logs of IoT/M2M devices. Fluentd allows customization of the input/output and processing of log data by adding plugins written in Ruby. As of 2022, more than 800 plugins have been introduced on the official website. PG-Strom can handle two types of data formats: PostgreSQL Heap format (transactional row data) and Apache Arrow format (structured column data). The Apache Arrow format is suitable for workloads like those in the IoT/M2M, where huge amounts of data are generated time-by-time. arrow-file plugin This chapter describes the approach to write out the log data collected by Fluentd in Apache Arrow format, and to refere it with PG-Strom. We assume td-agent here, that is a stable version of Fluentd provided by Treasure Data. PG-Strom includes the fluent-plugin-arrow-file module. This allows Fluentd to write out the log data it collects as an Apache Arrow format file with a specified schema structure. Using PG-Strom's Arrow_Fdw, this Apache Arrow format file can be accessed as an foreign table. In addition, GPU-Direct SQL allows to load these files extremely fast, if the storage system is appropriately configured. This has the following advantages: There is no need to import data into the DB because PG-Strom directly accesses the files output by Fluentd. The data readout (I/O load) for the searching and summarizing process can be kept to a minimum because of the columnar data format. You can archive outdated log data only by moving files on the OS. On the other hand, in cases that it takes a long time to store a certain size of log (for example, log generation is rare), another method such as outputting to a PostgreSQL table is suitable for more real-time log analysis. This is because the size of the Record Batch needs to be reasonably large to acquire the performance benefits of the Apache Arrow format. Internals There are several types of plugins for Fluentd: Input plugins to receive logs from outside, Parser plugins to shape the logs, Buffer plugins to temporarily store the received logs, and Output plugins to output the logs. The arrow-file plugin is categorized as Output plugin. It writes out a \"chunk\" of log data passed from the Buffer plugin in Apache Arrow format with the schema structure specified in the configuration. The Input/Parser plugin is responsible for converting the received logs into a common format so that the Buffer and Output plugins can handle the input data without being aware of its format. The common format is a pair of tag , an identifier that can be used to sort the logs, a log timestamp time , and record , an associative array formed from the raw logs. The arrow-file plugin writes to an Apache Arrow format file with the tag and time fields and each element of the record associative array as a column (some may be omitted). Therefore, the output destination file name and schema definition information (mapping of associative array elements to columns/types) are mandatory configuration parameters. Installation Install the td-agent package for Linux distribution you are using. The rake-compiler module is required to install the arrow-file plugin, so please install it before. $ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent4.sh | sh $ sudo /opt/td-agent/bin/fluent-gem install rake-compiler Next, download the source code for PG-Strom and build arrow-file plugin in the fluentd directory. $ git clone https://github.com/heterodb/pg-strom.git $ cd pg-strom/fluentd $ make TD_AGENT=1 gem $ sudo make TD_AGENT=1 install To confirm that the Fluentd plugin is installed, run the following command. $ /opt/td-agent/bin/fluent-gem list | grep arrow fluent-plugin-arrow-file (0.2) Configuration As mentioned above, the arrow-file plugin requires the output path of the file and the schema definition at least. In addition to this, in order to acquire the best performance for searching and aggregation processing, the single chunk of data inside the Apache Arrow file, called the Record Batch, needs to be reasonably large in size. The arrow-file plugin creates a Record Batch for each chunk passed from the Buffer plugin. Therefore, the buffer size of the Buffer plugin should be set with the size of the Record Batch in mind. By the default, the Buffer plugin is set to take a buffer size of 256MB. The configuration parameters for the arrow-file plugin are as follows: path [type: String ] (Required) Specify the file path of the destination. This is a required parameter, and you can use placeholders shown below. Placeholders Description %Y The current year expressed as a four-digit number. %y The current year expressed as a number in the last two digits of the year. %m A two-digit number representing the current month, 01-12. %d A two-digit number representing the current day from 01 to 31. %H A two-digit number representing the hour of the current time 00-23. %M A two-digit number representing the minute of the current time, 00-59. %S A two-digit number representing the second of the current time, 00-59. %p The PID of the current Fluentd process. The placeholder is replaced when the chunk is written out. If an Apache Arrow format file of the same name exists, the Record Batch will be appended to it. If it does not exist, a new Apache Arrow format file is created and the first Record Batch is written out. However, if the size of the existing Apache Arrow file exceeds the filesize_threshold setting described below, rename the existing file and then create a new one. (Example) path /tmp/arrow_logs/my_logs_%y%m%d.%p.log The output Apache Arrow file updates the footer area to point to all Record Batches each time a chunk is written out. Therefore, the generated Apache Arrow file can be read immediately. However, to avoid access conflicts, exclusive handling is required using lockf(3) . schema_defs [type: String ] (Required) Specify the schema definition of the Apache Arrow format file output by fluent-plugin-arrow-file . This is a required parameter, and define the schema structure using strings in the following format. schema_defs := column_def1[,column_def2 ...] column_def := =[;] is the name of the column, which must match the key value of the associative array passed from Fluentd to arrow-file plugin. is the data type of the column. See the following table. is an additional attribute for columns. At this time, only the following attributes are supported. stat_enabled ... The statistics for the configured columns will be collected and the maximum/minimum values for each Record Batch will be set as custom metadata in the form of max_values=... and min_values=... . (Example) schema_defs \"ts=Timestamp;stat_enabled,dev_id=Uint32,temperature=Float32,humidity=Float32\" Data types supported by the arrow-file plugin Data types Description Int8 Int16 Int32 Int64 Signed integer with the specified bit width. Uint8 Uint16 Uint32 Uint64 Unsigned integer with the specified bit width Float16 Float32 Float64 Floating point number with half-precision(16bit), single-precision(32bit) and double-precision(64bit). Decimal Decimal128 128-bit fixed decimal; 256-bit fixed decimal is currently not supported. Timestamp Timestamp[sec] Timestamp[ms] Timestamp[us] Timestamp[ns] Timestamp type with the specified precision. If the precision is omitted, it is treated the same as [us] . Time Time[sec] Time[ms] Time[us] Time[ns] Time type with the specified precision. If the precision is omitted, it is treated the same as [sec] . Date Date[Day] Date[ms] Date type with the specified precision. If the precision is omitted, it is treated the same as [day] . Utf8 String type. Ipaddr4 IP address(IPv4) type. This is represented as a FixedSizeBinary type with byteWidth=4 and custom metadata pg_type=pg_catalog.inet . Ipaddr6 IP address(IPv6) type. This is represented as a FixedSizeBinary type with byteWidth=16 and custom metadata pg_type=pg_catalog.inet . ts_column [type: String / default: unspecified] Specify a column name to set the timestamp value of the log passed from Fluentd (not from record ). This parameter is usually a date-time type such as Timestamp , and the stat_enabled attribute should also be specified to achieve fast search. tag_column [type: String / default: unspecified] Specify a column name to set the tag value of the log passed from Fluentd (not from record ). This parameter is usually a string type such as utf8 . filesize_threshold [type: Integer / default: 10000] Specify the threshold for switching the output destination file in MB. By default, the output destination is switched when the file size exceeds about 10GB. Example As a simple example, this chapter shows a configuration for monitoring the log of a local Apache Httpd server, parsing it field by field, and writing it to an Apache Arrow format file. By setting , /var/log/httpd/access_log will be the data source. Then, the apache2 Parse plugin will cut out the fields: host, user, time, method, path, code, size, referer, agent. The fields are then passed to the arrow-file plugin as an associative array. In schema_defs in , the column definitions of the Apache Arrow file corresponding to the fields are set. For simplicity of explanation, the chunk size is set to a maximum of 4MB / 200 lines in the tag, and it is set to pass to the Output plugin in 10 seconds at most. Example configuration of /etc/td-agent/td-agent.conf @type tail path /var/log/httpd/access_log pos_file /var/log/td-agent/httpd_access.pos tag httpd format apache2 @type apache2 expression /^(?[^ ]*) [^ ]* (?[^ ]*) \\[(? @type arrow_file path /tmp/mytest%Y%m%d.%p.arrow schema_defs \"ts=Timestamp[sec],host=Utf8,method=Utf8,path=Utf8,code=Int32,size=Int32,referer=Utf8,agent=Utf8\" ts_column \"ts\" flush_interval 10s chunk_limit_size 4MB chunk_limit_records 200 Start the td-agent service. $ sudo systemctl start td-agent See the following output. The placeholder for /tmp/mytest%Y%m%d.%p.arrow set in path is replaced and the Apache Httpd log is written to /tmp/mytest20220124.3206341.arrow . $ arrow2csv /tmp/mytest20220124.3206341.arrow --head --offset 300 --limit 10 \"ts\",\"host\",\"method\",\"path\",\"code\",\"size\",\"referer\",\"agent\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme_extra.js\",200,195,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme.js\",200,4401,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/fluentd_overview.png\",200,121459,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/main.js\",200,3027,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-regular.woff2\",200,182708,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/fontawesome-webfont.woff2?v=4.7.0\",200,77160,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/RobotoSlab/roboto-slab-v7-bold.woff2\",200,67312,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-bold.woff2\",200,184912,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/worker.js\",200,3724,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/favicon.ico\",200,1150,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" Let's map the output file to PostgreSQL using PG-Strom's Arrow_Fdw. postgres=# IMPORT FOREIGN SCHEMA mytest FROM SERVER arrow_fdw INTO public OPTIONS (file '/tmp/mytest20220124.3206341.arrow'); IMPORT FOREIGN SCHEMA postgres=# SELECT ts, host, path FROM mytest WHERE code = 404; ts | host | path ---------------------+---------------+---------------------- 2022-01-24 12:02:06 | 192.168.77.73 | /~kaigai/ja/fluentd/ (1 row) postgres=# EXPLAIN SELECT ts, host, path FROM mytest WHERE code = 404; QUERY PLAN ------------------------------------------------------------------------------ Custom Scan (GpuScan) on mytest (cost=4026.12..4026.12 rows=3 width=72) GPU Filter: (code = 404) referenced: ts, host, path, code files0: /tmp/mytest20220124.3206341.arrow (read: 128.00KB, size: 133.94KB) (4 rows) The example above shows how the generated Apache Arrow file can be mapped as an external table and accessed with SQL. Search conditions can be given to search each field of the log formed on the Fluentd side. In the example above, the log with HTTP status code 404 is searched and one record is found.","title":"connect with Fluentd"},{"location":"fluentd/#connect-with-fluentd","text":"This chapter introduces the cooperation with Fluentd via Apache Arrow data format for the efficient importing of IoT/M2M log data.","title":"connect with Fluentd"},{"location":"fluentd/#overview","text":"In the technological domain known as IoT/M2M, various software has been developed to store and analyze the large amount of log data generated by devices such as cell phones, automobiles, and various sensors, as well as PCs and servers. This is because the data generated by a large number of devices from time-by-time tend to grow up huge, and special architecture/technology is required to process it in a practical amount of time. PG-Strom's features are designed and implemented for high-speed processing of log data of such a scale. On the other hand, it tends to be a time-consuming job to transfer and import these data into a database in order to make it searchable/summarizable on such a scale. Therefore, PG-Strom includes a fluent-plugin-arrow-file module for Fluentd that outputs the data in Apache Arrow format, and tries to deal with the problem. Fluentd is a log collection tool developed by Sadayuki Furuhashi. It is the de facto standard for collecting and storing a wide variety of log data, ranging from server logs like Syslog to device logs of IoT/M2M devices. Fluentd allows customization of the input/output and processing of log data by adding plugins written in Ruby. As of 2022, more than 800 plugins have been introduced on the official website. PG-Strom can handle two types of data formats: PostgreSQL Heap format (transactional row data) and Apache Arrow format (structured column data). The Apache Arrow format is suitable for workloads like those in the IoT/M2M, where huge amounts of data are generated time-by-time.","title":"Overview"},{"location":"fluentd/#arrow-file-plugin","text":"This chapter describes the approach to write out the log data collected by Fluentd in Apache Arrow format, and to refere it with PG-Strom. We assume td-agent here, that is a stable version of Fluentd provided by Treasure Data. PG-Strom includes the fluent-plugin-arrow-file module. This allows Fluentd to write out the log data it collects as an Apache Arrow format file with a specified schema structure. Using PG-Strom's Arrow_Fdw, this Apache Arrow format file can be accessed as an foreign table. In addition, GPU-Direct SQL allows to load these files extremely fast, if the storage system is appropriately configured. This has the following advantages: There is no need to import data into the DB because PG-Strom directly accesses the files output by Fluentd. The data readout (I/O load) for the searching and summarizing process can be kept to a minimum because of the columnar data format. You can archive outdated log data only by moving files on the OS. On the other hand, in cases that it takes a long time to store a certain size of log (for example, log generation is rare), another method such as outputting to a PostgreSQL table is suitable for more real-time log analysis. This is because the size of the Record Batch needs to be reasonably large to acquire the performance benefits of the Apache Arrow format.","title":"arrow-file plugin"},{"location":"fluentd/#internals","text":"There are several types of plugins for Fluentd: Input plugins to receive logs from outside, Parser plugins to shape the logs, Buffer plugins to temporarily store the received logs, and Output plugins to output the logs. The arrow-file plugin is categorized as Output plugin. It writes out a \"chunk\" of log data passed from the Buffer plugin in Apache Arrow format with the schema structure specified in the configuration. The Input/Parser plugin is responsible for converting the received logs into a common format so that the Buffer and Output plugins can handle the input data without being aware of its format. The common format is a pair of tag , an identifier that can be used to sort the logs, a log timestamp time , and record , an associative array formed from the raw logs. The arrow-file plugin writes to an Apache Arrow format file with the tag and time fields and each element of the record associative array as a column (some may be omitted). Therefore, the output destination file name and schema definition information (mapping of associative array elements to columns/types) are mandatory configuration parameters.","title":"Internals"},{"location":"fluentd/#installation","text":"Install the td-agent package for Linux distribution you are using. The rake-compiler module is required to install the arrow-file plugin, so please install it before. $ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent4.sh | sh $ sudo /opt/td-agent/bin/fluent-gem install rake-compiler Next, download the source code for PG-Strom and build arrow-file plugin in the fluentd directory. $ git clone https://github.com/heterodb/pg-strom.git $ cd pg-strom/fluentd $ make TD_AGENT=1 gem $ sudo make TD_AGENT=1 install To confirm that the Fluentd plugin is installed, run the following command. $ /opt/td-agent/bin/fluent-gem list | grep arrow fluent-plugin-arrow-file (0.2)","title":"Installation"},{"location":"fluentd/#configuration","text":"As mentioned above, the arrow-file plugin requires the output path of the file and the schema definition at least. In addition to this, in order to acquire the best performance for searching and aggregation processing, the single chunk of data inside the Apache Arrow file, called the Record Batch, needs to be reasonably large in size. The arrow-file plugin creates a Record Batch for each chunk passed from the Buffer plugin. Therefore, the buffer size of the Buffer plugin should be set with the size of the Record Batch in mind. By the default, the Buffer plugin is set to take a buffer size of 256MB. The configuration parameters for the arrow-file plugin are as follows: path [type: String ] (Required) Specify the file path of the destination. This is a required parameter, and you can use placeholders shown below. Placeholders Description %Y The current year expressed as a four-digit number. %y The current year expressed as a number in the last two digits of the year. %m A two-digit number representing the current month, 01-12. %d A two-digit number representing the current day from 01 to 31. %H A two-digit number representing the hour of the current time 00-23. %M A two-digit number representing the minute of the current time, 00-59. %S A two-digit number representing the second of the current time, 00-59. %p The PID of the current Fluentd process. The placeholder is replaced when the chunk is written out. If an Apache Arrow format file of the same name exists, the Record Batch will be appended to it. If it does not exist, a new Apache Arrow format file is created and the first Record Batch is written out. However, if the size of the existing Apache Arrow file exceeds the filesize_threshold setting described below, rename the existing file and then create a new one. (Example) path /tmp/arrow_logs/my_logs_%y%m%d.%p.log The output Apache Arrow file updates the footer area to point to all Record Batches each time a chunk is written out. Therefore, the generated Apache Arrow file can be read immediately. However, to avoid access conflicts, exclusive handling is required using lockf(3) . schema_defs [type: String ] (Required) Specify the schema definition of the Apache Arrow format file output by fluent-plugin-arrow-file . This is a required parameter, and define the schema structure using strings in the following format. schema_defs := column_def1[,column_def2 ...] column_def := =[;] is the name of the column, which must match the key value of the associative array passed from Fluentd to arrow-file plugin. is the data type of the column. See the following table. is an additional attribute for columns. At this time, only the following attributes are supported. stat_enabled ... The statistics for the configured columns will be collected and the maximum/minimum values for each Record Batch will be set as custom metadata in the form of max_values=... and min_values=... . (Example) schema_defs \"ts=Timestamp;stat_enabled,dev_id=Uint32,temperature=Float32,humidity=Float32\" Data types supported by the arrow-file plugin Data types Description Int8 Int16 Int32 Int64 Signed integer with the specified bit width. Uint8 Uint16 Uint32 Uint64 Unsigned integer with the specified bit width Float16 Float32 Float64 Floating point number with half-precision(16bit), single-precision(32bit) and double-precision(64bit). Decimal Decimal128 128-bit fixed decimal; 256-bit fixed decimal is currently not supported. Timestamp Timestamp[sec] Timestamp[ms] Timestamp[us] Timestamp[ns] Timestamp type with the specified precision. If the precision is omitted, it is treated the same as [us] . Time Time[sec] Time[ms] Time[us] Time[ns] Time type with the specified precision. If the precision is omitted, it is treated the same as [sec] . Date Date[Day] Date[ms] Date type with the specified precision. If the precision is omitted, it is treated the same as [day] . Utf8 String type. Ipaddr4 IP address(IPv4) type. This is represented as a FixedSizeBinary type with byteWidth=4 and custom metadata pg_type=pg_catalog.inet . Ipaddr6 IP address(IPv6) type. This is represented as a FixedSizeBinary type with byteWidth=16 and custom metadata pg_type=pg_catalog.inet . ts_column [type: String / default: unspecified] Specify a column name to set the timestamp value of the log passed from Fluentd (not from record ). This parameter is usually a date-time type such as Timestamp , and the stat_enabled attribute should also be specified to achieve fast search. tag_column [type: String / default: unspecified] Specify a column name to set the tag value of the log passed from Fluentd (not from record ). This parameter is usually a string type such as utf8 . filesize_threshold [type: Integer / default: 10000] Specify the threshold for switching the output destination file in MB. By default, the output destination is switched when the file size exceeds about 10GB.","title":"Configuration"},{"location":"fluentd/#example","text":"As a simple example, this chapter shows a configuration for monitoring the log of a local Apache Httpd server, parsing it field by field, and writing it to an Apache Arrow format file. By setting , /var/log/httpd/access_log will be the data source. Then, the apache2 Parse plugin will cut out the fields: host, user, time, method, path, code, size, referer, agent. The fields are then passed to the arrow-file plugin as an associative array. In schema_defs in , the column definitions of the Apache Arrow file corresponding to the fields are set. For simplicity of explanation, the chunk size is set to a maximum of 4MB / 200 lines in the tag, and it is set to pass to the Output plugin in 10 seconds at most. Example configuration of /etc/td-agent/td-agent.conf @type tail path /var/log/httpd/access_log pos_file /var/log/td-agent/httpd_access.pos tag httpd format apache2 @type apache2 expression /^(?[^ ]*) [^ ]* (?[^ ]*) \\[(? @type arrow_file path /tmp/mytest%Y%m%d.%p.arrow schema_defs \"ts=Timestamp[sec],host=Utf8,method=Utf8,path=Utf8,code=Int32,size=Int32,referer=Utf8,agent=Utf8\" ts_column \"ts\" flush_interval 10s chunk_limit_size 4MB chunk_limit_records 200 Start the td-agent service. $ sudo systemctl start td-agent See the following output. The placeholder for /tmp/mytest%Y%m%d.%p.arrow set in path is replaced and the Apache Httpd log is written to /tmp/mytest20220124.3206341.arrow . $ arrow2csv /tmp/mytest20220124.3206341.arrow --head --offset 300 --limit 10 \"ts\",\"host\",\"method\",\"path\",\"code\",\"size\",\"referer\",\"agent\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme_extra.js\",200,195,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme.js\",200,4401,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/fluentd_overview.png\",200,121459,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/main.js\",200,3027,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-regular.woff2\",200,182708,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/fontawesome-webfont.woff2?v=4.7.0\",200,77160,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/RobotoSlab/roboto-slab-v7-bold.woff2\",200,67312,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-bold.woff2\",200,184912,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/worker.js\",200,3724,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/favicon.ico\",200,1150,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" Let's map the output file to PostgreSQL using PG-Strom's Arrow_Fdw. postgres=# IMPORT FOREIGN SCHEMA mytest FROM SERVER arrow_fdw INTO public OPTIONS (file '/tmp/mytest20220124.3206341.arrow'); IMPORT FOREIGN SCHEMA postgres=# SELECT ts, host, path FROM mytest WHERE code = 404; ts | host | path ---------------------+---------------+---------------------- 2022-01-24 12:02:06 | 192.168.77.73 | /~kaigai/ja/fluentd/ (1 row) postgres=# EXPLAIN SELECT ts, host, path FROM mytest WHERE code = 404; QUERY PLAN ------------------------------------------------------------------------------ Custom Scan (GpuScan) on mytest (cost=4026.12..4026.12 rows=3 width=72) GPU Filter: (code = 404) referenced: ts, host, path, code files0: /tmp/mytest20220124.3206341.arrow (read: 128.00KB, size: 133.94KB) (4 rows) The example above shows how the generated Apache Arrow file can be mapped as an external table and accessed with SQL. Search conditions can be given to search each field of the log formed on the Fluentd side. In the example above, the log with HTTP status code 404 is searched and one record is found.","title":"Example"},{"location":"gpucache/","text":"GPU Cache Overview GPU has a device memory that is independent of the RAM in the host system, and in order to calculate on the GPU, data must be transferred from the host system or storage device to the GPU device memory once through the PCI-E bus. The same is true when PG-Strom processes SQL queries on the GPU. Internally, the records read from the PostgreSQL table are transferred to the GPU, and then various SQL operations are executed on the GPU. However, these processes take time to read the tables and transfer the data. (In many cases, much longer than the processing on the GPU!) GPU Cache is a function that reserves an area on the GPU device memory in advance and keeps a copy of the PostgreSQL table there. This can be used to execute search/analysis SQL in real time for data that is relatively small(~10GB) and is frequently updated. The log-based synchronization mechanism described below allows GPU Cache to be kept up-to-date without interfering with highly parallel and transactional workloads. Nevertheless, you can process search/analytical SQL workloads on data already loaded on GPU Cache without reading the records from the table again or transferring the data over the PCI-E bus. A typical use case of GPU Cache is to join location data, such as the current position of a mobile device like a car or a cell phone, collected in real time with other data using GPU-PostGIS . The workload of updating location information sent out by many devices is extremely heavy. However, it also needs to be applied on the GPU side without delay in order to perform search/analysis queries based on the latest location information. Although the size is limited, GPU Cache is one option to achieve both high frequency updates and high-performance search/analysis query execution. Architecture GPU Caches needs to satisfy two requirements: highly parallel update-based workloads and search/analytical queries on constantly up-to-date data. In many systems, the CPU and GPU are connected via the PCI-E bus, and there is a reasonable delay in their communication. Therefore, synchronizing GPU Cache every time a row is updated in the target table will significantly degrade the transaction performance. Using GPU Cache allocates a \"REDO Log Buffer\" on the shared memory on the host side in addition to the area on the memory of the GPU. When a SQL command (INSERT, UPDATE, DELETE) is executed to update a table, the updated contents are copied to the REDO Log Buffer by the AFTER ROW trigger. Since this process can be completed by CPU and RAM alone without any GPU call, it has little impact on transaction performance. When a certain amount of unapplied REDO Log Entries accumulate in the REDO Log Buffer, or a certain amount of time has passed since the last write, it is loaded by a background worker process (GPU memory keeper) and applied to GPU Cache. At this time, REDO Log Entries are transferred to the GPU in batches and processed in parallel by thousands of processor cores on the GPU, so delays caused by this process are rarely a problem. Search/analysis queries against the target table in GPU Cache do not load the table data, but use the data mapped from GPU Cache pre-allocated on the GPU device memory. If there are any unapplied REDO Logs at the start of the search/analysis query, they will all be applied to GPU Cache. This means that the results of a search/analysis query scanning the target GPU Cache will return the same results as if it were referring to the table directly, and the query will always be consistent. Configuration To enable GPU Cache, configure a trigger that executes pgstrom.gpucache_sync_trigger() function on AFTER INSERT OR UPDATE OR DELETE for each row. If GPU Cache is used on the replication slave, the invocation mode of this trigger must be ALWAYS . Below is an example to configure GPU Cache on the dpoints table. =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; Note Additional configuration at PostgreSQL v12 or prior. In case when GPU Cache is used at PostgreSQL v12 or prior, you need to configure an additional BEFORE TRUNCATE statement trigger that executes pgstrom.gpucache_sync_trigger() function. If you want to use the GPU Cache on the replication slave, If you use GPU Cache at the PostgreSQL v12 or prior, in a similar way, invocation mode of this trigger must have ALWAYS . PostgreSQL v13 enhanced its object-access-hook mechanism, so allows extension modules to capture execution of TRUNCATE without triggers configuration. On the other hand, the prior version still needs the BEFORE TRUNCATE statement trigger to keep consistency of GPU Cache by capture of TRUNCATE. Below is an example to configure GPU Cache on the dpoints table at PostgreSQL v12 or prior. =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# create trigger stmt_sync before truncate on dpoints_even for statement execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; =# alter table dpoints_even enable always trigger stmt_sync; GPU Cache Customize You can customize GPU Cache by specifying an optional string in the form of KEY=VALUE as an argument to GPU Cache line trigger. Please note that where you should specify is not to the syntax trigger. The following SQL statement is an example of creating a GPU Cache whose maximum row count is 2.5 million rows and the size of the REDO Log Buffer is 100MB. =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger('max_num_rows=2500000,redo_buffer_size=100m'); The options that can be given to the argument of the line trigger are shown below. gpu_device_id=GPU_ID (default: 0) Specify the target GPU device ID to allocate GPU Cache. max_num_rows=NROWS (default: 10485760) Specify the number of rows that can be allocated on GPU Cache. Just as with PostgreSQL tables, GPU Cache needs to retain updated rows prior to commit for visibility control, so max_num_rows should be specified with some margin. Note that the old version of the updated/deleted row will be released after the transaction is committed. redo_buffer_size=SIZE (default: 160m) Specify the size of REDO Log Buffer. You can use k, m and g as the unit. gpu_sync_interval=SECONDS (default: 5) If the specified time has passed since the last write to the REDO Log Buffer, REDO Log will be applied to the GPU, regardless of the number of rows updated. gpu_sync_threshold=SIZE (default: 25% of redo_buffer_size ) When the unapplied REDO Log in the REDO Log Buffer reaches SIZE bytes, it is applied to the GPU side. You can use k, m and g as the unit. GPU Cache Options Below are GPU Cache related PostgreSQL configuration parameters. pg_strom.enable_gpucache (default: on) This option controls whether search/analytical queries will use GPU Cache or not. If this value is off, the data will be read from the table each time, ignoring GPU Cache even if it is available. Note that this setting has no effect on REDO Log Buffer appending by triggers. pg_strom.gpucache_auto_preload (default: NULL) When PostgreSQL is started/restarted, GPU Cache for the table specified by this parameter will be built in advance. The value should be in the format: DATABASE_NAME.SCHEMA_NAME.TABLE_NAME . To specify multiple tables, separate them by commas. If GPU Cache is not built, the PostgreSQL backend process that first attempts to access GPU Cache will scan the entire target table and transfer it to the GPU. This process usually takes a considerable amount of time. However, by specifying the tables that should be loaded in this option, you can avoid waiting too long the first time you run a search/analysis query. If this parameter is set to '*', it will attempt to load the contents of all tables with GPU Cache into the GPU in order. At this time, the background worker will access all the databases in order, and will return exit code 1 to prompt the postmaster to restart. The server startup log will show that the \"GPUCache Startup Preloader\" exited with exit code 1 as follows, but this is not abnormal. LOG: database system is ready to accept connections LOG: background worker \"GPUCache Startup Preloader\" (PID 856418) exited with exit code 1 LOG: background worker \"GPUCache Startup Preloader\" (PID 856427) exited with exit code 1 LOG: create GpuCacheSharedState dpoints:164c95f71 LOG: gpucache: AllocMemory dpoints:164c95f71 (main_sz=772505600, extra_sz=0) LOG: gpucache: auto preload 'public.dpoints' (DB: postgres) LOG: create GpuCacheSharedState mytest:1773a589b LOG: gpucache: auto preload 'public.mytest' (DB: postgres) LOG: gpucache: AllocMemory mytest:1773a589b (main_sz=675028992, extra_sz=0) Operations Confirm GPU Cache usage GPU Cache is referred to transparently. The user does not need to be aware of the presence or absence of GPU Cache, and PG-Strom will automatically determine and switch the process. The following is the query plan for a query that refers to the table \"dpoints\" which has GPU Cache set. The 3rd row from the bottom, in the \"GPU Cache\" field, shows the basic information about GPU Cache of this table. We can see that the query is executed with referring to GPU Cache and not the \"dpoints\" table. Note that the meaning of each item is as follows: max_num_rows indicates the maximum number of rows that GPU Cache can hold; main indicates the size of the area in GPU Cache for fixed-length fields; extra indicates the size of the area for variable-length data. =# explain select pref, city, count(*) from giscity g, dpoints d where pref = 'Tokyo' and st_contains(g.geom,st_makepoint(d.x, d.y)) group by pref, city; QUERY PLAN -------------------------------------------------------------------------------------------------------- HashAggregate (cost=5638809.75..5638859.99 rows=5024 width=29) Group Key: g.pref, g.city -> Custom Scan (GpuPreAgg) (cost=5638696.71..5638759.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=631923.57..5606933.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) GPU Cache: NVIDIA Tesla V100-PCIE-16GB [max_num_rows: 12000000, main: 772.51M, extra: 0] -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (16 rows) Check status of GPU Cache Use the pgstrom.gpucache_info view to check the current state of GPU Cache. =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | refcnt | corrupted | gpu_main_sz | gpu_extra_sz | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------+------------+--------+-----------+-------------+--------------+----------------------------+-------------------+----------------+------------------+---------------+---------------+------------------------------------------------------------------------------------------------------------------------ 12728 | postgres | 25244 | mytest | 6295279771 | 3 | f | 675028992 | 0 | 2021-05-14 03:00:18.623503 | 500000 | 36000000 | 500000 | 36000000 | 36000000 | gpu_device_id=0,max_num_rows=10485760,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 12728 | postgres | 25262 | dpoints | 5985886065 | 3 | f | 772505600 | 0 | 2021-05-14 03:00:18.524627 | 8000000 | 576000192 | 8000000 | 576000192 | 576000192 | gpu_device_id=0,max_num_rows=12000000,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 (2 rows) Note that pgstrom.gpucache_info will only show the status of GPU Caches that have been initially loaded and have space allocated on the GPU device memory at that time. In other words, if the trigger function is set but not yet initially loaded (no one has accessed it yet), the potentially allocated GPU Cache will not be shown yet. The meaning of each field is as follows: database_oid The OID of the database to which the table with GPU Cache enabled exists. database_name The name of the database to which the table with GPU Cache enabled exists. table_oid The OID of the table with GPU Cache enabled. Note that the database this table exists in is not necessarily the database you are connected to. table_name The name of the table with GPU Cache enabled. Note that the database this table exists in is not necessarily the database you are connected to. signature A hash value indicating the uniqueness of GPU Cache. This value may change, for example, before and after executing ALTER TABLE . refcnt Reference counter of the GPU Cache. It does not always reflect the latest value. corrupted Shows whether the GPU Cache is corrupted. gpu_main_sz The size of the area reserved in GPU Cache for fixed-length data. gpu_extra_sz The size of the area reserved in GPU Cache for variable-length data. redo_write_ts The time when the REDO Log Buffer was last updated. redo_write_nitems The total number of REDO Logs in the REDO Log Buffer. redo_write_pos The total size (in bytes) of the REDO Logs in the REDO Log Buffer. redo_read_nitems The total number of REDO Logs read from the REDO Log Buffer and applied to the GPU. redo_read_pos The total size (in bytes) of REDO Logs read from the REDO Log Buffer and applied to the GPU. redo_sync_pos The position of the REDO Log which is scheduled to be applied to GPU Cache by the background worker on the REDO Log Buffer. This is used internally to avoid a situation where many sessions generate asynchronous requests at the same time when the remaining REDO Log Buffer is running out. config_options The optional string to customize GPU Cache. GPU Cache corruption and recovery If and when REDO logs could not be applied on the GPU cache by some reasons, like insertion of more rows than the max_num_rows configuration, or too much consumption of variable-length data buffer, GPU cache moves to the \"corrupted\" state. Once GPU cache gets corrupted, search/analysis SQL does not reference the GPU cache, and table updates stops writing REDO log. (If GPU cache gets corrupted after beginning of a search/analysis SQL unfortunately, this query may raise an error.) The pgstrom.gpucache_recovery(regclass) function recovers the GPU cache from the corrupted state. If you run this function after removal of the cause where REDO logs could not be applied, it runs initial-loading of the GPU cache again, then tries to recover the GPU cache. For example, if GPU cache gets corrupted because you tried to insert more rows than the max_num_rows , you reconfigure the trigger with expanded max_num_rows configuration or you delete a part of rows from the table, then runs pgstrom.gpucache_recovery() function.","title":"GPU Cache"},{"location":"gpucache/#gpu-cache","text":"","title":"GPU Cache"},{"location":"gpucache/#overview","text":"GPU has a device memory that is independent of the RAM in the host system, and in order to calculate on the GPU, data must be transferred from the host system or storage device to the GPU device memory once through the PCI-E bus. The same is true when PG-Strom processes SQL queries on the GPU. Internally, the records read from the PostgreSQL table are transferred to the GPU, and then various SQL operations are executed on the GPU. However, these processes take time to read the tables and transfer the data. (In many cases, much longer than the processing on the GPU!) GPU Cache is a function that reserves an area on the GPU device memory in advance and keeps a copy of the PostgreSQL table there. This can be used to execute search/analysis SQL in real time for data that is relatively small(~10GB) and is frequently updated. The log-based synchronization mechanism described below allows GPU Cache to be kept up-to-date without interfering with highly parallel and transactional workloads. Nevertheless, you can process search/analytical SQL workloads on data already loaded on GPU Cache without reading the records from the table again or transferring the data over the PCI-E bus. A typical use case of GPU Cache is to join location data, such as the current position of a mobile device like a car or a cell phone, collected in real time with other data using GPU-PostGIS . The workload of updating location information sent out by many devices is extremely heavy. However, it also needs to be applied on the GPU side without delay in order to perform search/analysis queries based on the latest location information. Although the size is limited, GPU Cache is one option to achieve both high frequency updates and high-performance search/analysis query execution.","title":"Overview"},{"location":"gpucache/#architecture","text":"GPU Caches needs to satisfy two requirements: highly parallel update-based workloads and search/analytical queries on constantly up-to-date data. In many systems, the CPU and GPU are connected via the PCI-E bus, and there is a reasonable delay in their communication. Therefore, synchronizing GPU Cache every time a row is updated in the target table will significantly degrade the transaction performance. Using GPU Cache allocates a \"REDO Log Buffer\" on the shared memory on the host side in addition to the area on the memory of the GPU. When a SQL command (INSERT, UPDATE, DELETE) is executed to update a table, the updated contents are copied to the REDO Log Buffer by the AFTER ROW trigger. Since this process can be completed by CPU and RAM alone without any GPU call, it has little impact on transaction performance. When a certain amount of unapplied REDO Log Entries accumulate in the REDO Log Buffer, or a certain amount of time has passed since the last write, it is loaded by a background worker process (GPU memory keeper) and applied to GPU Cache. At this time, REDO Log Entries are transferred to the GPU in batches and processed in parallel by thousands of processor cores on the GPU, so delays caused by this process are rarely a problem. Search/analysis queries against the target table in GPU Cache do not load the table data, but use the data mapped from GPU Cache pre-allocated on the GPU device memory. If there are any unapplied REDO Logs at the start of the search/analysis query, they will all be applied to GPU Cache. This means that the results of a search/analysis query scanning the target GPU Cache will return the same results as if it were referring to the table directly, and the query will always be consistent.","title":"Architecture"},{"location":"gpucache/#configuration","text":"To enable GPU Cache, configure a trigger that executes pgstrom.gpucache_sync_trigger() function on AFTER INSERT OR UPDATE OR DELETE for each row. If GPU Cache is used on the replication slave, the invocation mode of this trigger must be ALWAYS . Below is an example to configure GPU Cache on the dpoints table. =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; Note Additional configuration at PostgreSQL v12 or prior. In case when GPU Cache is used at PostgreSQL v12 or prior, you need to configure an additional BEFORE TRUNCATE statement trigger that executes pgstrom.gpucache_sync_trigger() function. If you want to use the GPU Cache on the replication slave, If you use GPU Cache at the PostgreSQL v12 or prior, in a similar way, invocation mode of this trigger must have ALWAYS . PostgreSQL v13 enhanced its object-access-hook mechanism, so allows extension modules to capture execution of TRUNCATE without triggers configuration. On the other hand, the prior version still needs the BEFORE TRUNCATE statement trigger to keep consistency of GPU Cache by capture of TRUNCATE. Below is an example to configure GPU Cache on the dpoints table at PostgreSQL v12 or prior. =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# create trigger stmt_sync before truncate on dpoints_even for statement execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; =# alter table dpoints_even enable always trigger stmt_sync;","title":"Configuration"},{"location":"gpucache/#gpu-cache-customize","text":"You can customize GPU Cache by specifying an optional string in the form of KEY=VALUE as an argument to GPU Cache line trigger. Please note that where you should specify is not to the syntax trigger. The following SQL statement is an example of creating a GPU Cache whose maximum row count is 2.5 million rows and the size of the REDO Log Buffer is 100MB. =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger('max_num_rows=2500000,redo_buffer_size=100m'); The options that can be given to the argument of the line trigger are shown below. gpu_device_id=GPU_ID (default: 0) Specify the target GPU device ID to allocate GPU Cache. max_num_rows=NROWS (default: 10485760) Specify the number of rows that can be allocated on GPU Cache. Just as with PostgreSQL tables, GPU Cache needs to retain updated rows prior to commit for visibility control, so max_num_rows should be specified with some margin. Note that the old version of the updated/deleted row will be released after the transaction is committed. redo_buffer_size=SIZE (default: 160m) Specify the size of REDO Log Buffer. You can use k, m and g as the unit. gpu_sync_interval=SECONDS (default: 5) If the specified time has passed since the last write to the REDO Log Buffer, REDO Log will be applied to the GPU, regardless of the number of rows updated. gpu_sync_threshold=SIZE (default: 25% of redo_buffer_size ) When the unapplied REDO Log in the REDO Log Buffer reaches SIZE bytes, it is applied to the GPU side. You can use k, m and g as the unit.","title":"GPU Cache Customize"},{"location":"gpucache/#gpu-cache-options","text":"Below are GPU Cache related PostgreSQL configuration parameters. pg_strom.enable_gpucache (default: on) This option controls whether search/analytical queries will use GPU Cache or not. If this value is off, the data will be read from the table each time, ignoring GPU Cache even if it is available. Note that this setting has no effect on REDO Log Buffer appending by triggers. pg_strom.gpucache_auto_preload (default: NULL) When PostgreSQL is started/restarted, GPU Cache for the table specified by this parameter will be built in advance. The value should be in the format: DATABASE_NAME.SCHEMA_NAME.TABLE_NAME . To specify multiple tables, separate them by commas. If GPU Cache is not built, the PostgreSQL backend process that first attempts to access GPU Cache will scan the entire target table and transfer it to the GPU. This process usually takes a considerable amount of time. However, by specifying the tables that should be loaded in this option, you can avoid waiting too long the first time you run a search/analysis query. If this parameter is set to '*', it will attempt to load the contents of all tables with GPU Cache into the GPU in order. At this time, the background worker will access all the databases in order, and will return exit code 1 to prompt the postmaster to restart. The server startup log will show that the \"GPUCache Startup Preloader\" exited with exit code 1 as follows, but this is not abnormal. LOG: database system is ready to accept connections LOG: background worker \"GPUCache Startup Preloader\" (PID 856418) exited with exit code 1 LOG: background worker \"GPUCache Startup Preloader\" (PID 856427) exited with exit code 1 LOG: create GpuCacheSharedState dpoints:164c95f71 LOG: gpucache: AllocMemory dpoints:164c95f71 (main_sz=772505600, extra_sz=0) LOG: gpucache: auto preload 'public.dpoints' (DB: postgres) LOG: create GpuCacheSharedState mytest:1773a589b LOG: gpucache: auto preload 'public.mytest' (DB: postgres) LOG: gpucache: AllocMemory mytest:1773a589b (main_sz=675028992, extra_sz=0)","title":"GPU Cache Options"},{"location":"gpucache/#operations","text":"","title":"Operations"},{"location":"gpucache/#confirm-gpu-cache-usage","text":"GPU Cache is referred to transparently. The user does not need to be aware of the presence or absence of GPU Cache, and PG-Strom will automatically determine and switch the process. The following is the query plan for a query that refers to the table \"dpoints\" which has GPU Cache set. The 3rd row from the bottom, in the \"GPU Cache\" field, shows the basic information about GPU Cache of this table. We can see that the query is executed with referring to GPU Cache and not the \"dpoints\" table. Note that the meaning of each item is as follows: max_num_rows indicates the maximum number of rows that GPU Cache can hold; main indicates the size of the area in GPU Cache for fixed-length fields; extra indicates the size of the area for variable-length data. =# explain select pref, city, count(*) from giscity g, dpoints d where pref = 'Tokyo' and st_contains(g.geom,st_makepoint(d.x, d.y)) group by pref, city; QUERY PLAN -------------------------------------------------------------------------------------------------------- HashAggregate (cost=5638809.75..5638859.99 rows=5024 width=29) Group Key: g.pref, g.city -> Custom Scan (GpuPreAgg) (cost=5638696.71..5638759.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=631923.57..5606933.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) GPU Cache: NVIDIA Tesla V100-PCIE-16GB [max_num_rows: 12000000, main: 772.51M, extra: 0] -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (16 rows)","title":"Confirm GPU Cache usage"},{"location":"gpucache/#check-status-of-gpu-cache","text":"Use the pgstrom.gpucache_info view to check the current state of GPU Cache. =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | refcnt | corrupted | gpu_main_sz | gpu_extra_sz | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------+------------+--------+-----------+-------------+--------------+----------------------------+-------------------+----------------+------------------+---------------+---------------+------------------------------------------------------------------------------------------------------------------------ 12728 | postgres | 25244 | mytest | 6295279771 | 3 | f | 675028992 | 0 | 2021-05-14 03:00:18.623503 | 500000 | 36000000 | 500000 | 36000000 | 36000000 | gpu_device_id=0,max_num_rows=10485760,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 12728 | postgres | 25262 | dpoints | 5985886065 | 3 | f | 772505600 | 0 | 2021-05-14 03:00:18.524627 | 8000000 | 576000192 | 8000000 | 576000192 | 576000192 | gpu_device_id=0,max_num_rows=12000000,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 (2 rows) Note that pgstrom.gpucache_info will only show the status of GPU Caches that have been initially loaded and have space allocated on the GPU device memory at that time. In other words, if the trigger function is set but not yet initially loaded (no one has accessed it yet), the potentially allocated GPU Cache will not be shown yet. The meaning of each field is as follows: database_oid The OID of the database to which the table with GPU Cache enabled exists. database_name The name of the database to which the table with GPU Cache enabled exists. table_oid The OID of the table with GPU Cache enabled. Note that the database this table exists in is not necessarily the database you are connected to. table_name The name of the table with GPU Cache enabled. Note that the database this table exists in is not necessarily the database you are connected to. signature A hash value indicating the uniqueness of GPU Cache. This value may change, for example, before and after executing ALTER TABLE . refcnt Reference counter of the GPU Cache. It does not always reflect the latest value. corrupted Shows whether the GPU Cache is corrupted. gpu_main_sz The size of the area reserved in GPU Cache for fixed-length data. gpu_extra_sz The size of the area reserved in GPU Cache for variable-length data. redo_write_ts The time when the REDO Log Buffer was last updated. redo_write_nitems The total number of REDO Logs in the REDO Log Buffer. redo_write_pos The total size (in bytes) of the REDO Logs in the REDO Log Buffer. redo_read_nitems The total number of REDO Logs read from the REDO Log Buffer and applied to the GPU. redo_read_pos The total size (in bytes) of REDO Logs read from the REDO Log Buffer and applied to the GPU. redo_sync_pos The position of the REDO Log which is scheduled to be applied to GPU Cache by the background worker on the REDO Log Buffer. This is used internally to avoid a situation where many sessions generate asynchronous requests at the same time when the remaining REDO Log Buffer is running out. config_options The optional string to customize GPU Cache.","title":"Check status of GPU Cache"},{"location":"gpucache/#gpu-cache-corruption-and-recovery","text":"If and when REDO logs could not be applied on the GPU cache by some reasons, like insertion of more rows than the max_num_rows configuration, or too much consumption of variable-length data buffer, GPU cache moves to the \"corrupted\" state. Once GPU cache gets corrupted, search/analysis SQL does not reference the GPU cache, and table updates stops writing REDO log. (If GPU cache gets corrupted after beginning of a search/analysis SQL unfortunately, this query may raise an error.) The pgstrom.gpucache_recovery(regclass) function recovers the GPU cache from the corrupted state. If you run this function after removal of the cause where REDO logs could not be applied, it runs initial-loading of the GPU cache again, then tries to recover the GPU cache. For example, if GPU cache gets corrupted because you tried to insert more rows than the max_num_rows , you reconfigure the trigger with expanded max_num_rows configuration or you delete a part of rows from the table, then runs pgstrom.gpucache_recovery() function.","title":"GPU Cache corruption and recovery"},{"location":"install/","text":"Installation This chapter introduces the steps to install PG-Strom. Checklist Server Hardware It requires generic x86_64 hardware that can run Linux operating system supported by CUDA Toolkit. We have no special requirement for CPU, storage and network devices. note002:HW Validation List may help you to choose the hardware. GPU Direct SQL Execution needs NVME-SSD devices, or fast network card with RoCE support, and to be installed under the same PCIe Root Complex where GPU is located on. GPU Device PG-Strom requires at least one GPU device on the system, which is supported by CUDA Toolkit, has computing capability 6.0 (Pascal generation) or later; Please check at 002: HW Validation List - List of supported GPU models for GPU selection. Operating System PG-Strom requires Linux operating system for x86_64 architecture, and its distribution supported by CUDA Toolkit. Our recommendation is Red Hat Enterprise Linux or Rocky Linux version 8.x series. GPU Direct SQL (with cuFile driver) needs the nvidia-fs driver distributed with CUDA Toolkit, and Mellanox OFED (OpenFabrics Enterprise Distribution) driver. PostgreSQL PG-Strom v5.0 requires PostgreSQL v15 or later. Some of PostgreSQL APIs used by PG-Strom internally are not included in the former versions. CUDA Toolkit PG-Strom requires CUDA Toolkit version 12.2update2 or later. Some of CUDA Driver APIs used by PG-Strom internally are not included in the former versions. Steps to Install The overall steps to install are below: Hardware Configuration OS Installation MOFED Driver installation CUDA Toolkit installation HeteroDB Extra Module installation PostgreSQL installation PG-Strom installation PostgreSQL Extensions installation PostGIS contrib/cube OS Installation Choose a Linux distribution which is supported by CUDA Toolkit, then install the system according to the installation process of the distribution. NVIDIA DEVELOPER ZONE introduces the list of Linux distributions which are supported by CUDA Toolkit. In case of Red Hat Enterprise Linux 8.x series (including Rocky Linux 8.x series), choose \"Minimal installation\" as base environment, and also check the \"Development Tools\" add-ons for the software selection Next to the OS installation on the server, go on the package repository configuration to install the third-party packages. If you didn't check the \"Development Tools\" at the installer, we can additionally install the software using the command below after the operating system installation. # dnf groupinstall 'Development Tools' Tip If GPU devices installed on the server are too new, it may cause system crash during system boot. In this case, you may avoid the problem by adding nouveau.modeset=0 onto the kernel boot option, to disable the inbox graphic driver. Disables nouveau driver When the nouveau driver, that is an open source compatible driver for NVIDIA GPUs, is loaded, it prevent to load the nvidia driver. In this case, reboot the operating system after a configuration to disable the nouveau driver. To disable the nouveau driver, put the following configuration onto /etc/modprobe.d/disable-nouveau.conf , and run dracut command to apply them on the boot image of Linux kernel. Then, restart the system once. # cat > /etc/modprobe.d/disable-nouveau.conf </extra/mlnx-nvme/host/nvme-rdma.ko that is additionally installed, instead of the INBOX nvme-rdma ( /lib/modules//kernel/drivers/nvme/host/nvme-rdma.ko.xz ). $ modinfo nvme-rdma filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/mlnx-nvme/host/nvme-rdma.ko license: GPL v2 rhelversion: 9.4 srcversion: 16C0049F26768D6EA12771B depends: nvme-core,rdma_cm,ib_core,nvme-fabrics,mlx_compat retpoline: Y name: nvme_rdma vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions parm: register_always:Use memory registration even for contiguous memory regions (bool) Then, shutdown the system and restart, to replace the kernel modules already loaded (like nvme ). Please don't forget to run dracut -f after completion of the mlnxofedinstall script. Tips Linux kernel version up and MOFED driver MODED drivers do not use DKMS (Dynamic Kernel Module Support) in RHEL series distributions. Therefore, when the Linux kernel is upgraded, you will need to perform the above steps again to reinstall the MOFED driver that is compatible with the new Linux kernel. The Linux kernel may be updated together when another package is updated, such as when installing the CUDA Toolkit described below, but the same applies in that case. heterodb-swdc Installation PG-Strom and related packages are distributed from HeteroDB Software Distribution Center . You need to add a repository definition of HeteroDB-SWDC for you system to obtain these software. heterodb-swdc package provides the repository definition of HeteroDB-SWDC. Access to the HeteroDB Software Distribution Center using Web browser, download the heterodb-swdc-1.3-1.el9.noarch.rpm on top of the file list, then install this package. (Use heterodb-swdc-1.3-1.el8.noarch.rpm for RHEL8) Once heterodb-swdc package gets installed, yum system configuration is updated to get software from the HeteroDB-SWDC repository. Install the heterodb-swdc package as follows. # dnf install https://heterodb.github.io/swdc/yum/rhel8-noarch/heterodb-swdc-1.2-1.el8.noarch.rpm CUDA Toolkit Installation This section introduces the installation of CUDA Toolkit. If you already installed the latest CUDA Toolkit, you can check whether your installation is identical with the configuration described in this section. NVIDIA offers two approach to install CUDA Toolkit; one is by self-extracting archive (runfile), and the other is by RPM packages. We recommend the RPM installation for PG-Strom setup. You can download the installation package for CUDA Toolkit from NVIDIA DEVELOPER ZONE. Choose your OS, architecture, distribution and version, then choose \"rpm(network)\" edition. Once you choose the \"rpm(network)\" option, it shows a few step-by-step shell commands to register the CUDA repository and install the packages. Run the installation according to the guidance. # dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo # dnf clean all # dnf install cuda-toolkit-12-5 Next to the installation of the CUDA Toolkit, two types of commands are introduced to install the nvidia driver. Please use the open source version of nvidia-driver here. Only the open source version supports the GPUDirect Storage feature, and PG-Strom's GPU-Direct SQL utilizes this feature. Tips Use of Volta or former GPUs The open source edition of the nvidia driver does not support Volta generation GPUs or former. Therefore, if you want to use PG-Strom with Volta or Pascal generation GPUs, you need to use CUDA 12.2, whose proprietary driver supports GPUDirect Storage. The CUDA 12.2 package can be obtained here . Next, install the driver module nvidia-gds for the GPU-Direct Storage (GDS). Please specify the same version name as the CUDA Toolkit version after the package name. # dnf module install nvidia-driver:open-dkms # dnf install nvidia-gds-12-5 Once installation completed successfully, CUDA Toolkit is deployed at /usr/local/cuda . $ ls /usr/local/cuda/ bin/ gds/ nsightee_plugins/ targets/ compute-sanitizer/ include@ nvml/ tools/ CUDA_Toolkit_Release_Notes.txt lib64@ nvvm/ version.json DOCS libnvvp/ README EULA.txt LICENSE share/ extras/ man/ src/ Once installation gets completed, ensure the system recognizes the GPU devices correctly. nvidia-smi command shows GPU information installed on your system, as follows. $ nvidia-smi Mon Jun 3 09:56:41 2024 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 555.42.02 Driver Version: 555.42.02 CUDA Version: 12.5 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA A100-PCIE-40GB Off | 00000000:41:00.0 Off | 0 | | N/A 58C P0 66W / 250W | 1MiB / 40960MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+ Check GPUDirect Storage status After the installation of CUDA Toolkit according to the steps above, your system will become ready for the GPUDirect Storage. Run gdscheck tool to confirm the configuration for each storage devices, as follows. (Thie example loads not only nvme , but nvme-rdma and rpcrdma kernel modules also, therefore, it reports the related features as Supported ) # /usr/local/cuda/gds/tools/gdscheck -p GDS release version: 1.10.0.4 nvidia_fs version: 2.20 libcufile version: 2.12 Platform: x86_64 ============ ENVIRONMENT: ============ ===================== DRIVER CONFIGURATION: ===================== NVMe : Supported NVMeOF : Supported SCSI : Unsupported ScaleFlux CSD : Unsupported NVMesh : Unsupported DDN EXAScaler : Unsupported IBM Spectrum Scale : Unsupported NFS : Supported BeeGFS : Unsupported WekaFS : Unsupported Userspace RDMA : Unsupported --Mellanox PeerDirect : Disabled --rdma library : Not Loaded (libcufile_rdma.so) --rdma devices : Not configured --rdma_device_status : Up: 0 Down: 0 ===================== CUFILE CONFIGURATION: ===================== properties.use_compat_mode : true properties.force_compat_mode : false properties.gds_rdma_write_support : true properties.use_poll_mode : false properties.poll_mode_max_size_kb : 4 properties.max_batch_io_size : 128 properties.max_batch_io_timeout_msecs : 5 properties.max_direct_io_size_kb : 16384 properties.max_device_cache_size_kb : 131072 properties.max_device_pinned_mem_size_kb : 33554432 properties.posix_pool_slab_size_kb : 4 1024 16384 properties.posix_pool_slab_count : 128 64 32 properties.rdma_peer_affinity_policy : RoundRobin properties.rdma_dynamic_routing : 0 fs.generic.posix_unaligned_writes : false fs.lustre.posix_gds_min_kb: 0 fs.beegfs.posix_gds_min_kb: 0 fs.weka.rdma_write_support: false fs.gpfs.gds_write_support: false profile.nvtx : false profile.cufile_stats : 0 miscellaneous.api_check_aggressive : false execution.max_io_threads : 4 execution.max_io_queue_depth : 128 execution.parallel_io : true execution.min_io_threshold_size_kb : 8192 execution.max_request_parallelism : 4 properties.force_odirect_mode : false properties.prefer_iouring : false ========= GPU INFO: ========= GPU index 0 NVIDIA A100-PCIE-40GB bar:1 bar size (MiB):65536 supports GDS, IOMMU State: Disabled ============== PLATFORM INFO: ============== IOMMU: disabled Nvidia Driver Info Status: Supported(Nvidia Open Driver Installed) Cuda Driver Version Installed: 12050 Platform: AS -2014CS-TR, Arch: x86_64(Linux 5.14.0-427.18.1.el9_4.x86_64) Platform verification succeeded Tips Additional configuration for RAID volume For data reading from software RAID (md-raid0) volumes by GPUDirect Storage, the following line must be added to the /lib/udev/rules.d/63-md-raid-arrays.rules configuration file. IMPORT{\u200bprogram}=\"/usr/sbin/mdadm --detail --export $devnode\" Then reboot the system to ensure the new configuration. See NVIDIA GPUDirect Storage Installation and Troubleshooting Guide for the details. PCI Bar1 Memory Configuration GPU-Direct SQL maps GPU device memory to the PCI BAR1 region (physical address space) on the host system, and sends P2P-RDMA requests to NVME devices with that as the destination for the shortest data transfer. To perform P2P-RDMA with sufficient multiplicity, the GPU must have enough PCI BAR1 space to map the device buffer. The size of the PCI BAR1 area is fixed for most GPUs, and PG-Strom recommends products whose size exceeds the GPU device memory size. However, some GPU products allow to change the size of the PCI BAR1 area by switching the operation mode. If your GPU is either of the following, refer to the NVIDIA Display Mode Selector Tool and switch to the mode that maximizes the PCI BAR1 area size. NVIDIA L40S NVIDIA L40 NVIDIA A40 NVIDIA RTX 6000 Ada NVIDIA RTX A6000 NVIDIA RTX A5500 NVIDIA RTX A5000 To check the GPU memory size and PCI BAR1 size installed in the system, use the nvidia-smi -q command. Memory-related status is displayed as shown below. $ nvidia-smi -q : FB Memory Usage Total : 46068 MiB Reserved : 685 MiB Used : 4 MiB Free : 45377 MiB BAR1 Memory Usage Total : 65536 MiB Used : 1 MiB Free : 65535 MiB : HeteroDB extra modules heterodb-extra module enhances PG-Strom the following features. multi-GPUs support GPUDirect SQL GiST index support on GPU License management If you don't use the above features, only open source modules, you don't need to install the heterodb-extra module here. Please skip this section. Install the heterodb-extra package, downloaded from the SWDC, as follows. # dnf install heterodb-extra License activation License activation is needed to use all the features of heterodb-extra , provided by HeteroDB,Inc. You can operate the system without license, but features below are restricted. Multiple GPUs support Striping of NVME-SSD drives (md-raid0) on GPUDirect SQL Support of NVME-oF device on GPUDirect SQL Support of GiST index on GPU-version of PostGIS workloads You can obtain a license file, like as a plain text below, from HeteroDB,Inc. IAgIVdKxhe+BSer3Y67jQW0+uTzYh00K6WOSH7xQ26Qcw8aeUNYqJB9YcKJTJb+QQhjmUeQpUnboNxVwLCd3HFuLXeBWMKp11/BgG0FSrkUWu/ZCtDtw0F1hEIUY7m767zAGV8y+i7BuNXGJFvRlAkxdVO3/K47ocIgoVkuzBfLvN/h9LffOydUnHPzrFHfLc0r3nNNgtyTrfvoZiXegkGM9GBTAKyq8uWu/OGonh9ybzVKOgofhDLk0rVbLohOXDhMlwDl2oMGIr83tIpCWG+BGE+TDwsJ4n71Sv6n4bi/ZBXBS498qShNHDGrbz6cNcDVBa+EuZc6HzZoF6UrljEcl= ---- VERSION:2 SERIAL_NR:HDB-TRIAL ISSUED_AT:2019-05-09 EXPIRED_AT:2019-06-08 GPU_UUID:GPU-a137b1df-53c9-197f-2801-f2dccaf9d42f Copy the license file to /etc/heterodb.license , then restart PostgreSQL. The startup log messages of PostgreSQL dumps the license information, and it tells us the license activation is successfully done. : LOG: HeteroDB Extra module loaded [api_version=20231105,cufile=on,nvme_strom=off,githash=9ca2fe4d2fbb795ad2d741dcfcb9f2fe499a5bdf] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2022-11-19\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} LOG: PG-Strom version 5.0.1 built for PostgreSQL 15 (githash: 972441dbafed6679af86af40bc8613be2d73c4fd) : PostgreSQL Installation This section introduces PostgreSQL installation with RPM. We don't introduce the installation steps from the source because there are many documents for this approach, and there are also various options for the ./configure script. PostgreSQL is also distributed in the packages of Linux distributions, however, it is not the latest one, and often older than the version which supports PG-Strom. For example, Red Hat Enterprise Linux 7.x distributes PostgreSQL v9.2.x series. This version had been EOL by the PostgreSQL community. PostgreSQL Global Development Group provides yum repository to distribute the latest PostgreSQL and related packages. Like the configuration of EPEL, you can install a small package to set up yum repository, then install PostgreSQL and related software. Here is the list of yum repository definition: http://yum.postgresql.org/repopackages.php . Repository definitions are per PostgreSQL major version and Linux distribution. You need to choose the one for your Linux distribution, and for PostgreSQL v15 or later. You can install PostgreSQL as following steps: Installation of yum repository definition. Disables the distribution's default PostgreSQL module Installation of PostgreSQL packages. # dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm # dnf -y module disable postgresql # dnf install -y postgresql16-devel postgresql16-server Note On the Red Hat Enterprise Linux, the package name postgresql conflicts to the default one at the distribution, thus, unable to install the packages from PGDG. So, disable the postgresql module by the distribution, using dnf -y module disable postgresql . PG-Strom Installation RPM Installation PG-Strom and related packages are distributed from HeteroDB Software Distribution Center . If you repository definition has been added, not many tasks are needed. We provide individual RPM packages of PG-Strom for each PostgreSQL major version. pg_strom-PG15 package is built for PostgreSQL v15, and pg_strom-PG16 is also built for PostgreSQL v16. It is a restriction due to binary compatibility of extension modules for PostgreSQL. # dnf install -y pg_strom-PG16 That's all for package installation. Installation from the source For developers, we also introduces the steps to build and install PG-Strom from the source code. Getting the source code Like RPM packages, you can download tarball of the source code from HeteroDB Software Distribution Center . On the other hands, here is a certain time-lags to release the tarball, it may be preferable to checkout the master branch of PG-Strom on GitHub to use the latest development branch. $ git clone https://github.com/heterodb/pg-strom.git Cloning into 'pg-strom'... remote: Counting objects: 13797, done. remote: Compressing objects: 100% (215/215), done. remote: Total 13797 (delta 208), reused 339 (delta 167), pack-reused 13400 Receiving objects: 100% (13797/13797), 11.81 MiB | 1.76 MiB/s, done. Resolving deltas: 100% (10504/10504), done. Building the PG-Strom Configuration to build PG-Strom must match to the target PostgreSQL strictly. For example, if a particular strcut has inconsistent layout by the configuration at build, it may lead problematic bugs; not easy to find out. Thus, not to have inconsistency, PG-Strom does not have own configure script, but references the build configuration of PostgreSQL using pg_config command. If PATH environment variable is set to the pg_config command of the target PostgreSQL, run make and make install . Elsewhere, give PG_CONFIG=... parameter on make command to tell the full path of the pg_config command. $ cd pg-strom/src $ make PG_CONFIG=/usr/pgsql-16/bin/pg_config $ sudo make install PG_CONFIG=/usr/pgsql-16/bin/pg_config Post Installation Setup Creation of database cluster Database cluster is not constructed yet, run initdb command to set up initial database of PostgreSQL. The default path of the database cluster on RPM installation is /var/lib/pgsql//data . If you install postgresql-alternatives package, this default path can be referenced by /var/lib/pgdata regardless of the PostgreSQL version. # su - postgres $ /usr/pgsql-16/bin/initdb -D /var/lib/pgdata/ The files belonging to this database system will be owned by user \"postgres\". This user must also own the server process. The database cluster will be initialized with locale \"en_US.UTF-8\". The default database encoding has accordingly been set to \"UTF8\". The default text search configuration will be set to \"english\". Data page checksums are disabled. fixing permissions on existing directory /var/lib/pgdata ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Tokyo creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling \"trust\" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D /var/lib/pgdata/ -l logfile start Setup postgresql.conf Next, edit postgresql.conf which is a configuration file of PostgreSQL. The parameters below should be edited at least to work PG-Strom. Investigate other parameters according to usage of the system and expected workloads. shared_preload_libraries PG-Strom module must be loaded on startup of the postmaster process by the shared_preload_libraries . Unable to load it on demand. Therefore, you must add the configuration below. shared_preload_libraries = '$libdir/pg_strom' max_worker_processes PG-Strom internally uses several background workers, so the default configuration (= 8) is too small for other usage. So, we recommand to expand the variable for a certain margin. max_worker_processes = 100 shared_buffers Although it depends on the workloads, the initial configuration of shared_buffers is too small for the data size where PG-Strom tries to work, thus storage workloads restricts the entire performance, and may be unable to work GPU efficiently. So, we recommend to expand the variable for a certain margin. shared_buffers = 10GB Please consider to apply SSD-to-GPU Direct SQL Execution to process larger than system's physical RAM size. work_mem Although it depends on the workloads, the initial configuration of work_mem is too small to choose the optimal query execution plan on analytic queries. An typical example is, disk-based merge sort may be chosen instead of the in-memory quick-sorting. So, we recommend to expand the variable for a certain margin. work_mem = 1GB Expand OS resource limits GPU Direct SQL especially tries to open many files simultaneously, so resource limit for number of file descriptors per process should be expanded. Also, we recommend not to limit core file size to generate core dump of PostgreSQL certainly on system crash. If PostgreSQL service is launched by systemd, you can put the configurations of resource limit at /etc/systemd/system/postgresql-XX.service.d/pg_strom.conf . RPM installation setups the configuration below by the default. It comments out configuration to the environment variable CUDA_ENABLE_COREDUMP_ON_EXCEPTION . This is a developer option that enables to generate GPU's core dump on any CUDA/GPU level errors, if enabled. See CUDA-GDB:GPU core dump support for more details. [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1 Start PostgreSQL Start PostgreSQL service. If PG-Strom is set up appropriately, it writes out log message which shows PG-Strom recognized GPU devices. The example below recognized two NVIDIA A100 (PCIE; 40GB), and displays the closest GPU identifier foe each NVME-SSD drive. # systemctl start postgresql-16 # journalctl -u postgresql-16 Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB Extra module loaded [api_version=20240418,cufile=off,nvme_strom=off,githash=3ffc65428c07bb3c9d0e5c75a2973389f91dfcd4] Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2024-06-02\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: PG-Strom version 5.12.el9 built for PostgreSQL 16 (githash: ) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom binary built for CUDA 12.4 (CUDA runtime 12.5) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] WARNING: The CUDA version where this PG-Strom module binary was built for (12.4) is newer than the CUDA runtime version on this platform (12.5). It may lead unexpected behavior, and upgrade of CUDA toolkit is recommended. Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78979c134606) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:81:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:82:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c2:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c6:00:0] nvme4 (Corsair MP600 CORE) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c3:00:0] nvme5 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c1:00:0] nvme0 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c4:00:0] nvme2 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] LOG: redirecting log output to logging collector process Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] HINT: Future log output will appear in directory \"log\". Jun 02 17:28:48 buri.heterodb.com systemd[1]: Started PostgreSQL 16 database server. Creation of PG-Strom Extension At the last, create database objects related to PG-Strom, like SQL functions. This steps are packaged using EXTENSION feature of PostgreSQL. So, all you needs to run is CREATE EXTENSION on the SQL command line. Please note that this step is needed for each new database. If you want PG-Strom is pre-configured on new database creation, you can create PG-Strom extension on the template1 database, its configuration will be copied to the new database on CREATE DATABASE command. $ psql -U postgres psql (16.3) Type \"help\" for help. postgres=# CREATE EXTENSION pg_strom ; CREATE EXTENSION That's all for the installation. PostGIS Installation PG-Strom supports execution of a part of PostGIS functions on GPU devices. This section introduces the steps to install PostGIS module. Skip it on your demand. PostGIS module can be installed from the yum repository by PostgreSQL Global Development Group, like PostgreSQL itself. The example below shows the command to install PostGIS v3.4 built for PostgreSQL v16. # dnf install postgis34_16 Start PostgreSQL server after the initial setup of database cluster, then run CREATE EXTENSION command from SQL client to define geometry data type and SQL functions for geoanalytics. postgres=# CREATE EXTENSION postgis; CREATE EXTENSION","title":"Install"},{"location":"install/#installation","text":"This chapter introduces the steps to install PG-Strom.","title":"Installation"},{"location":"install/#checklist","text":"Server Hardware It requires generic x86_64 hardware that can run Linux operating system supported by CUDA Toolkit. We have no special requirement for CPU, storage and network devices. note002:HW Validation List may help you to choose the hardware. GPU Direct SQL Execution needs NVME-SSD devices, or fast network card with RoCE support, and to be installed under the same PCIe Root Complex where GPU is located on. GPU Device PG-Strom requires at least one GPU device on the system, which is supported by CUDA Toolkit, has computing capability 6.0 (Pascal generation) or later; Please check at 002: HW Validation List - List of supported GPU models for GPU selection. Operating System PG-Strom requires Linux operating system for x86_64 architecture, and its distribution supported by CUDA Toolkit. Our recommendation is Red Hat Enterprise Linux or Rocky Linux version 8.x series. GPU Direct SQL (with cuFile driver) needs the nvidia-fs driver distributed with CUDA Toolkit, and Mellanox OFED (OpenFabrics Enterprise Distribution) driver. PostgreSQL PG-Strom v5.0 requires PostgreSQL v15 or later. Some of PostgreSQL APIs used by PG-Strom internally are not included in the former versions. CUDA Toolkit PG-Strom requires CUDA Toolkit version 12.2update2 or later. Some of CUDA Driver APIs used by PG-Strom internally are not included in the former versions.","title":"Checklist"},{"location":"install/#steps-to-install","text":"The overall steps to install are below: Hardware Configuration OS Installation MOFED Driver installation CUDA Toolkit installation HeteroDB Extra Module installation PostgreSQL installation PG-Strom installation PostgreSQL Extensions installation PostGIS contrib/cube","title":"Steps to Install"},{"location":"install/#os-installation","text":"Choose a Linux distribution which is supported by CUDA Toolkit, then install the system according to the installation process of the distribution. NVIDIA DEVELOPER ZONE introduces the list of Linux distributions which are supported by CUDA Toolkit. In case of Red Hat Enterprise Linux 8.x series (including Rocky Linux 8.x series), choose \"Minimal installation\" as base environment, and also check the \"Development Tools\" add-ons for the software selection Next to the OS installation on the server, go on the package repository configuration to install the third-party packages. If you didn't check the \"Development Tools\" at the installer, we can additionally install the software using the command below after the operating system installation. # dnf groupinstall 'Development Tools' Tip If GPU devices installed on the server are too new, it may cause system crash during system boot. In this case, you may avoid the problem by adding nouveau.modeset=0 onto the kernel boot option, to disable the inbox graphic driver.","title":"OS Installation"},{"location":"install/#disables-nouveau-driver","text":"When the nouveau driver, that is an open source compatible driver for NVIDIA GPUs, is loaded, it prevent to load the nvidia driver. In this case, reboot the operating system after a configuration to disable the nouveau driver. To disable the nouveau driver, put the following configuration onto /etc/modprobe.d/disable-nouveau.conf , and run dracut command to apply them on the boot image of Linux kernel. Then, restart the system once. # cat > /etc/modprobe.d/disable-nouveau.conf </extra/mlnx-nvme/host/nvme-rdma.ko that is additionally installed, instead of the INBOX nvme-rdma ( /lib/modules//kernel/drivers/nvme/host/nvme-rdma.ko.xz ). $ modinfo nvme-rdma filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/mlnx-nvme/host/nvme-rdma.ko license: GPL v2 rhelversion: 9.4 srcversion: 16C0049F26768D6EA12771B depends: nvme-core,rdma_cm,ib_core,nvme-fabrics,mlx_compat retpoline: Y name: nvme_rdma vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions parm: register_always:Use memory registration even for contiguous memory regions (bool) Then, shutdown the system and restart, to replace the kernel modules already loaded (like nvme ). Please don't forget to run dracut -f after completion of the mlnxofedinstall script. Tips Linux kernel version up and MOFED driver MODED drivers do not use DKMS (Dynamic Kernel Module Support) in RHEL series distributions. Therefore, when the Linux kernel is upgraded, you will need to perform the above steps again to reinstall the MOFED driver that is compatible with the new Linux kernel. The Linux kernel may be updated together when another package is updated, such as when installing the CUDA Toolkit described below, but the same applies in that case.","title":"MOFED Driver Installation"},{"location":"install/#heterodb-swdc-installation","text":"PG-Strom and related packages are distributed from HeteroDB Software Distribution Center . You need to add a repository definition of HeteroDB-SWDC for you system to obtain these software. heterodb-swdc package provides the repository definition of HeteroDB-SWDC. Access to the HeteroDB Software Distribution Center using Web browser, download the heterodb-swdc-1.3-1.el9.noarch.rpm on top of the file list, then install this package. (Use heterodb-swdc-1.3-1.el8.noarch.rpm for RHEL8) Once heterodb-swdc package gets installed, yum system configuration is updated to get software from the HeteroDB-SWDC repository. Install the heterodb-swdc package as follows. # dnf install https://heterodb.github.io/swdc/yum/rhel8-noarch/heterodb-swdc-1.2-1.el8.noarch.rpm","title":"heterodb-swdc Installation"},{"location":"install/#cuda-toolkit-installation","text":"This section introduces the installation of CUDA Toolkit. If you already installed the latest CUDA Toolkit, you can check whether your installation is identical with the configuration described in this section. NVIDIA offers two approach to install CUDA Toolkit; one is by self-extracting archive (runfile), and the other is by RPM packages. We recommend the RPM installation for PG-Strom setup. You can download the installation package for CUDA Toolkit from NVIDIA DEVELOPER ZONE. Choose your OS, architecture, distribution and version, then choose \"rpm(network)\" edition. Once you choose the \"rpm(network)\" option, it shows a few step-by-step shell commands to register the CUDA repository and install the packages. Run the installation according to the guidance. # dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo # dnf clean all # dnf install cuda-toolkit-12-5 Next to the installation of the CUDA Toolkit, two types of commands are introduced to install the nvidia driver. Please use the open source version of nvidia-driver here. Only the open source version supports the GPUDirect Storage feature, and PG-Strom's GPU-Direct SQL utilizes this feature. Tips Use of Volta or former GPUs The open source edition of the nvidia driver does not support Volta generation GPUs or former. Therefore, if you want to use PG-Strom with Volta or Pascal generation GPUs, you need to use CUDA 12.2, whose proprietary driver supports GPUDirect Storage. The CUDA 12.2 package can be obtained here . Next, install the driver module nvidia-gds for the GPU-Direct Storage (GDS). Please specify the same version name as the CUDA Toolkit version after the package name. # dnf module install nvidia-driver:open-dkms # dnf install nvidia-gds-12-5 Once installation completed successfully, CUDA Toolkit is deployed at /usr/local/cuda . $ ls /usr/local/cuda/ bin/ gds/ nsightee_plugins/ targets/ compute-sanitizer/ include@ nvml/ tools/ CUDA_Toolkit_Release_Notes.txt lib64@ nvvm/ version.json DOCS libnvvp/ README EULA.txt LICENSE share/ extras/ man/ src/ Once installation gets completed, ensure the system recognizes the GPU devices correctly. nvidia-smi command shows GPU information installed on your system, as follows. $ nvidia-smi Mon Jun 3 09:56:41 2024 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 555.42.02 Driver Version: 555.42.02 CUDA Version: 12.5 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA A100-PCIE-40GB Off | 00000000:41:00.0 Off | 0 | | N/A 58C P0 66W / 250W | 1MiB / 40960MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+","title":"CUDA Toolkit Installation"},{"location":"install/#check-gpudirect-storage-status","text":"After the installation of CUDA Toolkit according to the steps above, your system will become ready for the GPUDirect Storage. Run gdscheck tool to confirm the configuration for each storage devices, as follows. (Thie example loads not only nvme , but nvme-rdma and rpcrdma kernel modules also, therefore, it reports the related features as Supported ) # /usr/local/cuda/gds/tools/gdscheck -p GDS release version: 1.10.0.4 nvidia_fs version: 2.20 libcufile version: 2.12 Platform: x86_64 ============ ENVIRONMENT: ============ ===================== DRIVER CONFIGURATION: ===================== NVMe : Supported NVMeOF : Supported SCSI : Unsupported ScaleFlux CSD : Unsupported NVMesh : Unsupported DDN EXAScaler : Unsupported IBM Spectrum Scale : Unsupported NFS : Supported BeeGFS : Unsupported WekaFS : Unsupported Userspace RDMA : Unsupported --Mellanox PeerDirect : Disabled --rdma library : Not Loaded (libcufile_rdma.so) --rdma devices : Not configured --rdma_device_status : Up: 0 Down: 0 ===================== CUFILE CONFIGURATION: ===================== properties.use_compat_mode : true properties.force_compat_mode : false properties.gds_rdma_write_support : true properties.use_poll_mode : false properties.poll_mode_max_size_kb : 4 properties.max_batch_io_size : 128 properties.max_batch_io_timeout_msecs : 5 properties.max_direct_io_size_kb : 16384 properties.max_device_cache_size_kb : 131072 properties.max_device_pinned_mem_size_kb : 33554432 properties.posix_pool_slab_size_kb : 4 1024 16384 properties.posix_pool_slab_count : 128 64 32 properties.rdma_peer_affinity_policy : RoundRobin properties.rdma_dynamic_routing : 0 fs.generic.posix_unaligned_writes : false fs.lustre.posix_gds_min_kb: 0 fs.beegfs.posix_gds_min_kb: 0 fs.weka.rdma_write_support: false fs.gpfs.gds_write_support: false profile.nvtx : false profile.cufile_stats : 0 miscellaneous.api_check_aggressive : false execution.max_io_threads : 4 execution.max_io_queue_depth : 128 execution.parallel_io : true execution.min_io_threshold_size_kb : 8192 execution.max_request_parallelism : 4 properties.force_odirect_mode : false properties.prefer_iouring : false ========= GPU INFO: ========= GPU index 0 NVIDIA A100-PCIE-40GB bar:1 bar size (MiB):65536 supports GDS, IOMMU State: Disabled ============== PLATFORM INFO: ============== IOMMU: disabled Nvidia Driver Info Status: Supported(Nvidia Open Driver Installed) Cuda Driver Version Installed: 12050 Platform: AS -2014CS-TR, Arch: x86_64(Linux 5.14.0-427.18.1.el9_4.x86_64) Platform verification succeeded Tips Additional configuration for RAID volume For data reading from software RAID (md-raid0) volumes by GPUDirect Storage, the following line must be added to the /lib/udev/rules.d/63-md-raid-arrays.rules configuration file. IMPORT{\u200bprogram}=\"/usr/sbin/mdadm --detail --export $devnode\" Then reboot the system to ensure the new configuration. See NVIDIA GPUDirect Storage Installation and Troubleshooting Guide for the details.","title":"Check GPUDirect Storage status"},{"location":"install/#pci-bar1-memory-configuration","text":"GPU-Direct SQL maps GPU device memory to the PCI BAR1 region (physical address space) on the host system, and sends P2P-RDMA requests to NVME devices with that as the destination for the shortest data transfer. To perform P2P-RDMA with sufficient multiplicity, the GPU must have enough PCI BAR1 space to map the device buffer. The size of the PCI BAR1 area is fixed for most GPUs, and PG-Strom recommends products whose size exceeds the GPU device memory size. However, some GPU products allow to change the size of the PCI BAR1 area by switching the operation mode. If your GPU is either of the following, refer to the NVIDIA Display Mode Selector Tool and switch to the mode that maximizes the PCI BAR1 area size. NVIDIA L40S NVIDIA L40 NVIDIA A40 NVIDIA RTX 6000 Ada NVIDIA RTX A6000 NVIDIA RTX A5500 NVIDIA RTX A5000 To check the GPU memory size and PCI BAR1 size installed in the system, use the nvidia-smi -q command. Memory-related status is displayed as shown below. $ nvidia-smi -q : FB Memory Usage Total : 46068 MiB Reserved : 685 MiB Used : 4 MiB Free : 45377 MiB BAR1 Memory Usage Total : 65536 MiB Used : 1 MiB Free : 65535 MiB :","title":"PCI Bar1 Memory Configuration"},{"location":"install/#heterodb-extra-modules","text":"heterodb-extra module enhances PG-Strom the following features. multi-GPUs support GPUDirect SQL GiST index support on GPU License management If you don't use the above features, only open source modules, you don't need to install the heterodb-extra module here. Please skip this section. Install the heterodb-extra package, downloaded from the SWDC, as follows. # dnf install heterodb-extra","title":"HeteroDB extra modules"},{"location":"install/#license-activation","text":"License activation is needed to use all the features of heterodb-extra , provided by HeteroDB,Inc. You can operate the system without license, but features below are restricted. Multiple GPUs support Striping of NVME-SSD drives (md-raid0) on GPUDirect SQL Support of NVME-oF device on GPUDirect SQL Support of GiST index on GPU-version of PostGIS workloads You can obtain a license file, like as a plain text below, from HeteroDB,Inc. IAgIVdKxhe+BSer3Y67jQW0+uTzYh00K6WOSH7xQ26Qcw8aeUNYqJB9YcKJTJb+QQhjmUeQpUnboNxVwLCd3HFuLXeBWMKp11/BgG0FSrkUWu/ZCtDtw0F1hEIUY7m767zAGV8y+i7BuNXGJFvRlAkxdVO3/K47ocIgoVkuzBfLvN/h9LffOydUnHPzrFHfLc0r3nNNgtyTrfvoZiXegkGM9GBTAKyq8uWu/OGonh9ybzVKOgofhDLk0rVbLohOXDhMlwDl2oMGIr83tIpCWG+BGE+TDwsJ4n71Sv6n4bi/ZBXBS498qShNHDGrbz6cNcDVBa+EuZc6HzZoF6UrljEcl= ---- VERSION:2 SERIAL_NR:HDB-TRIAL ISSUED_AT:2019-05-09 EXPIRED_AT:2019-06-08 GPU_UUID:GPU-a137b1df-53c9-197f-2801-f2dccaf9d42f Copy the license file to /etc/heterodb.license , then restart PostgreSQL. The startup log messages of PostgreSQL dumps the license information, and it tells us the license activation is successfully done. : LOG: HeteroDB Extra module loaded [api_version=20231105,cufile=on,nvme_strom=off,githash=9ca2fe4d2fbb795ad2d741dcfcb9f2fe499a5bdf] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2022-11-19\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} LOG: PG-Strom version 5.0.1 built for PostgreSQL 15 (githash: 972441dbafed6679af86af40bc8613be2d73c4fd) :","title":"License activation"},{"location":"install/#postgresql-installation","text":"This section introduces PostgreSQL installation with RPM. We don't introduce the installation steps from the source because there are many documents for this approach, and there are also various options for the ./configure script. PostgreSQL is also distributed in the packages of Linux distributions, however, it is not the latest one, and often older than the version which supports PG-Strom. For example, Red Hat Enterprise Linux 7.x distributes PostgreSQL v9.2.x series. This version had been EOL by the PostgreSQL community. PostgreSQL Global Development Group provides yum repository to distribute the latest PostgreSQL and related packages. Like the configuration of EPEL, you can install a small package to set up yum repository, then install PostgreSQL and related software. Here is the list of yum repository definition: http://yum.postgresql.org/repopackages.php . Repository definitions are per PostgreSQL major version and Linux distribution. You need to choose the one for your Linux distribution, and for PostgreSQL v15 or later. You can install PostgreSQL as following steps: Installation of yum repository definition. Disables the distribution's default PostgreSQL module Installation of PostgreSQL packages. # dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm # dnf -y module disable postgresql # dnf install -y postgresql16-devel postgresql16-server Note On the Red Hat Enterprise Linux, the package name postgresql conflicts to the default one at the distribution, thus, unable to install the packages from PGDG. So, disable the postgresql module by the distribution, using dnf -y module disable postgresql .","title":"PostgreSQL Installation"},{"location":"install/#pg-strom-installation","text":"","title":"PG-Strom Installation"},{"location":"install/#rpm-installation","text":"PG-Strom and related packages are distributed from HeteroDB Software Distribution Center . If you repository definition has been added, not many tasks are needed. We provide individual RPM packages of PG-Strom for each PostgreSQL major version. pg_strom-PG15 package is built for PostgreSQL v15, and pg_strom-PG16 is also built for PostgreSQL v16. It is a restriction due to binary compatibility of extension modules for PostgreSQL. # dnf install -y pg_strom-PG16 That's all for package installation.","title":"RPM Installation"},{"location":"install/#installation-from-the-source","text":"For developers, we also introduces the steps to build and install PG-Strom from the source code.","title":"Installation from the source"},{"location":"install/#getting-the-source-code","text":"Like RPM packages, you can download tarball of the source code from HeteroDB Software Distribution Center . On the other hands, here is a certain time-lags to release the tarball, it may be preferable to checkout the master branch of PG-Strom on GitHub to use the latest development branch. $ git clone https://github.com/heterodb/pg-strom.git Cloning into 'pg-strom'... remote: Counting objects: 13797, done. remote: Compressing objects: 100% (215/215), done. remote: Total 13797 (delta 208), reused 339 (delta 167), pack-reused 13400 Receiving objects: 100% (13797/13797), 11.81 MiB | 1.76 MiB/s, done. Resolving deltas: 100% (10504/10504), done.","title":"Getting the source code"},{"location":"install/#building-the-pg-strom","text":"Configuration to build PG-Strom must match to the target PostgreSQL strictly. For example, if a particular strcut has inconsistent layout by the configuration at build, it may lead problematic bugs; not easy to find out. Thus, not to have inconsistency, PG-Strom does not have own configure script, but references the build configuration of PostgreSQL using pg_config command. If PATH environment variable is set to the pg_config command of the target PostgreSQL, run make and make install . Elsewhere, give PG_CONFIG=... parameter on make command to tell the full path of the pg_config command. $ cd pg-strom/src $ make PG_CONFIG=/usr/pgsql-16/bin/pg_config $ sudo make install PG_CONFIG=/usr/pgsql-16/bin/pg_config","title":"Building the PG-Strom"},{"location":"install/#post-installation-setup","text":"","title":"Post Installation Setup"},{"location":"install/#creation-of-database-cluster","text":"Database cluster is not constructed yet, run initdb command to set up initial database of PostgreSQL. The default path of the database cluster on RPM installation is /var/lib/pgsql//data . If you install postgresql-alternatives package, this default path can be referenced by /var/lib/pgdata regardless of the PostgreSQL version. # su - postgres $ /usr/pgsql-16/bin/initdb -D /var/lib/pgdata/ The files belonging to this database system will be owned by user \"postgres\". This user must also own the server process. The database cluster will be initialized with locale \"en_US.UTF-8\". The default database encoding has accordingly been set to \"UTF8\". The default text search configuration will be set to \"english\". Data page checksums are disabled. fixing permissions on existing directory /var/lib/pgdata ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Tokyo creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling \"trust\" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D /var/lib/pgdata/ -l logfile start","title":"Creation of database cluster"},{"location":"install/#setup-postgresqlconf","text":"Next, edit postgresql.conf which is a configuration file of PostgreSQL. The parameters below should be edited at least to work PG-Strom. Investigate other parameters according to usage of the system and expected workloads. shared_preload_libraries PG-Strom module must be loaded on startup of the postmaster process by the shared_preload_libraries . Unable to load it on demand. Therefore, you must add the configuration below. shared_preload_libraries = '$libdir/pg_strom' max_worker_processes PG-Strom internally uses several background workers, so the default configuration (= 8) is too small for other usage. So, we recommand to expand the variable for a certain margin. max_worker_processes = 100 shared_buffers Although it depends on the workloads, the initial configuration of shared_buffers is too small for the data size where PG-Strom tries to work, thus storage workloads restricts the entire performance, and may be unable to work GPU efficiently. So, we recommend to expand the variable for a certain margin. shared_buffers = 10GB Please consider to apply SSD-to-GPU Direct SQL Execution to process larger than system's physical RAM size. work_mem Although it depends on the workloads, the initial configuration of work_mem is too small to choose the optimal query execution plan on analytic queries. An typical example is, disk-based merge sort may be chosen instead of the in-memory quick-sorting. So, we recommend to expand the variable for a certain margin. work_mem = 1GB","title":"Setup postgresql.conf"},{"location":"install/#expand-os-resource-limits","text":"GPU Direct SQL especially tries to open many files simultaneously, so resource limit for number of file descriptors per process should be expanded. Also, we recommend not to limit core file size to generate core dump of PostgreSQL certainly on system crash. If PostgreSQL service is launched by systemd, you can put the configurations of resource limit at /etc/systemd/system/postgresql-XX.service.d/pg_strom.conf . RPM installation setups the configuration below by the default. It comments out configuration to the environment variable CUDA_ENABLE_COREDUMP_ON_EXCEPTION . This is a developer option that enables to generate GPU's core dump on any CUDA/GPU level errors, if enabled. See CUDA-GDB:GPU core dump support for more details. [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1","title":"Expand OS resource limits"},{"location":"install/#start-postgresql","text":"Start PostgreSQL service. If PG-Strom is set up appropriately, it writes out log message which shows PG-Strom recognized GPU devices. The example below recognized two NVIDIA A100 (PCIE; 40GB), and displays the closest GPU identifier foe each NVME-SSD drive. # systemctl start postgresql-16 # journalctl -u postgresql-16 Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB Extra module loaded [api_version=20240418,cufile=off,nvme_strom=off,githash=3ffc65428c07bb3c9d0e5c75a2973389f91dfcd4] Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2024-06-02\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: PG-Strom version 5.12.el9 built for PostgreSQL 16 (githash: ) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom binary built for CUDA 12.4 (CUDA runtime 12.5) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] WARNING: The CUDA version where this PG-Strom module binary was built for (12.4) is newer than the CUDA runtime version on this platform (12.5). It may lead unexpected behavior, and upgrade of CUDA toolkit is recommended. Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78979c134606) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:81:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:82:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c2:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c6:00:0] nvme4 (Corsair MP600 CORE) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c3:00:0] nvme5 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c1:00:0] nvme0 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c4:00:0] nvme2 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] LOG: redirecting log output to logging collector process Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] HINT: Future log output will appear in directory \"log\". Jun 02 17:28:48 buri.heterodb.com systemd[1]: Started PostgreSQL 16 database server.","title":"Start PostgreSQL"},{"location":"install/#creation-of-pg-strom-extension","text":"At the last, create database objects related to PG-Strom, like SQL functions. This steps are packaged using EXTENSION feature of PostgreSQL. So, all you needs to run is CREATE EXTENSION on the SQL command line. Please note that this step is needed for each new database. If you want PG-Strom is pre-configured on new database creation, you can create PG-Strom extension on the template1 database, its configuration will be copied to the new database on CREATE DATABASE command. $ psql -U postgres psql (16.3) Type \"help\" for help. postgres=# CREATE EXTENSION pg_strom ; CREATE EXTENSION That's all for the installation.","title":"Creation of PG-Strom Extension"},{"location":"install/#postgis-installation","text":"PG-Strom supports execution of a part of PostGIS functions on GPU devices. This section introduces the steps to install PostGIS module. Skip it on your demand. PostGIS module can be installed from the yum repository by PostgreSQL Global Development Group, like PostgreSQL itself. The example below shows the command to install PostGIS v3.4 built for PostgreSQL v16. # dnf install postgis34_16 Start PostgreSQL server after the initial setup of database cluster, then run CREATE EXTENSION command from SQL client to define geometry data type and SQL functions for geoanalytics. postgres=# CREATE EXTENSION postgis; CREATE EXTENSION","title":"PostGIS Installation"},{"location":"operations/","text":"Basic operations Confirmation of GPU off-loading You can use EXPLAIN command to check whether query is executed on GPU device or not. A query is internally split into multiple elements and executed, and PG-Strom is capable to run SCAN, JOIN and GROUP BY in parallel on GPU device. If you can find out GpuScan, GpuJoin or GpuPreAgg was displayed instead of the standard operations by PostgreSQL, it means the query is partially executed on GPU device. Below is an example of EXPLAIN command output. postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 NATURAL JOIN t2 GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=989186.82..989190.94 rows=27 width=20) Group Key: t0.cat -> Sort (cost=989186.82..989187.29 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=989175.89..989179.67 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=14744.40..875804.46 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1833360.36 rows=99996736 width=12) Depth 1: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) Depth 2: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.bid JoinQuals: (t0.bid = t2.bid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) -> Seq Scan on t2 (cost=0.00..1935.00 rows=100000 width=4) (21 rows) You can notice some unusual query execution plans. GpuJoin and GpuPreAgg are implemented on the CustomScan mechanism. In this example, GpuJoin runs JOIN operation on t0 , t1 and t1 , then GpuPreAgg which receives the result of GpuJoin runs GROUP BY operation by the cat column on GPU device. PG-Strom interacts with the query optimizer during PostgreSQL is building a query execution plan, and it offers alternative query execution plan with estimated cost for PostgreSQL's optimizer, if any of SCAN, JOIN, or GROUP BY are executable on GPU device. This estimated cost is better than other query execution plans that run on CPU, it chooses the alternative execution plan that shall run on GPU device. For GPU execution, it requires operators, functions and data types in use must be supported by PG-Strom. It supports numeric types like int or float , date and time types like date or timestamp , variable length string like text and so on. It also supports arithmetic operations, comparison operators and many built-in operators. See References for the detailed list. CPU+GPU Hybrid Parallel PG-Strom also supports PostgreSQL's CPU parallel execution. In the CPU parallel execution mode, Gather node launches several background worker processes, then it gathers the result of \"partial\" execution by individual background workers. CustomScan execution plan provided by PG-Strom, like GpuJoin or GpuPreAgg, support execution at the background workers. They process their partial task using GPU individually. A CPU core usually needs much more time to set up buffer to supply data for GPU than execution of SQL workloads on GPU, so hybrid usage of CPU and GPU parallel can expect higher performance. On the other hands, each process creates CUDA context that is required to communicate GPU and consumes a certain amount of GPU resources, so higher parallelism on CPU-side is not always better. Look at the query execution plan below. Execution plan tree under the Gather is executable on background worker process. It scans t0 table which has 100million rows using four background worker processes and the coordinator process, in other words, 20million rows are handled per process by GpuJoin and GpuPreAgg, then its results are merged at Gather node. # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 GROUP by cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=955705.47..955720.93 rows=27 width=20) Group Key: t0.cat -> Sort (cost=955705.47..955707.36 rows=756 width=44) Sort Key: t0.cat -> Gather (cost=955589.95..955669.33 rows=756 width=44) Workers Planned: 4 -> Parallel Custom Scan (GpuPreAgg) (cost=954589.95..954593.73 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on t0 (cost=27682.82..841218.52 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1083384.84 rows=24999184 width=8) Depth 1: GpuHashJoin (nrows 24999184...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows) Pullup underlying plans (*) This section does not follow the latest version, and need to rewrite according to the latest implementation. PG-Strom can run SCAN, JOIN and GROUP BY workloads on GPU, however, it does not work with best performance if these custom execution plan simply replace the standard operations at PostgreSQL. An example of problematic scenario is that SCAN once writes back its result data set to the host buffer then send the same data into GPU again to execute JOIN. Once again, JOIN results are written back and send to GPU to execute GROUP BY. It causes data ping-pong between CPU and GPU. To avoid such inefficient jobs, PG-Strom has a special mode which pulls up its sub-plan to execute a bunch of jobs in a single GPU kernel invocation. Combination of the operations blow can cause pull-up of sub-plans. SCAN + JOIN SCAN + GROUP BY SCAN + JOIN + GROUP BY The execution plan example below never pulls up the sub-plans. GpuJoin receives the result of GpuScan, then its results are passed to GpuPreAgg to generate the final results. # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=1239991.03..1239995.15 rows=27 width=20) Group Key: t0.cat -> Sort (cost=1239991.03..1239991.50 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=1239980.10..1239983.88 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) -> Custom Scan (GpuJoin) (cost=50776.43..1199522.96 rows=33332245 width=12) GPU Projection: t0.cat, t1.ax Depth 1: GpuHashJoin (nrows 33332245...33332245) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Custom Scan (GpuScan) on t0 (cost=12634.49..1187710.85 rows=33332245 width=8) GPU Projection: cat, aid GPU Filter: (aid < bid) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows) This example causes data ping-pong between GPU and host buffers for each execution stage, so not efficient and less performance. On the other hands, the query execution plan below pulls up sub-plans. # EXPLAIN ANALYZE SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=903669.50..903673.62 rows=27 width=20) (actual time=7761.630..7761.644 rows=27 loops=1) Group Key: t0.cat -> Sort (cost=903669.50..903669.97 rows=189 width=44) (actual time=7761.621..7761.626 rows=27 loops=1) Sort Key: t0.cat Sort Method: quicksort Memory: 28kB -> Custom Scan (GpuPreAgg) (cost=903658.57..903662.35 rows=189 width=44) (actual time=7761.531..7761.540 rows=27 loops=1) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=12483.41..863201.43 rows=33332245 width=12) (never executed) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=12634.49..1187710.85 rows=33332245 width=8) (actual time=59.623..5557.052 rows=100000000 loops=1) Outer Scan Filter: (aid < bid) Rows Removed by Outer Scan Filter: 50002874 Depth 1: GpuHashJoin (plan nrows: 33332245...33332245, actual nrows: 49997126...49997126) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size plan: 10.39MB, exec: 64.00MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (actual time=0.013..15.303 rows=100000 loops=1) Planning time: 0.506 ms Execution time: 8495.391 ms (21 rows) You may notice that SCAN on the table t0 is embedded into GpuJoin, and GpuScan gets vanished. It means GpuJoin pulls up the underlying GpuScan, then combined GPU kernel function is also responsible for evaluation of the supplied WHERE-clause. In addition, here is a strange output in EXPLAIN ANALYZE result - it displays (never executed) for GpuJoin. It means GpuJoin is never executed during the query execution, and it is right. GpuPreAgg pulls up the underlying GpuJoin, then its combined GPU kernel function runs JOIN and GROUP BY. The pg_strom.pullup_outer_scan parameter controls whether SCAN is pulled up, and the pg_strom.pullup_outer_join parameter also controls whether JOIN is pulled up. Both parameters are configured to on . Usually, no need to disable them, however, you can use the parameters to identify the problems on system troubles. Inner Pinned Buffer of GpuJoin Look at the EXPLAIN output below. When PG-Strom joins tables, it usually reads the largest table ( lineorder in this case; called the OUTER table) asynchronously, while performing join processing and aggregation processing with other tables. Let's proceed. Due to the constraints of the JOIN algorithm, it is necessary to read other tables ( date1 , part , supplier in this case; called the INNER tables) into memory in advance, and also calculate the hash value of the JOIN key. Although these tables are not as large as the OUTER table, preparing an INNER buffer that exceeds several GB is a heavy process. GpuJoin usually reads the INNER table through the PostgreSQL API row-by-row, calculates its hash value, and writes them to the INNER buffer on the host shared memory. The GPU-Service process transfers this INNER buffer onto the GPU device memory, then we can start reading the OUTER table and processing the JOIN with inner tables. If the INNER table is relatively large and contains search conditions that are executable on the GPU, GpuScan may exists under GpuJoin, as in the EXPLAIN output below. In this case, the INNER table is once processed on the GPU by GpuScan, the execution results are returned to the CPU, and then written to the INNER buffer before it is loaded onto the GPU again. It looks like there is quite a bit of wasted data flow. =# explain select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_brand1 between 'MFGR#2221' and 'MFGR#2228' and s_region = 'ASIA' group by d_year, p_brand1; QUERY PLAN --------------------------------------------------------------------------------------------------------------- GroupAggregate (cost=31007186.70..31023043.21 rows=6482 width=46) Group Key: date1.d_year, part.p_brand1 -> Sort (cost=31007186.70..31011130.57 rows=1577548 width=20) Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuJoin) on lineorder (cost=275086.19..30844784.03 rows=1577548 width=20) GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue GPU Join Quals [1]: (part.p_partkey = lineorder.lo_partkey) ... [nrows: 5994236000 -> 7804495] GPU Outer Hash [1]: lineorder.lo_partkey GPU Inner Hash [1]: part.p_partkey GPU Join Quals [2]: (supplier.s_suppkey = lineorder.lo_suppkey) ... [nrows: 7804495 -> 1577548] GPU Outer Hash [2]: lineorder.lo_suppkey GPU Inner Hash [2]: supplier.s_suppkey GPU Join Quals [3]: (date1.d_datekey = lineorder.lo_orderdate) ... [nrows: 1577548 -> 1577548] GPU Outer Hash [3]: lineorder.lo_orderdate GPU Inner Hash [3]: date1.d_datekey GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on part (cost=0.00..59258.00 rows=2604 width=14) Filter: ((p_brand1 >= 'MFGR#2221'::bpchar) AND (p_brand1 <= 'MFGR#2228'::bpchar)) -> Custom Scan (GpuScan) on supplier (cost=100.00..190348.83 rows=2019384 width=6) GPU Projection: s_suppkey GPU Pinned Buffer: enabled GPU Scan Quals: (s_region = 'ASIA'::bpchar) [rows: 9990357 -> 2019384] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=8) (24 rows) In this way, if data ping-pong occurs between the CPU and GPU when reading the INNER table or building the INNER buffer, you can configure GPUJoin to use Pinned Inner Buffer . It is possible to shorten the execution start lead time and reduce memory usage. In the above EXPLAIN output, reading of the supplier table will be performed by GpuScan, and according to the statistical information, it is estimated that about 2 million rows will be read from the table. Meanwhile, notice the output of GPU Pinned Buffer: enabled . This is a function that if the estimated size of the INNER table exceeds the configuration value of pg_strom.pinned_inner_buffer_threshold , the processing result of GpuScan is retained in the GPU memory and used as part of the INNER buffer at the next GpuJoin. (If necessary, hash value calculation is also performed on the GPU). Therefore, after the contents of the supplier table are read from storage to the GPU using GPU-Direct SQL, they can be used in the next GPUJoin without being returned to the CPU or loaded to the GPU again. It will be. However, there are some tradeoffs to using Pinned Inner Buffer, so it is disabled by default. When using this feature, you must explicitly set the pg_strom.pinned_inner_buffer_threshold parameter. The CPU side does not completely retain the contents of the INNER buffer when Pinned Inner Buffer is in use. Therefore, CPU fallback processing cannot be performed and an error will be raised. Also, RIGHT/FULL OUTER JOIN, which is implemented using CPU Fallback, cannot coexist with Pinned Inner Buffer for the same reason. Knowledge base We publish several articles, just called \"notes\", on the project wiki-site of PG-Strom. https://github.com/heterodb/pg-strom/wiki","title":"Basic Operations"},{"location":"operations/#basic-operations","text":"","title":"Basic operations"},{"location":"operations/#confirmation-of-gpu-off-loading","text":"You can use EXPLAIN command to check whether query is executed on GPU device or not. A query is internally split into multiple elements and executed, and PG-Strom is capable to run SCAN, JOIN and GROUP BY in parallel on GPU device. If you can find out GpuScan, GpuJoin or GpuPreAgg was displayed instead of the standard operations by PostgreSQL, it means the query is partially executed on GPU device. Below is an example of EXPLAIN command output. postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 NATURAL JOIN t2 GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=989186.82..989190.94 rows=27 width=20) Group Key: t0.cat -> Sort (cost=989186.82..989187.29 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=989175.89..989179.67 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=14744.40..875804.46 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1833360.36 rows=99996736 width=12) Depth 1: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) Depth 2: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.bid JoinQuals: (t0.bid = t2.bid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) -> Seq Scan on t2 (cost=0.00..1935.00 rows=100000 width=4) (21 rows) You can notice some unusual query execution plans. GpuJoin and GpuPreAgg are implemented on the CustomScan mechanism. In this example, GpuJoin runs JOIN operation on t0 , t1 and t1 , then GpuPreAgg which receives the result of GpuJoin runs GROUP BY operation by the cat column on GPU device. PG-Strom interacts with the query optimizer during PostgreSQL is building a query execution plan, and it offers alternative query execution plan with estimated cost for PostgreSQL's optimizer, if any of SCAN, JOIN, or GROUP BY are executable on GPU device. This estimated cost is better than other query execution plans that run on CPU, it chooses the alternative execution plan that shall run on GPU device. For GPU execution, it requires operators, functions and data types in use must be supported by PG-Strom. It supports numeric types like int or float , date and time types like date or timestamp , variable length string like text and so on. It also supports arithmetic operations, comparison operators and many built-in operators. See References for the detailed list.","title":"Confirmation of GPU off-loading"},{"location":"operations/#cpugpu-hybrid-parallel","text":"PG-Strom also supports PostgreSQL's CPU parallel execution. In the CPU parallel execution mode, Gather node launches several background worker processes, then it gathers the result of \"partial\" execution by individual background workers. CustomScan execution plan provided by PG-Strom, like GpuJoin or GpuPreAgg, support execution at the background workers. They process their partial task using GPU individually. A CPU core usually needs much more time to set up buffer to supply data for GPU than execution of SQL workloads on GPU, so hybrid usage of CPU and GPU parallel can expect higher performance. On the other hands, each process creates CUDA context that is required to communicate GPU and consumes a certain amount of GPU resources, so higher parallelism on CPU-side is not always better. Look at the query execution plan below. Execution plan tree under the Gather is executable on background worker process. It scans t0 table which has 100million rows using four background worker processes and the coordinator process, in other words, 20million rows are handled per process by GpuJoin and GpuPreAgg, then its results are merged at Gather node. # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 GROUP by cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=955705.47..955720.93 rows=27 width=20) Group Key: t0.cat -> Sort (cost=955705.47..955707.36 rows=756 width=44) Sort Key: t0.cat -> Gather (cost=955589.95..955669.33 rows=756 width=44) Workers Planned: 4 -> Parallel Custom Scan (GpuPreAgg) (cost=954589.95..954593.73 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on t0 (cost=27682.82..841218.52 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1083384.84 rows=24999184 width=8) Depth 1: GpuHashJoin (nrows 24999184...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows)","title":"CPU+GPU Hybrid Parallel"},{"location":"operations/#pullup-underlying-plans","text":"(*) This section does not follow the latest version, and need to rewrite according to the latest implementation. PG-Strom can run SCAN, JOIN and GROUP BY workloads on GPU, however, it does not work with best performance if these custom execution plan simply replace the standard operations at PostgreSQL. An example of problematic scenario is that SCAN once writes back its result data set to the host buffer then send the same data into GPU again to execute JOIN. Once again, JOIN results are written back and send to GPU to execute GROUP BY. It causes data ping-pong between CPU and GPU. To avoid such inefficient jobs, PG-Strom has a special mode which pulls up its sub-plan to execute a bunch of jobs in a single GPU kernel invocation. Combination of the operations blow can cause pull-up of sub-plans. SCAN + JOIN SCAN + GROUP BY SCAN + JOIN + GROUP BY The execution plan example below never pulls up the sub-plans. GpuJoin receives the result of GpuScan, then its results are passed to GpuPreAgg to generate the final results. # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=1239991.03..1239995.15 rows=27 width=20) Group Key: t0.cat -> Sort (cost=1239991.03..1239991.50 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=1239980.10..1239983.88 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) -> Custom Scan (GpuJoin) (cost=50776.43..1199522.96 rows=33332245 width=12) GPU Projection: t0.cat, t1.ax Depth 1: GpuHashJoin (nrows 33332245...33332245) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Custom Scan (GpuScan) on t0 (cost=12634.49..1187710.85 rows=33332245 width=8) GPU Projection: cat, aid GPU Filter: (aid < bid) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows) This example causes data ping-pong between GPU and host buffers for each execution stage, so not efficient and less performance. On the other hands, the query execution plan below pulls up sub-plans. # EXPLAIN ANALYZE SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=903669.50..903673.62 rows=27 width=20) (actual time=7761.630..7761.644 rows=27 loops=1) Group Key: t0.cat -> Sort (cost=903669.50..903669.97 rows=189 width=44) (actual time=7761.621..7761.626 rows=27 loops=1) Sort Key: t0.cat Sort Method: quicksort Memory: 28kB -> Custom Scan (GpuPreAgg) (cost=903658.57..903662.35 rows=189 width=44) (actual time=7761.531..7761.540 rows=27 loops=1) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=12483.41..863201.43 rows=33332245 width=12) (never executed) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=12634.49..1187710.85 rows=33332245 width=8) (actual time=59.623..5557.052 rows=100000000 loops=1) Outer Scan Filter: (aid < bid) Rows Removed by Outer Scan Filter: 50002874 Depth 1: GpuHashJoin (plan nrows: 33332245...33332245, actual nrows: 49997126...49997126) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size plan: 10.39MB, exec: 64.00MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (actual time=0.013..15.303 rows=100000 loops=1) Planning time: 0.506 ms Execution time: 8495.391 ms (21 rows) You may notice that SCAN on the table t0 is embedded into GpuJoin, and GpuScan gets vanished. It means GpuJoin pulls up the underlying GpuScan, then combined GPU kernel function is also responsible for evaluation of the supplied WHERE-clause. In addition, here is a strange output in EXPLAIN ANALYZE result - it displays (never executed) for GpuJoin. It means GpuJoin is never executed during the query execution, and it is right. GpuPreAgg pulls up the underlying GpuJoin, then its combined GPU kernel function runs JOIN and GROUP BY. The pg_strom.pullup_outer_scan parameter controls whether SCAN is pulled up, and the pg_strom.pullup_outer_join parameter also controls whether JOIN is pulled up. Both parameters are configured to on . Usually, no need to disable them, however, you can use the parameters to identify the problems on system troubles.","title":"Pullup underlying plans"},{"location":"operations/#inner-pinned-buffer-of-gpujoin","text":"Look at the EXPLAIN output below. When PG-Strom joins tables, it usually reads the largest table ( lineorder in this case; called the OUTER table) asynchronously, while performing join processing and aggregation processing with other tables. Let's proceed. Due to the constraints of the JOIN algorithm, it is necessary to read other tables ( date1 , part , supplier in this case; called the INNER tables) into memory in advance, and also calculate the hash value of the JOIN key. Although these tables are not as large as the OUTER table, preparing an INNER buffer that exceeds several GB is a heavy process. GpuJoin usually reads the INNER table through the PostgreSQL API row-by-row, calculates its hash value, and writes them to the INNER buffer on the host shared memory. The GPU-Service process transfers this INNER buffer onto the GPU device memory, then we can start reading the OUTER table and processing the JOIN with inner tables. If the INNER table is relatively large and contains search conditions that are executable on the GPU, GpuScan may exists under GpuJoin, as in the EXPLAIN output below. In this case, the INNER table is once processed on the GPU by GpuScan, the execution results are returned to the CPU, and then written to the INNER buffer before it is loaded onto the GPU again. It looks like there is quite a bit of wasted data flow. =# explain select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_brand1 between 'MFGR#2221' and 'MFGR#2228' and s_region = 'ASIA' group by d_year, p_brand1; QUERY PLAN --------------------------------------------------------------------------------------------------------------- GroupAggregate (cost=31007186.70..31023043.21 rows=6482 width=46) Group Key: date1.d_year, part.p_brand1 -> Sort (cost=31007186.70..31011130.57 rows=1577548 width=20) Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuJoin) on lineorder (cost=275086.19..30844784.03 rows=1577548 width=20) GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue GPU Join Quals [1]: (part.p_partkey = lineorder.lo_partkey) ... [nrows: 5994236000 -> 7804495] GPU Outer Hash [1]: lineorder.lo_partkey GPU Inner Hash [1]: part.p_partkey GPU Join Quals [2]: (supplier.s_suppkey = lineorder.lo_suppkey) ... [nrows: 7804495 -> 1577548] GPU Outer Hash [2]: lineorder.lo_suppkey GPU Inner Hash [2]: supplier.s_suppkey GPU Join Quals [3]: (date1.d_datekey = lineorder.lo_orderdate) ... [nrows: 1577548 -> 1577548] GPU Outer Hash [3]: lineorder.lo_orderdate GPU Inner Hash [3]: date1.d_datekey GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on part (cost=0.00..59258.00 rows=2604 width=14) Filter: ((p_brand1 >= 'MFGR#2221'::bpchar) AND (p_brand1 <= 'MFGR#2228'::bpchar)) -> Custom Scan (GpuScan) on supplier (cost=100.00..190348.83 rows=2019384 width=6) GPU Projection: s_suppkey GPU Pinned Buffer: enabled GPU Scan Quals: (s_region = 'ASIA'::bpchar) [rows: 9990357 -> 2019384] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=8) (24 rows) In this way, if data ping-pong occurs between the CPU and GPU when reading the INNER table or building the INNER buffer, you can configure GPUJoin to use Pinned Inner Buffer . It is possible to shorten the execution start lead time and reduce memory usage. In the above EXPLAIN output, reading of the supplier table will be performed by GpuScan, and according to the statistical information, it is estimated that about 2 million rows will be read from the table. Meanwhile, notice the output of GPU Pinned Buffer: enabled . This is a function that if the estimated size of the INNER table exceeds the configuration value of pg_strom.pinned_inner_buffer_threshold , the processing result of GpuScan is retained in the GPU memory and used as part of the INNER buffer at the next GpuJoin. (If necessary, hash value calculation is also performed on the GPU). Therefore, after the contents of the supplier table are read from storage to the GPU using GPU-Direct SQL, they can be used in the next GPUJoin without being returned to the CPU or loaded to the GPU again. It will be. However, there are some tradeoffs to using Pinned Inner Buffer, so it is disabled by default. When using this feature, you must explicitly set the pg_strom.pinned_inner_buffer_threshold parameter. The CPU side does not completely retain the contents of the INNER buffer when Pinned Inner Buffer is in use. Therefore, CPU fallback processing cannot be performed and an error will be raised. Also, RIGHT/FULL OUTER JOIN, which is implemented using CPU Fallback, cannot coexist with Pinned Inner Buffer for the same reason.","title":"Inner Pinned Buffer of GpuJoin"},{"location":"operations/#knowledge-base","text":"We publish several articles, just called \"notes\", on the project wiki-site of PG-Strom. https://github.com/heterodb/pg-strom/wiki","title":"Knowledge base"},{"location":"partition/","text":"Partitioning This chapter introduces the way to use PG-Strom and the partitioning feature of PostgreSQL. Note that this chapter is only valid when PG-Strom works on PostgreSQL v11 or later . Also see PostgreSQL Document: Table Partitioning for more details of the partitioning feature of PostgreSQL. Overview PostgreSQL v10 newly support table partitioning. This mechanism splits one logically large table into physically small pieces. It is valuable because it can skip partitioned child tables which is obviously unnecessary to scan from the search qualification, and it can offer broader I/O bandwidth by physically distributed storage and so on. PostgreSQL v10 supports two kinds of them: range-partitioning and list-partitioning. Then, PostgreSQL v11 newly supports hash-partitioning and partition-wise JOINs. The diagram below shows a range-partitioning configuration with date -type key values. A record which has 2018-05-30 as key is distributed to the partition child table tbl_2018 , in the same way, a record which has 2014-03-21 is distributed to the partition child table tbl_2014 , and so on. In case when scan qualifier WHERE ymd > '2016-07-01'::date is added on scan of the partitioned table for example, it is obvious that tbl_2014 and tbl_2015 contains no records to match, therefore, PostgreSQL' optimizer constructs query execution plan which runs on only tbl_2016 , tbl_2017 and tbl_2018 then merges their results by Append node. It shall perform as if records are read from one logical table. When PG-Strom is used with table partitioning of PostgreSQL together, its optimizer may choose GpuScan to scan the individual partition child tables to be scanned, in the result of cost estimation. In this case, Append node merges the results of GpuScan . On the other hands, if query runs JOIN or GROUP BY, which can be accelerated by PG-Strom, next to the scan on partitioned table, it needs consideration from the standpoint of performance optimization. For example, in case when query scans non-partitioned table then runs JOIN with other tables and GROUP BY, under some conditions, it can handle step-step data exchange on GPU device memory. It is an optimal workload for PG-Strom due to minimized data exchange between GPU and CPU. In case when query runs corresponding workload on the partitioned table, it is problematic that Append node is injected into between the child tables scan and JOIN/GROUP BY. Under the query execution plan, the result of GpuScan must be written back to the host system, then Append merges them and send back the data to GPU to run the following GpuJoin and GpuPreAgg. It is never efficient query execution. The example below shows a query execution plan to the query which includes JOIN and GROUP BY towards the partitioned table pt by the key field ymd of date type; per year distribution. Due to the scan qualification, it omits scan on the partition child tables for 2016 or prior, in addition, a combined JOIN and GROUP BY on the pt_2017 , pt_2018 and pt_2019 shall be executed prior to the Append . # EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- HashAggregate (cost=196410.07..196412.57 rows=200 width=48) Group Key: pt_2017.cat -> Gather (cost=66085.69..196389.07 rows=1200 width=72) Workers Planned: 2 -> Parallel Append (cost=65085.69..195269.07 rows=600 width=72) -> Parallel Custom Scan (GpuPreAgg) (cost=65085.69..65089.69 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2017 (cost=32296.64..74474.20 rows=1050772 width=40) Outer Scan: pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050772...2521854) HashKeys: pt_2017.aid JoinQuals: (pt_2017.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65078.35..65082.35 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2018 (cost=32296.65..74465.75 rows=1050649 width=40) Outer Scan: pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050649...2521557) HashKeys: pt_2018.aid JoinQuals: (pt_2018.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65093.03..65097.03 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2019 (cost=32296.65..74482.64 rows=1050896 width=40) Outer Scan: pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050896...2522151) HashKeys: pt_2019.aid JoinQuals: (pt_2019.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (38 rows) Configuration and Operation By the GUC parameters below, PG-Strom enables/disables the push-down of JOIN/GROUP BY under the partition child tables. Parameter Type Default Description pg_strom.enable_partitionwise_gpujoin bool on Enables/disables whether GpuJoin is pushed down to the partition children. Available only PostgreSQL v10 or later. pg_strom.enable_partitionwise_gpupreagg bool on Enables/disables whether GpuPreAgg is pushed down to the partition children. Available only PostgreSQL v10 or later. Default of the parameters are on . Once set to off , push-down is disabled. The query execution plan is changed as follows, by EXPLAIN command for the query above section. It uses GpuScan to scan the partition child tables, however, their results are once written back to the host system, then merged by Append and moved to GPU again to process GpuJoin . postgres=# set pg_strom.enable_partitionwise_gpujoin = off; SET postgres=# set pg_strom.enable_partitionwise_gpupreagg = off; SET postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date group by cat; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate (cost=341392.92..341399.42 rows=200 width=48) Group Key: pt.cat -> Sort (cost=341392.92..341393.92 rows=400 width=72) Sort Key: pt.cat -> Gather (cost=341333.63..341375.63 rows=400 width=72) Workers Planned: 2 -> Partial HashAggregate (cost=340333.63..340335.63 rows=200 width=72) Group Key: pt.cat -> Parallel Custom Scan (GpuJoin) (cost=283591.92..283591.92 rows=7565562 width=40) Depth 1: GpuHashJoin (nrows 3152318...7565562) HashKeys: pt.aid JoinQuals: (pt.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Append (cost=28540.80..200673.34 rows=3152318 width=36) -> Parallel Custom Scan (GpuScan) on pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (21 rows) Consideration for SSD/GPU location Limitations Experimental Feature It is an experimental feature to push down GpuJoin and GpuPreAgg to the partitioned child tables, so it may lead unexpected behavior or system crash. In such case, disable the feature using pg_strom.enable_partitionwise_gpujoin or pg_strom.enable_partitionwise_gpupreagg . And report your case to PG-Strom Issues .","title":"Partitioning"},{"location":"partition/#partitioning","text":"This chapter introduces the way to use PG-Strom and the partitioning feature of PostgreSQL. Note that this chapter is only valid when PG-Strom works on PostgreSQL v11 or later . Also see PostgreSQL Document: Table Partitioning for more details of the partitioning feature of PostgreSQL.","title":"Partitioning"},{"location":"partition/#overview","text":"PostgreSQL v10 newly support table partitioning. This mechanism splits one logically large table into physically small pieces. It is valuable because it can skip partitioned child tables which is obviously unnecessary to scan from the search qualification, and it can offer broader I/O bandwidth by physically distributed storage and so on. PostgreSQL v10 supports two kinds of them: range-partitioning and list-partitioning. Then, PostgreSQL v11 newly supports hash-partitioning and partition-wise JOINs. The diagram below shows a range-partitioning configuration with date -type key values. A record which has 2018-05-30 as key is distributed to the partition child table tbl_2018 , in the same way, a record which has 2014-03-21 is distributed to the partition child table tbl_2014 , and so on. In case when scan qualifier WHERE ymd > '2016-07-01'::date is added on scan of the partitioned table for example, it is obvious that tbl_2014 and tbl_2015 contains no records to match, therefore, PostgreSQL' optimizer constructs query execution plan which runs on only tbl_2016 , tbl_2017 and tbl_2018 then merges their results by Append node. It shall perform as if records are read from one logical table. When PG-Strom is used with table partitioning of PostgreSQL together, its optimizer may choose GpuScan to scan the individual partition child tables to be scanned, in the result of cost estimation. In this case, Append node merges the results of GpuScan . On the other hands, if query runs JOIN or GROUP BY, which can be accelerated by PG-Strom, next to the scan on partitioned table, it needs consideration from the standpoint of performance optimization. For example, in case when query scans non-partitioned table then runs JOIN with other tables and GROUP BY, under some conditions, it can handle step-step data exchange on GPU device memory. It is an optimal workload for PG-Strom due to minimized data exchange between GPU and CPU. In case when query runs corresponding workload on the partitioned table, it is problematic that Append node is injected into between the child tables scan and JOIN/GROUP BY. Under the query execution plan, the result of GpuScan must be written back to the host system, then Append merges them and send back the data to GPU to run the following GpuJoin and GpuPreAgg. It is never efficient query execution. The example below shows a query execution plan to the query which includes JOIN and GROUP BY towards the partitioned table pt by the key field ymd of date type; per year distribution. Due to the scan qualification, it omits scan on the partition child tables for 2016 or prior, in addition, a combined JOIN and GROUP BY on the pt_2017 , pt_2018 and pt_2019 shall be executed prior to the Append . # EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- HashAggregate (cost=196410.07..196412.57 rows=200 width=48) Group Key: pt_2017.cat -> Gather (cost=66085.69..196389.07 rows=1200 width=72) Workers Planned: 2 -> Parallel Append (cost=65085.69..195269.07 rows=600 width=72) -> Parallel Custom Scan (GpuPreAgg) (cost=65085.69..65089.69 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2017 (cost=32296.64..74474.20 rows=1050772 width=40) Outer Scan: pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050772...2521854) HashKeys: pt_2017.aid JoinQuals: (pt_2017.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65078.35..65082.35 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2018 (cost=32296.65..74465.75 rows=1050649 width=40) Outer Scan: pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050649...2521557) HashKeys: pt_2018.aid JoinQuals: (pt_2018.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65093.03..65097.03 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2019 (cost=32296.65..74482.64 rows=1050896 width=40) Outer Scan: pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050896...2522151) HashKeys: pt_2019.aid JoinQuals: (pt_2019.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (38 rows)","title":"Overview"},{"location":"partition/#configuration-and-operation","text":"By the GUC parameters below, PG-Strom enables/disables the push-down of JOIN/GROUP BY under the partition child tables. Parameter Type Default Description pg_strom.enable_partitionwise_gpujoin bool on Enables/disables whether GpuJoin is pushed down to the partition children. Available only PostgreSQL v10 or later. pg_strom.enable_partitionwise_gpupreagg bool on Enables/disables whether GpuPreAgg is pushed down to the partition children. Available only PostgreSQL v10 or later. Default of the parameters are on . Once set to off , push-down is disabled. The query execution plan is changed as follows, by EXPLAIN command for the query above section. It uses GpuScan to scan the partition child tables, however, their results are once written back to the host system, then merged by Append and moved to GPU again to process GpuJoin . postgres=# set pg_strom.enable_partitionwise_gpujoin = off; SET postgres=# set pg_strom.enable_partitionwise_gpupreagg = off; SET postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date group by cat; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate (cost=341392.92..341399.42 rows=200 width=48) Group Key: pt.cat -> Sort (cost=341392.92..341393.92 rows=400 width=72) Sort Key: pt.cat -> Gather (cost=341333.63..341375.63 rows=400 width=72) Workers Planned: 2 -> Partial HashAggregate (cost=340333.63..340335.63 rows=200 width=72) Group Key: pt.cat -> Parallel Custom Scan (GpuJoin) (cost=283591.92..283591.92 rows=7565562 width=40) Depth 1: GpuHashJoin (nrows 3152318...7565562) HashKeys: pt.aid JoinQuals: (pt.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Append (cost=28540.80..200673.34 rows=3152318 width=36) -> Parallel Custom Scan (GpuScan) on pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (21 rows)","title":"Configuration and Operation"},{"location":"partition/#consideration-for-ssdgpu-location","text":"","title":"Consideration for SSD/GPU location"},{"location":"partition/#limitations","text":"Experimental Feature It is an experimental feature to push down GpuJoin and GpuPreAgg to the partitioned child tables, so it may lead unexpected behavior or system crash. In such case, disable the feature using pg_strom.enable_partitionwise_gpujoin or pg_strom.enable_partitionwise_gpupreagg . And report your case to PG-Strom Issues .","title":"Limitations"},{"location":"postgis/","text":"GPU-PostGIS This chapter describes GPU-PostGIS Overview PostGIS is an extension to PostgreSQL to utilize geographic information. PostGIS provides data type ( Geometry ) for handling geographic data such as points, lines, and polygons, as well as a large number of functions and operators for evaluating geographic data elements, such as distance calculation, inclusion, and intersection determination. In addition, some of the operators can search faster by the R-Tree using GiST(Generalized Search Tree) mechanism included in PostgreSQL. Since the first version was released in 2001, it has been enhanced and maintained by the developer community for over 20 years. These functions and operators provided by PostGIS are very large, over 500 in total. For this reason, PG-Strom has ported only a few relatively frequently used PostGIS functions to the GPU. For example: geometry st_point(float8 lon,float8 lat) returns a point with the given longitude and latitude as a Point of Geometry type. bool st_contains(geometry a,geometry b) determines if the geometry a contains the geometry b or not. bool st_crosses(geometry,geometry) determines if the geometries intersect each other. text st_relate(geometry,geometry) returns the relationship between geometries as a matrix representation of DE-9IM(Dimensionally Extended 9-Intersection Model) . PostGIS Usage You can use GPU-PostGIS without any configurations. PG-Strom will automatically determine if the PostGIS functions used in the query are executable on the GPU when PostGIS is installed from the package or the source code and the geometry data types and PostGIS functions are defined using the CREATE EXTENSION syntax. Please refer to the PostGIS documentaion for installation. For example, the following query uses the GPU-executable PostGIS funtion st_contains() and st_makepoint() to determine if a two-dimensional point read from the table is contained within the range of the geometry type constant 'polygon ((10 10,30 10,30 20,10 20,10 10))' . As you can see from the fact that these functions are listed as part of the \"GPU Filter:\", PG-Strom will automatically detect supported PostGIS functions and attempt to run them on the GPU as much as possible. =# explain select * from dpoints where st_contains('polygon ((10 10,30 10,30 20,10 20,10 10))', st_makepoint(x,y)); QUERY PLAN ------------------------------------------------------------------------------------------ Custom Scan (GpuScan) on dpoints (cost=1397205.10..12627630.76 rows=800 width=28) GPU Filter: st_contains('01030000000100000005000000000000000000244000000000000024400000000000003E4000000000000024400000000000003E4000000000000034400000000000002440000000000000344000000000000024400000000000002440'::geometry, st_makepoint(x, y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) (3 rows) GiST Index Some of the PostGIS functions that evaluate relationships between geometries, such as st_contains() and st_crosses() , support the GiST index (R-Tree), which enables fast refinement of the search using only the CPU. GpuJoin in PG-Strom sometimes transfers not only the contents of the table but also GiST index (R-Tree) to filter the rows to be joined fast when the join condition between tables can be accelerated. This process is usually executed at a much higher parallelism level than the CPU, so a significant speedup can be expected. On the other hand, GpuScan does not use GiST index to scan a single table. This is because IndexScan filtering by CPU is often faster. The following is an example of a SQL statement to create a GiST index on city boundary data (\"geom\" column of \"giscity\" table). =# CREATE INDEX on giscity USING gist (geom); CREATE INDEX The following is an execution plan of SQL that joins municipal boundary data (\"giscity\" table) and latitude and longitude data (\"dpoints\" table) and outputs the number of latitude and longitude data (points) contained in the area expressed as polygons for each municipality. The optimizer selects GpuJoin, and GpuGiSTJoin to join \"giscity\" table with \"dpoints\" table. The \"IndexFilter:\" line shows that the filtering condition on the GiST index is (g.geom ~ st_makepoint(d.x, d.y)) and the index giscity_geom_idx will be used. The execution of PostGIS functions is a relatively \"heavy\" process even for GPU. By using GiST index, we can eliminate combinations that obviously do not match the condition and speed up the search process significantly. =# EXPLAIN SELECT pref, city, count(*) FROM giscity g, dpoints d WHERE pref = 'Tokyo' AND st_contains(g.geom,st_makepoint(d.x, d.y)) GROUP BY pref, city; QUERY PLAN ----------------------------------------------------------------------------------------------------------- GroupAggregate (cost=5700646.35..5700759.39 rows=5024 width=29) Group Key: g.n03_001, g.n03_004 -> Sort (cost=5700646.35..5700658.91 rows=5024 width=29) Sort Key: g.n03_004 -> Custom Scan (GpuPreAgg) (cost=5700274.71..5700337.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=638671.58..5668511.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (17 rows)","title":"PostGIS"},{"location":"postgis/#gpu-postgis","text":"This chapter describes GPU-PostGIS","title":"GPU-PostGIS"},{"location":"postgis/#overview","text":"PostGIS is an extension to PostgreSQL to utilize geographic information. PostGIS provides data type ( Geometry ) for handling geographic data such as points, lines, and polygons, as well as a large number of functions and operators for evaluating geographic data elements, such as distance calculation, inclusion, and intersection determination. In addition, some of the operators can search faster by the R-Tree using GiST(Generalized Search Tree) mechanism included in PostgreSQL. Since the first version was released in 2001, it has been enhanced and maintained by the developer community for over 20 years. These functions and operators provided by PostGIS are very large, over 500 in total. For this reason, PG-Strom has ported only a few relatively frequently used PostGIS functions to the GPU. For example: geometry st_point(float8 lon,float8 lat) returns a point with the given longitude and latitude as a Point of Geometry type. bool st_contains(geometry a,geometry b) determines if the geometry a contains the geometry b or not. bool st_crosses(geometry,geometry) determines if the geometries intersect each other. text st_relate(geometry,geometry) returns the relationship between geometries as a matrix representation of DE-9IM(Dimensionally Extended 9-Intersection Model) .","title":"Overview"},{"location":"postgis/#postgis-usage","text":"You can use GPU-PostGIS without any configurations. PG-Strom will automatically determine if the PostGIS functions used in the query are executable on the GPU when PostGIS is installed from the package or the source code and the geometry data types and PostGIS functions are defined using the CREATE EXTENSION syntax. Please refer to the PostGIS documentaion for installation. For example, the following query uses the GPU-executable PostGIS funtion st_contains() and st_makepoint() to determine if a two-dimensional point read from the table is contained within the range of the geometry type constant 'polygon ((10 10,30 10,30 20,10 20,10 10))' . As you can see from the fact that these functions are listed as part of the \"GPU Filter:\", PG-Strom will automatically detect supported PostGIS functions and attempt to run them on the GPU as much as possible. =# explain select * from dpoints where st_contains('polygon ((10 10,30 10,30 20,10 20,10 10))', st_makepoint(x,y)); QUERY PLAN ------------------------------------------------------------------------------------------ Custom Scan (GpuScan) on dpoints (cost=1397205.10..12627630.76 rows=800 width=28) GPU Filter: st_contains('01030000000100000005000000000000000000244000000000000024400000000000003E4000000000000024400000000000003E4000000000000034400000000000002440000000000000344000000000000024400000000000002440'::geometry, st_makepoint(x, y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) (3 rows)","title":"PostGIS Usage"},{"location":"postgis/#gist-index","text":"Some of the PostGIS functions that evaluate relationships between geometries, such as st_contains() and st_crosses() , support the GiST index (R-Tree), which enables fast refinement of the search using only the CPU. GpuJoin in PG-Strom sometimes transfers not only the contents of the table but also GiST index (R-Tree) to filter the rows to be joined fast when the join condition between tables can be accelerated. This process is usually executed at a much higher parallelism level than the CPU, so a significant speedup can be expected. On the other hand, GpuScan does not use GiST index to scan a single table. This is because IndexScan filtering by CPU is often faster. The following is an example of a SQL statement to create a GiST index on city boundary data (\"geom\" column of \"giscity\" table). =# CREATE INDEX on giscity USING gist (geom); CREATE INDEX The following is an execution plan of SQL that joins municipal boundary data (\"giscity\" table) and latitude and longitude data (\"dpoints\" table) and outputs the number of latitude and longitude data (points) contained in the area expressed as polygons for each municipality. The optimizer selects GpuJoin, and GpuGiSTJoin to join \"giscity\" table with \"dpoints\" table. The \"IndexFilter:\" line shows that the filtering condition on the GiST index is (g.geom ~ st_makepoint(d.x, d.y)) and the index giscity_geom_idx will be used. The execution of PostGIS functions is a relatively \"heavy\" process even for GPU. By using GiST index, we can eliminate combinations that obviously do not match the condition and speed up the search process significantly. =# EXPLAIN SELECT pref, city, count(*) FROM giscity g, dpoints d WHERE pref = 'Tokyo' AND st_contains(g.geom,st_makepoint(d.x, d.y)) GROUP BY pref, city; QUERY PLAN ----------------------------------------------------------------------------------------------------------- GroupAggregate (cost=5700646.35..5700759.39 rows=5024 width=29) Group Key: g.n03_001, g.n03_004 -> Sort (cost=5700646.35..5700658.91 rows=5024 width=29) Sort Key: g.n03_004 -> Custom Scan (GpuPreAgg) (cost=5700274.71..5700337.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=638671.58..5668511.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (17 rows)","title":"GiST Index"},{"location":"ref_devfuncs/","text":"Functions and operators This chapter introduces the functions and operators executable on GPU devices. Type cast bool <-- int4 int1 <-- int2 , int4 , int8 , float2 , float4 , float8 , numeric int2 <-- int1 , int4 , int8 , float2 , float4 , float8 , numeric int4 <-- bool , int1 , int2 , int8 , float2 , float4 , float8 , numeric int8 <-- int1 , int2 , int4 , float2 , float4 , float8 , numeric float2 <-- int1 , int2 , int4 , int8 , float4 , float8 , numeric float4 <-- int1 , int2 , int4 , int8 , float2 , float8 , numeric float8 <-- int1 , int2 , int4 , int8 , float2 , float4 , numeric numeric <-- int1 , int2 , int4 , int8 , float2 , float4 , float8 money <-- int4 , int8 , numeric date <-- timestamp , timestamptz time <-- timetz , timestamp , timestamptz timetz <-- time , timestamptz timestamp <-- date , timestamptz timestamptz <-- date , timestamp Numeric functions/operators bool COMP bool comparison operators of boolean type. COMP is any of =,<> } INT COMP INT comparison operators of integer types. INT is any of int1,int2,int4,int8 . It is acceptable if left side and right side have different interger types. COMP is any of =,<>,<,<=,>=,> } FP COMP FP comparison operators of floating-point types. FP is any of float2,float4,float8 . It is acceptable if left side and right side have different floating-point types. COMP is any of =,<>,<,<=,>=,> } numeric COMP numeric comparison operators of numeric type. COMP is any of =,<>,<,<=,>=,> } INT OP INT arithemetic operators of integer types. INT is any of int1,int2,int4,int8 . It is acceptable if left side and right side have different interger types. OP is any of +,-,*,/ } FP OP FP arithemetic operators of floating-point types. FP is any of float2,float4,float8 . It is acceptable if left side and right side have different floating-point types. COMP is any of +,-,*,/ } numeric OP numeric comparison operators of numeric type. OP is any of +,-,*,/ } INT % INT Reminer operator. INT is any of int1,int2,int4,int8 } INT & INT Bitwise AND operator. INT is any of int1,int2,int4,int8 } INT | INT Bitwise OR operator. INT is any of int1,int2,int4,int8 } INT # INT Bitwise XOR operator. INT is any of int1,int2,int4,int8 } ~ INT Bitwise NOT operator. INT is any of int1,int2,int4,int8 } INT >> int4 Right shift operator. INT is any of int1,int2,int4,int8 } INT << int4 Left shift operator. INT is any of int1,int2,int4,int8 } + TYPE Unary plus operator. TYPE is any of int1,int2,int4,int8,float2,float4,float8,numeric .} - TYPE Unary minus operator. TYPE is any of int1,int2,int4,int8,float2,float4,float8,numeric .} @ TYPE Absolute value. TYPE is any of int1,int2,int4,int8,float2,float4,float8,numeric .} Mathematical functions float8 cbrt(float8) float8 dcbrt(float8) cube root float8 ceil(float8) float8 ceiling(float8) nearest integer greater than or equal to argument float8 exp(float8) float8 dexp(float8) exponential float8 floor(float8) nearest integer less than or equal to argument float8 ln(float8) float8 dlog1(float8) natural logarithm float8 log(float8) float8 dlog10(float8) base 10 logarithm float8 pi() circumference ratio float8 power(float8,float8) float8 pow(float8,float8) float8 dpow(float8,float8) power float8 round(float8) float8 dround(float8) round to the nearest integer float8 sign(float8) sign of the argument float8 sqrt(float8) float8 dsqrt(float8) square root| float8 trunc(float8) float8 dtrunc(float8) truncate toward zero| Trigonometric functions float8 degrees(float8) radians to degrees} float8 radians(float8) degrees to radians} float8 acos(float8) inverse cosine} float8 asin(float8) inverse sine} float8 atan(float8) inverse tangent} float8 atan2(float8,float8) inverse tangent of arg1 / arg2 } float8 cos(float8) cosine} float8 cot(float8) cotangent} float8 sin(float8) sine} float8 tan(float8) tangent} Date and time operators date COMP date comparison operators for date type. COMP is any of =,<>,<,<=,>=,> .} date COMP timestamp timestamp COMP date comparison operators for date and timestamp type. COMP is any of =,<>,<,<=,>=,> .} date COMP timestamptz timestamptz COMP date comparison operators for date and timestamptz type. COMP is any of =,<>,<,<=,>=,> .} time COMP time comparison operators for time type. COMP is any of =,<>,<,<=,>=,> .} timetz COMP timetz comparison operators for timetz type. COMP is any of =,<>,<,<=,>=,> .} timestamp COMP timestamp comparison operators for timestamp type. COMP is any of =,<>,<,<=,>=,> .} timestamptz COMP timestamptz comparison operators for timestamptz type. COMP is any of =,<>,<,<=,>=,> .} timestamp COMP timestamptz timestamptz COMP timestamp comparison operators for timestamp and timestamptz type. COMP is any of =,<>,<,<=,>=,> .} interval COMP interval comparison operators for interval type. COMP is any of =,<>,<,<=,>=,> .} date + int4 int4 + date addition operator of date type} date - int4 subtraction operator of date type} date - date difference between date types} date + time time + date constructs a timestamp from date and time } date + timetz constructs a timestamptz from date and timetz } time - time difference between time types} timestamp - timestamp difference between timestamp types} timetz + interval timetz - interval addition or subtraction operator of timetz by interval .} timestamptz + interval timestamptz - interval addition or subtraction operator of timestamptz by interval .} overlaps(TYPE,TYPE,TYPE,TYPE) checks whether the 2 given time periods overlaps. TYPE is any of time,timetz,timestamp,timestamptz .} extract(text FROM TYPE) retrieves subfields such as day or hour from date/time values. TYPE is any of time,timetz,timestamp,timestamptz,interval .} now() current time of the transaction} - interval unary minus operator of interval type} interval + interval addition operator of interval type} interval - interval subtraction operator of interval type} Text functions/operators {text,bpchar} COMP {text,bpchar} comparison operators; COMP is any of =,<>,<,<=,>=,> Note that <,<=,>=,> operators are valid only when locale is UTF-8 or C (no locale).} substring(text,int4) substring(text,int4,int4) substr(text,int4) substr(text,int4,int4) extracts the substring} length({text,bpchar}) length of the string} {text,bpchar} [NOT] LIKE text pattern-matching according to the LIKE expression} {text,bpchar} [NOT] ILIKE text case-insensitive pattern-matching according to the LIKE expression. Note that ILIKE operator is valid only when locale is UTF-8 or C (no locale).} Network functions/operators macaddr COMP macaddr comparison operators; COMP is any of =,<>,<,<=,>=,> } macaddr & macaddr Bitwise AND operator} macaddr | macaddr Bitwise OR operator} ~ macaddr Bitwise NOT operator} trunc(macaddr) Set last 3 bytes to zero} inet COMP inet comparison operators; COMP is any of =,<>,<,<=,>=,> } inet << inet Left side is contained by right side} inet <<= inet Left side is contained by or equals to right side} inet >> inet Left side contains right side} inet >>= inet Left side contains or is equals to right side} inet && inet Left side contains or is contained by right side} ~ inet Bitwise NOT operator} inet & inet Bitwise AND operator} inet | inet Bitwise OR operator} inet + int8 addition operator} inet - int8 subtraction operator} inet - inet subtraction operator} broadcast(inet) returns the broadcast address of the given network address} family(inet) returns the family of the given network address; 4 for IPv4, and 6 for IPv6} hostmask(inet) extract host mask of the given network address} masklen(inet) extract netmask length of the given network address} netmask(inet) extract netmask of the given network address} network(inet) extract network part of the given network address} set_masklen(NETADDR,int) set netmask length of the given network address; NETADDR is either inet or cidr .} inet_merge(inet,inet) the smallest network which includes both of the given networks} Currency operators money COMP money comparison operators; COMP is any of =,<>,<,<=,>=,> } money OP money arthmetric operators; OP is any of +,-,/ } money * TYPE TYPE * money Multiply a currency with a numeric value; TYPE is any of int2,int4,float2,float4,float8 } money / TYPE Division of a currency by a numeric value; TYPE is any of int2,int4,float2,float4,float8 } money / money Division of currency values} UUID operators uuid COMP uuid comparison operator. COMP is any of =,<>,<,<=,>=,> } JSONB operators jsonb -> KEY Get a JSON object field specified by the KEY } jsonb -> NUM Get a JSON array element indexed by NUM } jsonb ->> KEY Get a JSON object field specified by the KEY , as text} jsonb ->> NUM Get a JSON array element indexed by NUM , as text} (jsonb ->> KEY)::TYPE If TYPE is any of int2,int4,int8,float4,float8,numeric , get a JSON object field specified by KEY , as numeric data type. See the note below.} (jsonb ->> NUM)::TYPE If TYPE is any of int2,int4,int8,float4,float8,numeric Get a JSON array element indexed by NUM , as numeric data type. See the note below.} jsonb ? KEY Check whether jsonb object contains the KEY } Note When we convert a jsonb element fetched by jsonb ->> KEY operator into numerical data types like float or numeric , PostgreSQL takes 2 steps operations; an internal numerical form is printed as text first, then it is converted into numerical data type. PG-Strom optimizes the GPU code using a special device function to fetch a numerical datum from jsonb object/array, if jsonb ->> KEY operator and text-to-numeric case are continuously used. PostGIS Functions geometry st_makepoint(float8,float8) geometry st_point(float8,float8) It makes 2-dimensional POINT geometry. geometry st_makepoint(float8,float8,float8) It makes 3-dimensional POINT geometry. geometry st_makepoint(float8,float8,float8,float8) It makes 4-dimensional POINT geometry. geometry st_setsrid(geometry,int4) It assigns SRID on the given geometry float8 st_distance(geometry,geometry) It returns the distance between geometries in float8 . bool st_dwithin(geometry,geometry,float8) It returns true if the distance between geometries is shorter than the specified threshold. It is often faster than the combination of st_distance and comparison operator. text st_relate(geometry,geometry) It checks intersection of geometries, then returns DE9-IM(Dimensionally Extended Nine-Intersection Matrix) format string. bool st_contains(geometry,geometry) It returns whether the geometry1 fully contains the geometry2. bool st_crosses(geometry,geometry) It returns whether the geometries are crossed. int4 st_linecrossingdirection(geometry,geometry) It checks how two LINESTRING geometries are crossing, or not crossing. CUBE Type Functions cube COMP cube comparison operators; COMP is any of =,<>,<,<=,>=,> } bool cube_contains(cube, cube) It returns whether the first cube fully contains the second cube. bool cube_contained(cube, cube) It returns whether the first cube is fully contained by the second cube. float8 cube_ll_coord(cube, int4)","title":"Functions and Operators"},{"location":"ref_devfuncs/#functions-and-operators","text":"This chapter introduces the functions and operators executable on GPU devices.","title":"Functions and operators"},{"location":"ref_devfuncs/#type-cast","text":"bool <-- int4 int1 <-- int2 , int4 , int8 , float2 , float4 , float8 , numeric int2 <-- int1 , int4 , int8 , float2 , float4 , float8 , numeric int4 <-- bool , int1 , int2 , int8 , float2 , float4 , float8 , numeric int8 <-- int1 , int2 , int4 , float2 , float4 , float8 , numeric float2 <-- int1 , int2 , int4 , int8 , float4 , float8 , numeric float4 <-- int1 , int2 , int4 , int8 , float2 , float8 , numeric float8 <-- int1 , int2 , int4 , int8 , float2 , float4 , numeric numeric <-- int1 , int2 , int4 , int8 , float2 , float4 , float8 money <-- int4 , int8 , numeric date <-- timestamp , timestamptz time <-- timetz , timestamp , timestamptz timetz <-- time , timestamptz timestamp <-- date , timestamptz timestamptz <-- date , timestamp","title":"Type cast"},{"location":"ref_devfuncs/#numeric-functionsoperators","text":"bool COMP bool comparison operators of boolean type. COMP is any of =,<> } INT COMP INT comparison operators of integer types. INT is any of int1,int2,int4,int8 . It is acceptable if left side and right side have different interger types. COMP is any of =,<>,<,<=,>=,> } FP COMP FP comparison operators of floating-point types. FP is any of float2,float4,float8 . It is acceptable if left side and right side have different floating-point types. COMP is any of =,<>,<,<=,>=,> } numeric COMP numeric comparison operators of numeric type. COMP is any of =,<>,<,<=,>=,> } INT OP INT arithemetic operators of integer types. INT is any of int1,int2,int4,int8 . It is acceptable if left side and right side have different interger types. OP is any of +,-,*,/ } FP OP FP arithemetic operators of floating-point types. FP is any of float2,float4,float8 . It is acceptable if left side and right side have different floating-point types. COMP is any of +,-,*,/ } numeric OP numeric comparison operators of numeric type. OP is any of +,-,*,/ } INT % INT Reminer operator. INT is any of int1,int2,int4,int8 } INT & INT Bitwise AND operator. INT is any of int1,int2,int4,int8 } INT | INT Bitwise OR operator. INT is any of int1,int2,int4,int8 } INT # INT Bitwise XOR operator. INT is any of int1,int2,int4,int8 } ~ INT Bitwise NOT operator. INT is any of int1,int2,int4,int8 } INT >> int4 Right shift operator. INT is any of int1,int2,int4,int8 } INT << int4 Left shift operator. INT is any of int1,int2,int4,int8 } + TYPE Unary plus operator. TYPE is any of int1,int2,int4,int8,float2,float4,float8,numeric .} - TYPE Unary minus operator. TYPE is any of int1,int2,int4,int8,float2,float4,float8,numeric .} @ TYPE Absolute value. TYPE is any of int1,int2,int4,int8,float2,float4,float8,numeric .}","title":"Numeric functions/operators"},{"location":"ref_devfuncs/#mathematical-functions","text":"float8 cbrt(float8) float8 dcbrt(float8) cube root float8 ceil(float8) float8 ceiling(float8) nearest integer greater than or equal to argument float8 exp(float8) float8 dexp(float8) exponential float8 floor(float8) nearest integer less than or equal to argument float8 ln(float8) float8 dlog1(float8) natural logarithm float8 log(float8) float8 dlog10(float8) base 10 logarithm float8 pi() circumference ratio float8 power(float8,float8) float8 pow(float8,float8) float8 dpow(float8,float8) power float8 round(float8) float8 dround(float8) round to the nearest integer float8 sign(float8) sign of the argument float8 sqrt(float8) float8 dsqrt(float8) square root| float8 trunc(float8) float8 dtrunc(float8) truncate toward zero|","title":"Mathematical functions"},{"location":"ref_devfuncs/#trigonometric-functions","text":"float8 degrees(float8) radians to degrees} float8 radians(float8) degrees to radians} float8 acos(float8) inverse cosine} float8 asin(float8) inverse sine} float8 atan(float8) inverse tangent} float8 atan2(float8,float8) inverse tangent of arg1 / arg2 } float8 cos(float8) cosine} float8 cot(float8) cotangent} float8 sin(float8) sine} float8 tan(float8) tangent}","title":"Trigonometric functions"},{"location":"ref_devfuncs/#date-and-time-operators","text":"date COMP date comparison operators for date type. COMP is any of =,<>,<,<=,>=,> .} date COMP timestamp timestamp COMP date comparison operators for date and timestamp type. COMP is any of =,<>,<,<=,>=,> .} date COMP timestamptz timestamptz COMP date comparison operators for date and timestamptz type. COMP is any of =,<>,<,<=,>=,> .} time COMP time comparison operators for time type. COMP is any of =,<>,<,<=,>=,> .} timetz COMP timetz comparison operators for timetz type. COMP is any of =,<>,<,<=,>=,> .} timestamp COMP timestamp comparison operators for timestamp type. COMP is any of =,<>,<,<=,>=,> .} timestamptz COMP timestamptz comparison operators for timestamptz type. COMP is any of =,<>,<,<=,>=,> .} timestamp COMP timestamptz timestamptz COMP timestamp comparison operators for timestamp and timestamptz type. COMP is any of =,<>,<,<=,>=,> .} interval COMP interval comparison operators for interval type. COMP is any of =,<>,<,<=,>=,> .} date + int4 int4 + date addition operator of date type} date - int4 subtraction operator of date type} date - date difference between date types} date + time time + date constructs a timestamp from date and time } date + timetz constructs a timestamptz from date and timetz } time - time difference between time types} timestamp - timestamp difference between timestamp types} timetz + interval timetz - interval addition or subtraction operator of timetz by interval .} timestamptz + interval timestamptz - interval addition or subtraction operator of timestamptz by interval .} overlaps(TYPE,TYPE,TYPE,TYPE) checks whether the 2 given time periods overlaps. TYPE is any of time,timetz,timestamp,timestamptz .} extract(text FROM TYPE) retrieves subfields such as day or hour from date/time values. TYPE is any of time,timetz,timestamp,timestamptz,interval .} now() current time of the transaction} - interval unary minus operator of interval type} interval + interval addition operator of interval type} interval - interval subtraction operator of interval type}","title":"Date and time operators"},{"location":"ref_devfuncs/#text-functionsoperators","text":"{text,bpchar} COMP {text,bpchar} comparison operators; COMP is any of =,<>,<,<=,>=,> Note that <,<=,>=,> operators are valid only when locale is UTF-8 or C (no locale).} substring(text,int4) substring(text,int4,int4) substr(text,int4) substr(text,int4,int4) extracts the substring} length({text,bpchar}) length of the string} {text,bpchar} [NOT] LIKE text pattern-matching according to the LIKE expression} {text,bpchar} [NOT] ILIKE text case-insensitive pattern-matching according to the LIKE expression. Note that ILIKE operator is valid only when locale is UTF-8 or C (no locale).}","title":"Text functions/operators"},{"location":"ref_devfuncs/#network-functionsoperators","text":"macaddr COMP macaddr comparison operators; COMP is any of =,<>,<,<=,>=,> } macaddr & macaddr Bitwise AND operator} macaddr | macaddr Bitwise OR operator} ~ macaddr Bitwise NOT operator} trunc(macaddr) Set last 3 bytes to zero} inet COMP inet comparison operators; COMP is any of =,<>,<,<=,>=,> } inet << inet Left side is contained by right side} inet <<= inet Left side is contained by or equals to right side} inet >> inet Left side contains right side} inet >>= inet Left side contains or is equals to right side} inet && inet Left side contains or is contained by right side} ~ inet Bitwise NOT operator} inet & inet Bitwise AND operator} inet | inet Bitwise OR operator} inet + int8 addition operator} inet - int8 subtraction operator} inet - inet subtraction operator} broadcast(inet) returns the broadcast address of the given network address} family(inet) returns the family of the given network address; 4 for IPv4, and 6 for IPv6} hostmask(inet) extract host mask of the given network address} masklen(inet) extract netmask length of the given network address} netmask(inet) extract netmask of the given network address} network(inet) extract network part of the given network address} set_masklen(NETADDR,int) set netmask length of the given network address; NETADDR is either inet or cidr .} inet_merge(inet,inet) the smallest network which includes both of the given networks}","title":"Network functions/operators"},{"location":"ref_devfuncs/#currency-operators","text":"money COMP money comparison operators; COMP is any of =,<>,<,<=,>=,> } money OP money arthmetric operators; OP is any of +,-,/ } money * TYPE TYPE * money Multiply a currency with a numeric value; TYPE is any of int2,int4,float2,float4,float8 } money / TYPE Division of a currency by a numeric value; TYPE is any of int2,int4,float2,float4,float8 } money / money Division of currency values}","title":"Currency operators"},{"location":"ref_devfuncs/#uuid-operators","text":"uuid COMP uuid comparison operator. COMP is any of =,<>,<,<=,>=,> }","title":"UUID operators"},{"location":"ref_devfuncs/#jsonb-operators","text":"jsonb -> KEY Get a JSON object field specified by the KEY } jsonb -> NUM Get a JSON array element indexed by NUM } jsonb ->> KEY Get a JSON object field specified by the KEY , as text} jsonb ->> NUM Get a JSON array element indexed by NUM , as text} (jsonb ->> KEY)::TYPE If TYPE is any of int2,int4,int8,float4,float8,numeric , get a JSON object field specified by KEY , as numeric data type. See the note below.} (jsonb ->> NUM)::TYPE If TYPE is any of int2,int4,int8,float4,float8,numeric Get a JSON array element indexed by NUM , as numeric data type. See the note below.} jsonb ? KEY Check whether jsonb object contains the KEY } Note When we convert a jsonb element fetched by jsonb ->> KEY operator into numerical data types like float or numeric , PostgreSQL takes 2 steps operations; an internal numerical form is printed as text first, then it is converted into numerical data type. PG-Strom optimizes the GPU code using a special device function to fetch a numerical datum from jsonb object/array, if jsonb ->> KEY operator and text-to-numeric case are continuously used.","title":"JSONB operators"},{"location":"ref_devfuncs/#postgis-functions","text":"geometry st_makepoint(float8,float8) geometry st_point(float8,float8) It makes 2-dimensional POINT geometry. geometry st_makepoint(float8,float8,float8) It makes 3-dimensional POINT geometry. geometry st_makepoint(float8,float8,float8,float8) It makes 4-dimensional POINT geometry. geometry st_setsrid(geometry,int4) It assigns SRID on the given geometry float8 st_distance(geometry,geometry) It returns the distance between geometries in float8 . bool st_dwithin(geometry,geometry,float8) It returns true if the distance between geometries is shorter than the specified threshold. It is often faster than the combination of st_distance and comparison operator. text st_relate(geometry,geometry) It checks intersection of geometries, then returns DE9-IM(Dimensionally Extended Nine-Intersection Matrix) format string. bool st_contains(geometry,geometry) It returns whether the geometry1 fully contains the geometry2. bool st_crosses(geometry,geometry) It returns whether the geometries are crossed. int4 st_linecrossingdirection(geometry,geometry) It checks how two LINESTRING geometries are crossing, or not crossing.","title":"PostGIS Functions"},{"location":"ref_devfuncs/#cube-type-functions","text":"cube COMP cube comparison operators; COMP is any of =,<>,<,<=,>=,> } bool cube_contains(cube, cube) It returns whether the first cube fully contains the second cube. bool cube_contained(cube, cube) It returns whether the first cube is fully contained by the second cube. float8 cube_ll_coord(cube, int4)","title":"CUBE Type Functions"},{"location":"ref_params/","text":"GUC Parameters This session introduces PG-Strom's configuration parameters. Enables/disables a particular feature pg_strom.enabled [type: bool / default: on] Enables/disables entire PG-Strom features at once pg_strom.enable_gpuscan [type: bool / default: on] Enables/disables GpuScan pg_strom.enable_gpuhashjoin [type: bool / default: on] Enables/disables JOIN by GpuHashJoin pg_strom.enable_gpugistindex [type: bool / default: on] Enables/disables JOIN by GpuGiSTIndex pg_strom.enable_gpujoin [type: bool / default: on] Enables/disables entire GpuJoin features (including GpuHashJoin and GpuGiSTIndex) pg_strom.enable_gpupreagg [type: bool / default: on] Enables/disables GpuPreAgg pg_strom.enable_numeric_aggfuncs [type: bool / default: on] Enables/disables support of aggregate function that takes numeric data type. Note that aggregated function at GPU mapps numeric data type to double precision floating point values. So, if you are sensitive to calculation errors, you can turn off this configuration to suppress the calculation errors by the operations on CPU. pg_strom.enable_brin [type: bool / default: on] Enables/disables BRIN index support on tables scan pg_strom.cpu_fallback [type: enum / default: notice ] Controls whether it actually run CPU fallback operations, if GPU program returned \"CPU ReCheck Error\" notice ... Runs CPU fallback operations with notice message on , true ... Runs CPU fallback operations with no message output off , false ... Disabled CPU fallback operations with an error pg_strom.regression_test_mode [type: bool / default: off] It disables some EXPLAIN command output that depends on software execution platform, like GPU model name. It avoid \"false-positive\" on the regression test, so use usually don't tough this configuration. Optimizer Configuration pg_strom.gpu_setup_cost [type: real / default: 100 * DEFAULT_SEQ_PAGE_COST ] Cost value for initialization of GPU device pg_strom.gpu_tuple_cost [type: real / default: DEFAULT_CPU_TUPLE_COST ] Cost value to send tuples to, or receive tuples from GPU for each. pg_strom.gpu_operator_cost [type: real / default: DEFAULT_CPU_OPERATOR_COST / 16 ] Cost value to process an expression formula on GPU. If larger value than cpu_operator_cost is configured, no chance to choose PG-Strom towards any size of tables pg_strom.enable_partitionwise_gpujoin [type: bool / default: on] Enables/disables whether GpuJoin is pushed down to the partition children. pg_strom.enable_partitionwise_gpupreagg [type: bool / default: on] Enables/disables whether GpuPreAgg is pushed down to the partition children. pg_strom.pinned_inner_buffer_threshold [type: int / \u521d\u671f\u5024: 0 ] If the INNER table of GpuJoin is either GpuScan or GpuJoin, and the estimated size of its processing result is larger than this configured value, the result is retained on the GPU device without being returned to the CPU, and then reused as a part of the INNER buffer of the subsequent GpuJoin. If the configured value is 0 , this function will be disabled. Executor Configuration pg_strom.max_async_tasks [type: int / default: 12 ] Max number of asynchronous taks PG-Strom can submit to the GPU execution queue, and is also the number of GPU Service worker threads. GPUDirect SQL Configuration pg_strom.gpudirect_driver [type: text ] It shows the driver software name of GPUDirect SQL (read-only). Either cufile , nvme-strom or vfs pg_strom.gpudirect_enabled [type: bool / default: on ] Enables/disables GPUDirect SQL feature. pg_strom.gpu_direct_seq_page_cost [type: real / default: DEFAULT_SEQ_PAGE_COST / 4 ] The cost of scanning a table using GPU-Direct SQL, instead of the seq_page_cost , when the optimizer calculates the cost of an execution plan. pg_strom.gpudirect_threshold [type: int / default: auto] Controls the table-size threshold to invoke GPUDirect SQL feature. The default is auto configuration; a threshold calculated by the system physical memory size and shared_buffers configuration. pg_strom.manual_optimal_gpus [type: text / default: none] It manually configures the closest GPU for the target storage volumn, like NVME device or NFS volume. Its format string is: {|/path/to/tablespace}=gpuX[:gpuX...] . It describes relationship between the closest GPU and NVME device or tablespace directory path. It accepts multiple configurations separated by comma character. Example: pg_strom.manual_optimal_gpus = 'nvme1=gpu0,nvme2=gpu1,/mnt/nfsroot=gpu0' means a GPU with device identifier X. means a local NVME-SSD or a remote NVME-oF device. /path/to/tablespace means full-path of the tablespace directory. Automatic configuration is often sufficient for local NVME-SSD drives, however, you should manually configure the closest GPU for NVME-oF or NFS-over-RDMA volumes. Arrow_Fdw Configuration arrow_fdw.enabled [type: bool / default: on ] By adjustment of estimated cost value, it turns on/off Arrow_Fdw. Note that only Foreign Scan (Arrow_Fdw) can scan on Arrow files, if GpuScan is not capable to run on. arrow_fdw.stats_hint_enabled [type: bool / default: on ] When Arrow file has min/max statistics, this parameter controls whether unnecessary record-batches shall be skipped, or not. arrow_fdw.metadata_cache_size [type: int / default: 512MB ] Size of shared memory to cache metadata of Arrow files. Once consumption of the shared memory exceeds this value, the older metadata shall be released based on LRU. GPU Cache configuration pg_strom.enable_gpucache [type: bool / default: on ] Controls whether search/analytic query tries to use GPU Cache. Note that GPU Cache trigger functions continue to update the REDO Log buffer, even if this parameter is turned off. pg_strom.gpucache_auto_preload [type: text / default: null ] It specifies the table names to be loaded onto GPU Cache just after PostgreSQL startup. Its format is DATABASE_NAME.SCHEMA_NAME.TABLE_NAME , and separated by comma if multiple tables are preloaded. Initial-loading of GPU Cache usually takes a lot of time. So, preloading enables to avoid delay of response time of search/analytic queries on the first time. If this parameter is '*', PG-Strom tries to load all the configured tables onto GPU Cache sequentially. GPU Device Configuration pg_strom.gpu_mempool_segment_sz [type: int / default: 1GB ] The segment size when GPU Service allocates GPU device memory for the memory pool. GPU device memory allocation is a relatively heavy process, so it is recommended to use memory pools to reuse memory. pg_strom.gpu_mempool_max_ratio [type: real / default: 50% ] It specifies the percentage of device memory that can be used for the GPU device memory memory pool. It works to suppress excessive GPU device memory consumption by the memory pool and ensure sufficient working memory. pg_strom.gpu_mempool_min_ratio [type: real / default: 5% ] It specify the percentage of GPU device memory that is preserved as the memory pool segment, and remained even after memory usage. By maintaining a minimum memory pool, the next query can be executed quickly. pg_strom.gpu_mempool_release_delay [type: int / default: 5000 ] GPU Service does not release a segment of a memory pool immediately, even if it becomes empty. When the time specified by this parameter (in milliseconds) has elapsed since the segment was last used, it is released and returned to the system. By inserting a certain delay, you can reduce the frequency of GPU device memory allocation/release. pg_strom.gpuserv_debug_output [type: bool / default: false ] Enable/disable GPU Service debug message output. This message may be useful for debugging, but normally you should not change it from the default value. pg_strom.cuda_visible_devices [type: text / default: null ] List of GPU device numbers in comma separated, if you want to recognize particular GPUs on PostgreSQL startup. It is equivalent to the environment variable CUDAVISIBLE_DEVICES","title":"GUC Parameters"},{"location":"ref_params/#guc-parameters","text":"This session introduces PG-Strom's configuration parameters.","title":"GUC Parameters"},{"location":"ref_params/#enablesdisables-a-particular-feature","text":"pg_strom.enabled [type: bool / default: on] Enables/disables entire PG-Strom features at once pg_strom.enable_gpuscan [type: bool / default: on] Enables/disables GpuScan pg_strom.enable_gpuhashjoin [type: bool / default: on] Enables/disables JOIN by GpuHashJoin pg_strom.enable_gpugistindex [type: bool / default: on] Enables/disables JOIN by GpuGiSTIndex pg_strom.enable_gpujoin [type: bool / default: on] Enables/disables entire GpuJoin features (including GpuHashJoin and GpuGiSTIndex) pg_strom.enable_gpupreagg [type: bool / default: on] Enables/disables GpuPreAgg pg_strom.enable_numeric_aggfuncs [type: bool / default: on] Enables/disables support of aggregate function that takes numeric data type. Note that aggregated function at GPU mapps numeric data type to double precision floating point values. So, if you are sensitive to calculation errors, you can turn off this configuration to suppress the calculation errors by the operations on CPU. pg_strom.enable_brin [type: bool / default: on] Enables/disables BRIN index support on tables scan pg_strom.cpu_fallback [type: enum / default: notice ] Controls whether it actually run CPU fallback operations, if GPU program returned \"CPU ReCheck Error\" notice ... Runs CPU fallback operations with notice message on , true ... Runs CPU fallback operations with no message output off , false ... Disabled CPU fallback operations with an error pg_strom.regression_test_mode [type: bool / default: off] It disables some EXPLAIN command output that depends on software execution platform, like GPU model name. It avoid \"false-positive\" on the regression test, so use usually don't tough this configuration.","title":"Enables/disables a particular feature"},{"location":"ref_params/#optimizer-configuration","text":"pg_strom.gpu_setup_cost [type: real / default: 100 * DEFAULT_SEQ_PAGE_COST ] Cost value for initialization of GPU device pg_strom.gpu_tuple_cost [type: real / default: DEFAULT_CPU_TUPLE_COST ] Cost value to send tuples to, or receive tuples from GPU for each. pg_strom.gpu_operator_cost [type: real / default: DEFAULT_CPU_OPERATOR_COST / 16 ] Cost value to process an expression formula on GPU. If larger value than cpu_operator_cost is configured, no chance to choose PG-Strom towards any size of tables pg_strom.enable_partitionwise_gpujoin [type: bool / default: on] Enables/disables whether GpuJoin is pushed down to the partition children. pg_strom.enable_partitionwise_gpupreagg [type: bool / default: on] Enables/disables whether GpuPreAgg is pushed down to the partition children. pg_strom.pinned_inner_buffer_threshold [type: int / \u521d\u671f\u5024: 0 ] If the INNER table of GpuJoin is either GpuScan or GpuJoin, and the estimated size of its processing result is larger than this configured value, the result is retained on the GPU device without being returned to the CPU, and then reused as a part of the INNER buffer of the subsequent GpuJoin. If the configured value is 0 , this function will be disabled.","title":"Optimizer Configuration"},{"location":"ref_params/#executor-configuration","text":"pg_strom.max_async_tasks [type: int / default: 12 ] Max number of asynchronous taks PG-Strom can submit to the GPU execution queue, and is also the number of GPU Service worker threads.","title":"Executor Configuration"},{"location":"ref_params/#gpudirect-sql-configuration","text":"pg_strom.gpudirect_driver [type: text ] It shows the driver software name of GPUDirect SQL (read-only). Either cufile , nvme-strom or vfs pg_strom.gpudirect_enabled [type: bool / default: on ] Enables/disables GPUDirect SQL feature. pg_strom.gpu_direct_seq_page_cost [type: real / default: DEFAULT_SEQ_PAGE_COST / 4 ] The cost of scanning a table using GPU-Direct SQL, instead of the seq_page_cost , when the optimizer calculates the cost of an execution plan. pg_strom.gpudirect_threshold [type: int / default: auto] Controls the table-size threshold to invoke GPUDirect SQL feature. The default is auto configuration; a threshold calculated by the system physical memory size and shared_buffers configuration. pg_strom.manual_optimal_gpus [type: text / default: none] It manually configures the closest GPU for the target storage volumn, like NVME device or NFS volume. Its format string is: {|/path/to/tablespace}=gpuX[:gpuX...] . It describes relationship between the closest GPU and NVME device or tablespace directory path. It accepts multiple configurations separated by comma character. Example: pg_strom.manual_optimal_gpus = 'nvme1=gpu0,nvme2=gpu1,/mnt/nfsroot=gpu0' means a GPU with device identifier X. means a local NVME-SSD or a remote NVME-oF device. /path/to/tablespace means full-path of the tablespace directory. Automatic configuration is often sufficient for local NVME-SSD drives, however, you should manually configure the closest GPU for NVME-oF or NFS-over-RDMA volumes.","title":"GPUDirect SQL Configuration"},{"location":"ref_params/#arrow_fdw-configuration","text":"arrow_fdw.enabled [type: bool / default: on ] By adjustment of estimated cost value, it turns on/off Arrow_Fdw. Note that only Foreign Scan (Arrow_Fdw) can scan on Arrow files, if GpuScan is not capable to run on. arrow_fdw.stats_hint_enabled [type: bool / default: on ] When Arrow file has min/max statistics, this parameter controls whether unnecessary record-batches shall be skipped, or not. arrow_fdw.metadata_cache_size [type: int / default: 512MB ] Size of shared memory to cache metadata of Arrow files. Once consumption of the shared memory exceeds this value, the older metadata shall be released based on LRU.","title":"Arrow_Fdw Configuration"},{"location":"ref_params/#gpu-cache-configuration","text":"pg_strom.enable_gpucache [type: bool / default: on ] Controls whether search/analytic query tries to use GPU Cache. Note that GPU Cache trigger functions continue to update the REDO Log buffer, even if this parameter is turned off. pg_strom.gpucache_auto_preload [type: text / default: null ] It specifies the table names to be loaded onto GPU Cache just after PostgreSQL startup. Its format is DATABASE_NAME.SCHEMA_NAME.TABLE_NAME , and separated by comma if multiple tables are preloaded. Initial-loading of GPU Cache usually takes a lot of time. So, preloading enables to avoid delay of response time of search/analytic queries on the first time. If this parameter is '*', PG-Strom tries to load all the configured tables onto GPU Cache sequentially.","title":"GPU Cache configuration"},{"location":"ref_params/#gpu-device-configuration","text":"pg_strom.gpu_mempool_segment_sz [type: int / default: 1GB ] The segment size when GPU Service allocates GPU device memory for the memory pool. GPU device memory allocation is a relatively heavy process, so it is recommended to use memory pools to reuse memory. pg_strom.gpu_mempool_max_ratio [type: real / default: 50% ] It specifies the percentage of device memory that can be used for the GPU device memory memory pool. It works to suppress excessive GPU device memory consumption by the memory pool and ensure sufficient working memory. pg_strom.gpu_mempool_min_ratio [type: real / default: 5% ] It specify the percentage of GPU device memory that is preserved as the memory pool segment, and remained even after memory usage. By maintaining a minimum memory pool, the next query can be executed quickly. pg_strom.gpu_mempool_release_delay [type: int / default: 5000 ] GPU Service does not release a segment of a memory pool immediately, even if it becomes empty. When the time specified by this parameter (in milliseconds) has elapsed since the segment was last used, it is released and returned to the system. By inserting a certain delay, you can reduce the frequency of GPU device memory allocation/release. pg_strom.gpuserv_debug_output [type: bool / default: false ] Enable/disable GPU Service debug message output. This message may be useful for debugging, but normally you should not change it from the default value. pg_strom.cuda_visible_devices [type: text / default: null ] List of GPU device numbers in comma separated, if you want to recognize particular GPUs on PostgreSQL startup. It is equivalent to the environment variable CUDAVISIBLE_DEVICES","title":"GPU Device Configuration"},{"location":"ref_sqlfuncs/","text":"SQL Objects This chapter introduces SQL objects additionally provided by PG-Strom. System Information pgstrom.device_info System View It shows properties of GPU devices installed for PG-Strom. Below is schema definition of the view. name type description gpu_id int GPU device number att_name text Attribute name att_value text Attribute value att_desc text Attribute description There are various kind of GPU device properties, but depending on the CUDA driver version where system is running. So, pgstrom.device_info system view identifies the target property by GPU device identifier ( gpu_id ) and attribute name ( att_name ). Below is an example of pgstrom.device_info system view. postgres=# select * from pgstrom.gpu_device_info limit 10; gpu_id | att_name | att_value | att_desc --------+-----------------------+------------------------------------------+------------------------------------- 0 | DEV_NAME | NVIDIA A100-PCIE-40GB | GPU Device Name 0 | DEV_ID | 0 | GPU Device ID 0 | DEV_UUID | GPU-13943bfd-5b30-38f5-0473-78979c134606 | GPU Device UUID 0 | DEV_TOTAL_MEMSZ | 39.39GB | GPU Total RAM Size 0 | DEV_BAR1_MEMSZ | 64.00GB | GPU PCI Bar1 Size 0 | NUMA_NODE_ID | -1 | GPU NUMA Node Id 0 | MAX_THREADS_PER_BLOCK | 1024 | Maximum number of threads per block 0 | MAX_BLOCK_DIM_X | 1024 | Maximum block dimension X 0 | MAX_BLOCK_DIM_Y | 1024 | Maximum block dimension Y 0 | MAX_BLOCK_DIM_Z | 64 | Maximum block dimension Z (10 rows) Arrow_Fdw fdw_handler pgstrom.arrow_fdw_handler() FDW handler function of Arrow_Fdw. Usually, users don't need to invoke this function. void pgstrom.arrow_fdw_validator(text[], oid) FDW options validation function of Arrow_Fdw. Usually, users don't need to invoke this function. event_trigger pgstrom.arrow_fdw_precheck_schema() Event trigger function to validate schema definition of Arrow files. Usually, users don't need to invoke this function. void pgstrom.arrow_fdw_import_file(text, text, text = null) This function tries to import Apache Arrow file, and defines a new foreign table. Its first argument is name of the new foreign table, the second argument is path of the Apache Arrow file, and the optional third argument is the schema name. This function is similar to IMPORT FOREIGN SCHEMA statement, but allows to import Apache Arrow files that have wider fields than the limitation of number of columns in PostgreSQL ( MaxTupleAttributeNumber = 1664). So, we recommend to use IMPORT FOREIGN SCHEMA statement for most cases. The example below shows the steps to import an Apache Arrow file with 2000 of Int16 fields by the pgstrom.arrow_fdw_import_file . The result of \\d mytest shows this foreign table has 2000 fields. Due to the internal data format of PostgreSQL, it is not possible to read all the columns at once, but possible to read a part of columns like the last example. =# select pgstrom.arrow_fdw_import_file('mytest', '/tmp/wide2000.arrow'); arrow_fdw_import_file ----------------------- (1 row) =# \\d List of relations Schema | Name | Type | Owner --------+--------+---------------+-------- public | mytest | foreign table | kaigai (1 row) =# \\d mytest Foreign table \"public.mytest\" Column | Type | Collation | Nullable | Default | FDW options -----------+----------+-----------+----------+---------+------------- object_id | integer | | | | c000 | smallint | | | | c001 | smallint | | | | c002 | smallint | | | | c003 | smallint | | | | : : : : : : c1997 | smallint | | | | c1998 | smallint | | | | c1999 | smallint | | | | Server: arrow_fdw FDW options: (file '/tmp/wide2000.arrow') =# select * from mytest ; ERROR: target lists can have at most 1664 entries =# select c0010,c1234,c1999 from mytest limit 3; c0010 | c1234 | c1999 -------+-------+------- 232 | 232 | 232 537 | 537 | 537 219 | 219 | 219 (3 rows) GPU Cache pgstrom.gpucache_info System View It shows the current status of GPU Cache. Below is schema definition of the view. name type description database_oid oid Database OID where the table with GPU Cache belongs to. database_name text Database name where the table with GPU Cache belongs to. table_oid oid Table OID that has GPU Cache. Note that it may not be in the current database. table_name text Table name that has GPU Cache. Note that it may not be in the current database. signature int8 An identifier hash value of GPU Cache. It may be changed after ALTER TABLE for example. phase text Phase of GPU cache construction: either not_built , is_empty , is_loading , is_ready , or corrupted rowid_num_used int8 Number of allocated row-id rowid_num_free int8 Number of free row-id gpu_main_sz int8 Size of the fixed-length values area on the GPU Cache. gpu_main_nitems int8 Number of tuples on the GPU Cache. gpu_extra_sz int8 Size of the variable-length values area on the GPU Cache. gpu_extra_usage int8 Size of the used variable-length values area on the GPU Cache. gpu_extra_dead int8 Size of the free variable-length values area on the GPU Cache. redo_write_ts timestamptz Last update timestamp on the REDO Log buffer redo_write_nitems int8 Total number of REDO Log entries written to the REDO Log buffer. redo_write_pos int8 Total bytes of REDO Log entries written to the REDO Log buffer. redo_read_nitems int8 Total number of REDO Log entries read from REDO Log buffer, and already applied to. redo_read_pos int8 Total bytes of REDO Log entries read from REDO Log buffer, and already applied to. redo_sync_pos int8 The latest position on the REDO Log buffer, where it is already required the background worker to synchronize onto the GPU Cache. When free space of REDO Log buffer becomes tight, it is internally used to avoid flood of simultaneous asynchronized requests by many sessions. config_options text Options string of the GPU Cache Below is an example of pgstrom.gpucache_info system view. =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | phase | rowid_num_used | rowid_num_free | gpu_main_sz | gpu_main_nitems | gpu_extra_sz | gpu_extra_usage | gpu_extra_dead | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------------+------------+----------+----------------+----------------+-------------+-----------------+--------------+-----------------+----------------+-------------------------------+-------------------+----------------+------------------+---------------+---------------+--------------------------------------------------------------------------------------------------------------------- 193450 | hoge | 603029 | cache_test_table | 4529357070 | is_ready | 4000 | 6000 | 439904 | 4000 | 3200024 | 473848 | 0 | 2023-12-18 01:25:42.850193+09 | 4000 | 603368 | 4000 | 603368 | 603368 | gpu_device_id=0,max_num_rows=10000,redo_buffer_size=157286400,gpu_sync_interval=4000000,gpu_sync_threshold=10485760 (1 row) trigger pgstrom.gpucache_sync_trigger() A trigger function to synchronize GPU Cache on table updates. See GPU Cache chapter for more details. bigint pgstrom.gpucache_apply_redo(regclass) If the given table has GPU Cache configured, it forcibly applies the REDO log entries onto the GPU Cache. bigint pgstrom.gpucache_compaction(regclass) If the given table has GPU Cache configured, it forcibly run compaction of the variable-length data buffer. bigint pgstrom.gpucache_recovery(regclass) It tries to recover the corrupted GPU cache. Test Data Generator void pgstrom.random_setseed(int) It initializes the random seed. bigint pgstrom.random_int(float=0.0, bigint=0, bigint=INT_MAX) It generates random data in bigint type within the range. float pgstrom.random_float(float=0.0, float=0.0, float=1.0) It generates random data in float type within the range. date pgstrom.random_date(float=0.0, date='2015-01-01', date='2025-12-31') It generates random data in date type within the range. time pgstrom.random_time(float=0.0, time='00:00:00', time='23:59:59') It generates random data in time type within the range. timetz pgstrom.random_timetz(float=0.0, time='00:00:00', time='23:59:59') It generates random data in timetz type within the range. timestamp pgstrom.random_timestamp(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') It generates random data in timestamp type within the range. macaddr pgstrom.random_macaddr(float=0.0, macaddr='ab:cd:00:00:00', macaddr='ab:cd:ff:ff:ff:ff') It generates random data in macaddr type within the range. inet pgstrom.random_inet(float=0.0, inet='192.168.0.1/16') It generates random data in inet type within the range. text pgstrom.random_text(float=0.0, text='test_**') It generates random data in text type. The '*' characters in 2nd argument shall be replaced randomly. text pgstrom.random_text_len(float=0.0, int=10) It generates random data in text type within the specified length. int4range pgstrom.random_int4range(float=0.0, bigint=0, bigint=INT_MAX) It generates random data in int4range type within the range.} int8range pgstrom.random_int8range(float=0.0, bigint=0, bigint=LONG_MAX) It generates random data in int8range type within the range. tsrange pgstrom.random_tsrange(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') It generates random data in tsrange type within the range. tstzrange pgstrom.random_tstzrange(float=0.0, timestamptz='2015-01-01', timestamptz='2025-01-01') It generates random data in tstzrange type within the range. daterange pgstrom.random_daterange(float=0.0, date='2015-01-01', date='2025-12-31') It generates random data in daterange type within the range. Other Functions text pgstrom.githash() It displays the hash value of the source code revision from the currently loaded PG-Strom module is based. This value is useful in determining the software revision in the event of a failure. postgres=# select pgstrom.githash(); githash ------------------------------------------ 103984be24cafd1e7ce6330a050960d97675c196 text pgstrom.license_query() It displays the active commercial subscription, if loaded. =# select pgstrom.license_query(); license_query ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2020-11-24\", \"expired_at\" : \"2025-12-31\", \"gpus\" : [ { \"uuid\" : \"GPU-8ba149db-53d8-c5f3-0f55-97ce8cfadb28\" } ]} (1 row)","title":"SQL Objects"},{"location":"ref_sqlfuncs/#sql-objects","text":"This chapter introduces SQL objects additionally provided by PG-Strom.","title":"SQL Objects"},{"location":"ref_sqlfuncs/#system-information","text":"pgstrom.device_info System View It shows properties of GPU devices installed for PG-Strom. Below is schema definition of the view. name type description gpu_id int GPU device number att_name text Attribute name att_value text Attribute value att_desc text Attribute description There are various kind of GPU device properties, but depending on the CUDA driver version where system is running. So, pgstrom.device_info system view identifies the target property by GPU device identifier ( gpu_id ) and attribute name ( att_name ). Below is an example of pgstrom.device_info system view. postgres=# select * from pgstrom.gpu_device_info limit 10; gpu_id | att_name | att_value | att_desc --------+-----------------------+------------------------------------------+------------------------------------- 0 | DEV_NAME | NVIDIA A100-PCIE-40GB | GPU Device Name 0 | DEV_ID | 0 | GPU Device ID 0 | DEV_UUID | GPU-13943bfd-5b30-38f5-0473-78979c134606 | GPU Device UUID 0 | DEV_TOTAL_MEMSZ | 39.39GB | GPU Total RAM Size 0 | DEV_BAR1_MEMSZ | 64.00GB | GPU PCI Bar1 Size 0 | NUMA_NODE_ID | -1 | GPU NUMA Node Id 0 | MAX_THREADS_PER_BLOCK | 1024 | Maximum number of threads per block 0 | MAX_BLOCK_DIM_X | 1024 | Maximum block dimension X 0 | MAX_BLOCK_DIM_Y | 1024 | Maximum block dimension Y 0 | MAX_BLOCK_DIM_Z | 64 | Maximum block dimension Z (10 rows)","title":"System Information"},{"location":"ref_sqlfuncs/#arrow_fdw","text":"fdw_handler pgstrom.arrow_fdw_handler() FDW handler function of Arrow_Fdw. Usually, users don't need to invoke this function. void pgstrom.arrow_fdw_validator(text[], oid) FDW options validation function of Arrow_Fdw. Usually, users don't need to invoke this function. event_trigger pgstrom.arrow_fdw_precheck_schema() Event trigger function to validate schema definition of Arrow files. Usually, users don't need to invoke this function. void pgstrom.arrow_fdw_import_file(text, text, text = null) This function tries to import Apache Arrow file, and defines a new foreign table. Its first argument is name of the new foreign table, the second argument is path of the Apache Arrow file, and the optional third argument is the schema name. This function is similar to IMPORT FOREIGN SCHEMA statement, but allows to import Apache Arrow files that have wider fields than the limitation of number of columns in PostgreSQL ( MaxTupleAttributeNumber = 1664). So, we recommend to use IMPORT FOREIGN SCHEMA statement for most cases. The example below shows the steps to import an Apache Arrow file with 2000 of Int16 fields by the pgstrom.arrow_fdw_import_file . The result of \\d mytest shows this foreign table has 2000 fields. Due to the internal data format of PostgreSQL, it is not possible to read all the columns at once, but possible to read a part of columns like the last example. =# select pgstrom.arrow_fdw_import_file('mytest', '/tmp/wide2000.arrow'); arrow_fdw_import_file ----------------------- (1 row) =# \\d List of relations Schema | Name | Type | Owner --------+--------+---------------+-------- public | mytest | foreign table | kaigai (1 row) =# \\d mytest Foreign table \"public.mytest\" Column | Type | Collation | Nullable | Default | FDW options -----------+----------+-----------+----------+---------+------------- object_id | integer | | | | c000 | smallint | | | | c001 | smallint | | | | c002 | smallint | | | | c003 | smallint | | | | : : : : : : c1997 | smallint | | | | c1998 | smallint | | | | c1999 | smallint | | | | Server: arrow_fdw FDW options: (file '/tmp/wide2000.arrow') =# select * from mytest ; ERROR: target lists can have at most 1664 entries =# select c0010,c1234,c1999 from mytest limit 3; c0010 | c1234 | c1999 -------+-------+------- 232 | 232 | 232 537 | 537 | 537 219 | 219 | 219 (3 rows)","title":"Arrow_Fdw"},{"location":"ref_sqlfuncs/#gpu-cache","text":"pgstrom.gpucache_info System View It shows the current status of GPU Cache. Below is schema definition of the view. name type description database_oid oid Database OID where the table with GPU Cache belongs to. database_name text Database name where the table with GPU Cache belongs to. table_oid oid Table OID that has GPU Cache. Note that it may not be in the current database. table_name text Table name that has GPU Cache. Note that it may not be in the current database. signature int8 An identifier hash value of GPU Cache. It may be changed after ALTER TABLE for example. phase text Phase of GPU cache construction: either not_built , is_empty , is_loading , is_ready , or corrupted rowid_num_used int8 Number of allocated row-id rowid_num_free int8 Number of free row-id gpu_main_sz int8 Size of the fixed-length values area on the GPU Cache. gpu_main_nitems int8 Number of tuples on the GPU Cache. gpu_extra_sz int8 Size of the variable-length values area on the GPU Cache. gpu_extra_usage int8 Size of the used variable-length values area on the GPU Cache. gpu_extra_dead int8 Size of the free variable-length values area on the GPU Cache. redo_write_ts timestamptz Last update timestamp on the REDO Log buffer redo_write_nitems int8 Total number of REDO Log entries written to the REDO Log buffer. redo_write_pos int8 Total bytes of REDO Log entries written to the REDO Log buffer. redo_read_nitems int8 Total number of REDO Log entries read from REDO Log buffer, and already applied to. redo_read_pos int8 Total bytes of REDO Log entries read from REDO Log buffer, and already applied to. redo_sync_pos int8 The latest position on the REDO Log buffer, where it is already required the background worker to synchronize onto the GPU Cache. When free space of REDO Log buffer becomes tight, it is internally used to avoid flood of simultaneous asynchronized requests by many sessions. config_options text Options string of the GPU Cache Below is an example of pgstrom.gpucache_info system view. =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | phase | rowid_num_used | rowid_num_free | gpu_main_sz | gpu_main_nitems | gpu_extra_sz | gpu_extra_usage | gpu_extra_dead | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------------+------------+----------+----------------+----------------+-------------+-----------------+--------------+-----------------+----------------+-------------------------------+-------------------+----------------+------------------+---------------+---------------+--------------------------------------------------------------------------------------------------------------------- 193450 | hoge | 603029 | cache_test_table | 4529357070 | is_ready | 4000 | 6000 | 439904 | 4000 | 3200024 | 473848 | 0 | 2023-12-18 01:25:42.850193+09 | 4000 | 603368 | 4000 | 603368 | 603368 | gpu_device_id=0,max_num_rows=10000,redo_buffer_size=157286400,gpu_sync_interval=4000000,gpu_sync_threshold=10485760 (1 row) trigger pgstrom.gpucache_sync_trigger() A trigger function to synchronize GPU Cache on table updates. See GPU Cache chapter for more details. bigint pgstrom.gpucache_apply_redo(regclass) If the given table has GPU Cache configured, it forcibly applies the REDO log entries onto the GPU Cache. bigint pgstrom.gpucache_compaction(regclass) If the given table has GPU Cache configured, it forcibly run compaction of the variable-length data buffer. bigint pgstrom.gpucache_recovery(regclass) It tries to recover the corrupted GPU cache.","title":"GPU Cache"},{"location":"ref_sqlfuncs/#test-data-generator","text":"void pgstrom.random_setseed(int) It initializes the random seed. bigint pgstrom.random_int(float=0.0, bigint=0, bigint=INT_MAX) It generates random data in bigint type within the range. float pgstrom.random_float(float=0.0, float=0.0, float=1.0) It generates random data in float type within the range. date pgstrom.random_date(float=0.0, date='2015-01-01', date='2025-12-31') It generates random data in date type within the range. time pgstrom.random_time(float=0.0, time='00:00:00', time='23:59:59') It generates random data in time type within the range. timetz pgstrom.random_timetz(float=0.0, time='00:00:00', time='23:59:59') It generates random data in timetz type within the range. timestamp pgstrom.random_timestamp(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') It generates random data in timestamp type within the range. macaddr pgstrom.random_macaddr(float=0.0, macaddr='ab:cd:00:00:00', macaddr='ab:cd:ff:ff:ff:ff') It generates random data in macaddr type within the range. inet pgstrom.random_inet(float=0.0, inet='192.168.0.1/16') It generates random data in inet type within the range. text pgstrom.random_text(float=0.0, text='test_**') It generates random data in text type. The '*' characters in 2nd argument shall be replaced randomly. text pgstrom.random_text_len(float=0.0, int=10) It generates random data in text type within the specified length. int4range pgstrom.random_int4range(float=0.0, bigint=0, bigint=INT_MAX) It generates random data in int4range type within the range.} int8range pgstrom.random_int8range(float=0.0, bigint=0, bigint=LONG_MAX) It generates random data in int8range type within the range. tsrange pgstrom.random_tsrange(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') It generates random data in tsrange type within the range. tstzrange pgstrom.random_tstzrange(float=0.0, timestamptz='2015-01-01', timestamptz='2025-01-01') It generates random data in tstzrange type within the range. daterange pgstrom.random_daterange(float=0.0, date='2015-01-01', date='2025-12-31') It generates random data in daterange type within the range.","title":"Test Data Generator"},{"location":"ref_sqlfuncs/#other-functions","text":"text pgstrom.githash() It displays the hash value of the source code revision from the currently loaded PG-Strom module is based. This value is useful in determining the software revision in the event of a failure. postgres=# select pgstrom.githash(); githash ------------------------------------------ 103984be24cafd1e7ce6330a050960d97675c196 text pgstrom.license_query() It displays the active commercial subscription, if loaded. =# select pgstrom.license_query(); license_query ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2020-11-24\", \"expired_at\" : \"2025-12-31\", \"gpus\" : [ { \"uuid\" : \"GPU-8ba149db-53d8-c5f3-0f55-97ce8cfadb28\" } ]} (1 row)","title":"Other Functions"},{"location":"ref_types/","text":"Data Types PG-Strom support the following data types for use on GPU device. Numeric types int1 [length: 1byte] 8bit integer data type; enhanced data type by PG-Strom int2 (alias smallint ) [length: 2bytes] 16bit integer data type int4 (alias int ) [length: 4bytes] 32bit integer data type int8 (alias bigint ) [length: 8bytes] 64bit integer data type float2 [length: 2bytes] Half precision data type; enhanced data type by PG-Strom Note Even though GPU supports half-precision floating-point numbers by hardware, CPU (x86_64 processor) does not support it yet. So, when CPU processes float2 data types, it transform them to float or double on calculations. So, CPU has no advantages for calculation performance of float2 , unlike GPU. It is a feature to save storage/memory capacity for machine-learning / statistical-analytics. float4 (alias real ) [length: 4bytes] Single precision floating-point data type float8 (alias double precision ) [length: 8bytes] Double precision floating-point data type numeric [length: variable] Real number data type; handled as a 128bit fixed-point value in GPU Note When GPU processes values in numeric data type, it is converted to an internal 128bit fixed-point number because of implementation reason. (This layout is identical to Decimal type in Apache Arrow.) It is transparently converted to/from the internal format, on the other hands, PG-Strom cannot convert numaric datum with large number of digits, so tries to fallback operations by CPU. Therefore, it may lead slowdown if numeric data with large number of digits are supplied to GPU device. To avoid the problem, turn off the GUC option pg_strom.enable_numeric_type not to run operational expression including numeric data types on GPU devices. Date and time types date [length: 4bytes] Date data type time (alias time without time zone ) [length: 8bytes] Time data type timetz (alias time with time zone ) [length: 12bytes] Time with timezone data type timestamp (alias timestamp without time zone ) [length: 8bytes] Timestamp data type timestamptz (alias timestamp with time zone ) [length: 8bytes] Timestamp with timezone data type interval [length: 16bytes] Interval data type Variable length types bpchar [length: variable] variable length text with whitespace paddings varchar [length: variable] variable length text type text [length: variable] variable length text type bytea [length: variable] variable length binary type unstructured data types jsonb [length: variable] JSON data type with binary indexed keys Note Pay attention for the two points below, when GPU processes jsonb data types. jsonb is not performance efficient data types because it has to load unreferenced attributes onto GPU from the storage, so tend to consume I/O bandwidth by junk data. In case when jsonb data length exceeds the threshold of datum TOASTen , entire jsonb value is written out to TOAST table, thus, GPU cannot process these values and invokes inefficient CPU-fallback operations. Regarding to the 2nd problem, you can extend table's storage option toast_tuple_target to enlarge the threshold for datum TOASTen. Miscellaneous types boolean [length: 1byte] Boolean data type money [length: 8bytes] Money data type uuid [length: 16bytes] UUID data type macaddr [length: 6bytes] Network MAC address data type inet [length: 7 or 19bytes] Network address data type cidr [length: 7 or 19butes] Network address data type cube [length: variable] Extra data type provided by contrib/cube Geometry data types geometry [length: variable] Geometry object of PostGIS box2df [length: 16bytes] 2-dimension bounding box (used to GiST-index)","title":"Data Types"},{"location":"ref_types/#data-types","text":"PG-Strom support the following data types for use on GPU device.","title":"Data Types"},{"location":"ref_types/#numeric-types","text":"int1 [length: 1byte] 8bit integer data type; enhanced data type by PG-Strom int2 (alias smallint ) [length: 2bytes] 16bit integer data type int4 (alias int ) [length: 4bytes] 32bit integer data type int8 (alias bigint ) [length: 8bytes] 64bit integer data type float2 [length: 2bytes] Half precision data type; enhanced data type by PG-Strom Note Even though GPU supports half-precision floating-point numbers by hardware, CPU (x86_64 processor) does not support it yet. So, when CPU processes float2 data types, it transform them to float or double on calculations. So, CPU has no advantages for calculation performance of float2 , unlike GPU. It is a feature to save storage/memory capacity for machine-learning / statistical-analytics. float4 (alias real ) [length: 4bytes] Single precision floating-point data type float8 (alias double precision ) [length: 8bytes] Double precision floating-point data type numeric [length: variable] Real number data type; handled as a 128bit fixed-point value in GPU Note When GPU processes values in numeric data type, it is converted to an internal 128bit fixed-point number because of implementation reason. (This layout is identical to Decimal type in Apache Arrow.) It is transparently converted to/from the internal format, on the other hands, PG-Strom cannot convert numaric datum with large number of digits, so tries to fallback operations by CPU. Therefore, it may lead slowdown if numeric data with large number of digits are supplied to GPU device. To avoid the problem, turn off the GUC option pg_strom.enable_numeric_type not to run operational expression including numeric data types on GPU devices.","title":"Numeric types"},{"location":"ref_types/#date-and-time-types","text":"date [length: 4bytes] Date data type time (alias time without time zone ) [length: 8bytes] Time data type timetz (alias time with time zone ) [length: 12bytes] Time with timezone data type timestamp (alias timestamp without time zone ) [length: 8bytes] Timestamp data type timestamptz (alias timestamp with time zone ) [length: 8bytes] Timestamp with timezone data type interval [length: 16bytes] Interval data type","title":"Date and time types"},{"location":"ref_types/#variable-length-types","text":"bpchar [length: variable] variable length text with whitespace paddings varchar [length: variable] variable length text type text [length: variable] variable length text type bytea [length: variable] variable length binary type","title":"Variable length types"},{"location":"ref_types/#unstructured-data-types","text":"jsonb [length: variable] JSON data type with binary indexed keys Note Pay attention for the two points below, when GPU processes jsonb data types. jsonb is not performance efficient data types because it has to load unreferenced attributes onto GPU from the storage, so tend to consume I/O bandwidth by junk data. In case when jsonb data length exceeds the threshold of datum TOASTen , entire jsonb value is written out to TOAST table, thus, GPU cannot process these values and invokes inefficient CPU-fallback operations. Regarding to the 2nd problem, you can extend table's storage option toast_tuple_target to enlarge the threshold for datum TOASTen.","title":"unstructured data types"},{"location":"ref_types/#miscellaneous-types","text":"boolean [length: 1byte] Boolean data type money [length: 8bytes] Money data type uuid [length: 16bytes] UUID data type macaddr [length: 6bytes] Network MAC address data type inet [length: 7 or 19bytes] Network address data type cidr [length: 7 or 19butes] Network address data type cube [length: variable] Extra data type provided by contrib/cube","title":"Miscellaneous types"},{"location":"ref_types/#geometry-data-types","text":"geometry [length: variable] Geometry object of PostGIS box2df [length: 16bytes] 2-dimension bounding box (used to GiST-index)","title":"Geometry data types"},{"location":"release_v2.0/","text":"PG-Strom v2.0 Release PG-Strom Development Team (17-Apr-2018) Overview Major enhancement in PG-Strom v2.0 includes: Overall redesign of the internal infrastructure to manage GPU and stabilization CPU+GPU hybrid parallel execution SSD-to-GPU Direct SQL Execution In-memory columnar cache GPU memory store (gstore_fdw) Redesign of GpuJoin and GpuPreAgg and speed-up GpuPreAgg + GpuJoin + GpuScan combined GPU kernel You can download the summary of new features from: PG-Strom v2.0 Technical Brief . Prerequisites PostgreSQL v9.6, v10 CUDA Toolkit 9.1 Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or Volta) New Features Entire re-design and stabilization of the internal infrastructure to manage GPU device. PostgreSQL backend process simultaneously uses only one GPU at most. In case of multi-GPUs installation, it assumes combination use with CPU parallel execution of PostgreSQL. Usually, it is not a matter because throughput of CPU to provide data to GPU is much narrower than capability of GPU processors. We prioritized simpleness of the software architecture. We began to utilize the demand paging feature of GPU device memory supported at the GPU models since Pascal generation. In most of SQL workloads, we cannot know exact size of the required result buffer prior to its execution, therefore, we had allocated more buffer than estimated buffer length, and retried piece of the workloads if estimated buffer size is not sufficient actually. This design restricts available resources of GPU which can be potentially used for other concurrent processes, and complicated error-retry logic was a nightmare for software quality. The demand paging feature allows to eliminate and simplify these stuffs. We stop to use CUDA asynchronous interface. Use of the demand paging feature on GPU device memory makes asynchronous APIs for DMA (like cuMemCpyHtoD ) perform synchronously, then it reduces concurrency and usage ratio of GPU kernels. Instead of the CUDA asynchronous APIs, PG-Strom manages its own worker threads which call synchronous APIs for each. As a by-product, we also could eliminate asynchronous callbacks ( cuStreamAddCallback ), it allows to use MPS daemon which has a restriction at this API. CPU+GPU Hybrid Parallel Execution CPU parallel execution at PostgreSQL v9.6 is newly supported. CustomScan logic of GpuScan, GpuJoin and GpuPreAgg provided by PG-Strom are executable on multiple background worker processes of PostgreSQL in parallel. Limitation: PG-Strom's own statistics displayed at EXPLAIN ANALYZE if CPU parallel execution. Because PostgreSQL v9.6 does not provide ShutdownCustomScan callback of the CustomScan interface, coordinator process has no way to reclaim information of worker processes prior to the release of DSM (Dynamic Shared Memory) segment. SSD-to-GPU Direct SQL Execution By cooperation with the nvme_strom Linux kernel module, it enables to load PostgreSQL's data blocks on NVMe-SSD to GPU device memory directly, bypassing the CPU and host buffer. This feature enables to apply PG-Strom on the area which have to process large data set more than system RAM size. It allows to pull out pretty high throughput close to the hardware limitation because its data stream skips block-device or filesystem layer. Then, GPU runs SQL workloads that usually reduce the amount of data to be processed by CPU. The chemical reaction of these characteristics enables to redefine GPU's role as accelerator of I/O workloads also, not only computing intensive workloads. In-memory Columnar Cache For middle size data-set loadable onto the system RAM, it allows to cache data-blocks in column format which is more suitable for GPU computing. If cached data-blocks are found during table scan, PG-Strom prefers to reference the columnar cache more than shared buffer of PostgreSQL. In-memory columnar cache can be built synchronously, or asynchronously by the background workers. You may remember very early revision of PG-Strom had similar feature. In case when a cached tuple gets updated, the latest in-memory columnar cache which we newly implemented in v2.0 invalidates the cache block which includes the updated tuples. It never updates the columnar cache according to the updates of row-store, so performance degradation is quite limited. GPU Memory Store (gstore_fdw) It enables to write to / read from preserved GPU device memory region by SELECT/INSERT/UPDATE/DELETE in SQL-level, using foreign table interface. In v2.0, only pgstrom internal data format is supported. It saves written data using PG-Strom's buffer format of KDS_FORMAT_COLUMN . It can compress variable length data using LZ algorithm. In v2.0, GPU memory store can be used as data source of PL/CUDA user defined function. Redesign and performance improvement of GpuJoin and GpuPreAgg Stop using Dynamic Parallelism which we internally used in GpuJoin and GpuPreAgg, and revised entire logic of these operations. Old design had a problem of less GPU usage ratio because a GPU kernel which launches GPU sub-kernel and just waits for its completion occupied GPU's execution slot. A coproduct of this redesign is suspend/resume of GpuJoin. In principle, JOIN operation of SQL may generate larger number of rows than number of input rows, but preliminary not predictive. The new design allows to suspend GPU kernel once buffer available space gets lacked, then resume with new result buffer. It simplifies size estimation logic of the result buffer, and eliminates GPU kernel retry by lack of buffer on run-time. GpuPreAgg+GpuJoin+GpuScan combined GPU kernel In case when GPU executable SCAN, JOIN and GROUP BY are serially cascaded, a single GPU kernel invocation runs a series of tasks equivalent to the GpuScan, GpuJoin and GpuPreAgg. This is an approach to minimize data exchange between CPU and GPU. For example, result buffer of GpuJoin is used as input buffer of GpuPreAgg. This feature is especially valuable if combined with SSD-to-GPU Direct SQL Execution. PL/CUDA Enhancement #plcuda_include is enhanced to specify SQL function which returns text type. It can change the code block to inject according to the argument, so it also allows to generate multiple GPU kernel variations, not only inclusion of externally defined functions. If PL/CUDA takes reggstore type argument, GPU kernel function receives pointer of the GPU memory store. Note that it does not pass the OID value. Other Enhancement lo_import_gpu and lo_export_gpu functions allows to import contents of the GPU device memory acquired by external applications directly, or export contents of the largeobject to the GPU device memory. Packaging Add RPM packages to follow the PostgreSQL packages distributed by PostgreSQL Global Development Group. All the software packages are available at HeteroDB SWDC(Software Distribution Center) and downloadable. Document PG-Strom documentation was entirely rewritten using markdown and mkdocs. It makes documentation maintenance easier than the previous HTML based approach, so expects timely updates according to the development of new features. Test Regression test for PG-Strom was built on top of the regression test framework of PostgreSQL. Dropped features PostgreSQL v9.5 Support PostgreSQL v9.6 had big changes in both of the optimizer and executor to support CPU parallel query execution. The biggest change for extension modules that interact them is an enhancement of the interface called \"upper planner path-ification\". It allows to choose an optimal execution-plan from the multiple candidates based on the estimated cost, even if it is aggregation or sorting. It is fundamentally different from the older way where we rewrote query execution plan to inject GpuPreAgg using the hooks. It allows to inject GpuPreAgg node in more reasonable and reliable way, and we could drop complicated (and buggy) logic to rewrite query execution plan once constructed. CustomScan interface is also enhanced to support CPU parallel execution. Due to the reason, we dropped PostgreSQL v9.5 support to follow these new enhancement. GpuSort feature We dropped GpuSort because we have little advantages in the performance. Sorting is one of the GPU suitable workloads. However, in case when we try to sort data blocks larger than GPU device memory, we have to split the data blocks into multiple chunks, then partially sort them and merge them by CPU to generate final results. Larger chunk size is better to reduce the load to merge multiple chunks by CPU, on the other hands, larger chunk size takes larger lead time to launch GPU kernel to sort. It means here is a trade-off; which disallows asynchronous processing by PG-Strom to make data transfer latency invisible. It is hard to solve the problem, or too early to solve the problem, we dropped GpuSort feature once.","title":"PG-Strom v2.0"},{"location":"release_v2.0/#pg-strom-v20-release","text":"PG-Strom Development Team (17-Apr-2018)","title":"PG-Strom v2.0 Release"},{"location":"release_v2.0/#overview","text":"Major enhancement in PG-Strom v2.0 includes: Overall redesign of the internal infrastructure to manage GPU and stabilization CPU+GPU hybrid parallel execution SSD-to-GPU Direct SQL Execution In-memory columnar cache GPU memory store (gstore_fdw) Redesign of GpuJoin and GpuPreAgg and speed-up GpuPreAgg + GpuJoin + GpuScan combined GPU kernel You can download the summary of new features from: PG-Strom v2.0 Technical Brief .","title":"Overview"},{"location":"release_v2.0/#prerequisites","text":"PostgreSQL v9.6, v10 CUDA Toolkit 9.1 Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or Volta)","title":"Prerequisites"},{"location":"release_v2.0/#new-features","text":"Entire re-design and stabilization of the internal infrastructure to manage GPU device. PostgreSQL backend process simultaneously uses only one GPU at most. In case of multi-GPUs installation, it assumes combination use with CPU parallel execution of PostgreSQL. Usually, it is not a matter because throughput of CPU to provide data to GPU is much narrower than capability of GPU processors. We prioritized simpleness of the software architecture. We began to utilize the demand paging feature of GPU device memory supported at the GPU models since Pascal generation. In most of SQL workloads, we cannot know exact size of the required result buffer prior to its execution, therefore, we had allocated more buffer than estimated buffer length, and retried piece of the workloads if estimated buffer size is not sufficient actually. This design restricts available resources of GPU which can be potentially used for other concurrent processes, and complicated error-retry logic was a nightmare for software quality. The demand paging feature allows to eliminate and simplify these stuffs. We stop to use CUDA asynchronous interface. Use of the demand paging feature on GPU device memory makes asynchronous APIs for DMA (like cuMemCpyHtoD ) perform synchronously, then it reduces concurrency and usage ratio of GPU kernels. Instead of the CUDA asynchronous APIs, PG-Strom manages its own worker threads which call synchronous APIs for each. As a by-product, we also could eliminate asynchronous callbacks ( cuStreamAddCallback ), it allows to use MPS daemon which has a restriction at this API. CPU+GPU Hybrid Parallel Execution CPU parallel execution at PostgreSQL v9.6 is newly supported. CustomScan logic of GpuScan, GpuJoin and GpuPreAgg provided by PG-Strom are executable on multiple background worker processes of PostgreSQL in parallel. Limitation: PG-Strom's own statistics displayed at EXPLAIN ANALYZE if CPU parallel execution. Because PostgreSQL v9.6 does not provide ShutdownCustomScan callback of the CustomScan interface, coordinator process has no way to reclaim information of worker processes prior to the release of DSM (Dynamic Shared Memory) segment. SSD-to-GPU Direct SQL Execution By cooperation with the nvme_strom Linux kernel module, it enables to load PostgreSQL's data blocks on NVMe-SSD to GPU device memory directly, bypassing the CPU and host buffer. This feature enables to apply PG-Strom on the area which have to process large data set more than system RAM size. It allows to pull out pretty high throughput close to the hardware limitation because its data stream skips block-device or filesystem layer. Then, GPU runs SQL workloads that usually reduce the amount of data to be processed by CPU. The chemical reaction of these characteristics enables to redefine GPU's role as accelerator of I/O workloads also, not only computing intensive workloads. In-memory Columnar Cache For middle size data-set loadable onto the system RAM, it allows to cache data-blocks in column format which is more suitable for GPU computing. If cached data-blocks are found during table scan, PG-Strom prefers to reference the columnar cache more than shared buffer of PostgreSQL. In-memory columnar cache can be built synchronously, or asynchronously by the background workers. You may remember very early revision of PG-Strom had similar feature. In case when a cached tuple gets updated, the latest in-memory columnar cache which we newly implemented in v2.0 invalidates the cache block which includes the updated tuples. It never updates the columnar cache according to the updates of row-store, so performance degradation is quite limited. GPU Memory Store (gstore_fdw) It enables to write to / read from preserved GPU device memory region by SELECT/INSERT/UPDATE/DELETE in SQL-level, using foreign table interface. In v2.0, only pgstrom internal data format is supported. It saves written data using PG-Strom's buffer format of KDS_FORMAT_COLUMN . It can compress variable length data using LZ algorithm. In v2.0, GPU memory store can be used as data source of PL/CUDA user defined function. Redesign and performance improvement of GpuJoin and GpuPreAgg Stop using Dynamic Parallelism which we internally used in GpuJoin and GpuPreAgg, and revised entire logic of these operations. Old design had a problem of less GPU usage ratio because a GPU kernel which launches GPU sub-kernel and just waits for its completion occupied GPU's execution slot. A coproduct of this redesign is suspend/resume of GpuJoin. In principle, JOIN operation of SQL may generate larger number of rows than number of input rows, but preliminary not predictive. The new design allows to suspend GPU kernel once buffer available space gets lacked, then resume with new result buffer. It simplifies size estimation logic of the result buffer, and eliminates GPU kernel retry by lack of buffer on run-time. GpuPreAgg+GpuJoin+GpuScan combined GPU kernel In case when GPU executable SCAN, JOIN and GROUP BY are serially cascaded, a single GPU kernel invocation runs a series of tasks equivalent to the GpuScan, GpuJoin and GpuPreAgg. This is an approach to minimize data exchange between CPU and GPU. For example, result buffer of GpuJoin is used as input buffer of GpuPreAgg. This feature is especially valuable if combined with SSD-to-GPU Direct SQL Execution. PL/CUDA Enhancement #plcuda_include is enhanced to specify SQL function which returns text type. It can change the code block to inject according to the argument, so it also allows to generate multiple GPU kernel variations, not only inclusion of externally defined functions. If PL/CUDA takes reggstore type argument, GPU kernel function receives pointer of the GPU memory store. Note that it does not pass the OID value. Other Enhancement lo_import_gpu and lo_export_gpu functions allows to import contents of the GPU device memory acquired by external applications directly, or export contents of the largeobject to the GPU device memory. Packaging Add RPM packages to follow the PostgreSQL packages distributed by PostgreSQL Global Development Group. All the software packages are available at HeteroDB SWDC(Software Distribution Center) and downloadable. Document PG-Strom documentation was entirely rewritten using markdown and mkdocs. It makes documentation maintenance easier than the previous HTML based approach, so expects timely updates according to the development of new features. Test Regression test for PG-Strom was built on top of the regression test framework of PostgreSQL.","title":"New Features"},{"location":"release_v2.0/#dropped-features","text":"PostgreSQL v9.5 Support PostgreSQL v9.6 had big changes in both of the optimizer and executor to support CPU parallel query execution. The biggest change for extension modules that interact them is an enhancement of the interface called \"upper planner path-ification\". It allows to choose an optimal execution-plan from the multiple candidates based on the estimated cost, even if it is aggregation or sorting. It is fundamentally different from the older way where we rewrote query execution plan to inject GpuPreAgg using the hooks. It allows to inject GpuPreAgg node in more reasonable and reliable way, and we could drop complicated (and buggy) logic to rewrite query execution plan once constructed. CustomScan interface is also enhanced to support CPU parallel execution. Due to the reason, we dropped PostgreSQL v9.5 support to follow these new enhancement. GpuSort feature We dropped GpuSort because we have little advantages in the performance. Sorting is one of the GPU suitable workloads. However, in case when we try to sort data blocks larger than GPU device memory, we have to split the data blocks into multiple chunks, then partially sort them and merge them by CPU to generate final results. Larger chunk size is better to reduce the load to merge multiple chunks by CPU, on the other hands, larger chunk size takes larger lead time to launch GPU kernel to sort. It means here is a trade-off; which disallows asynchronous processing by PG-Strom to make data transfer latency invisible. It is hard to solve the problem, or too early to solve the problem, we dropped GpuSort feature once.","title":"Dropped features"},{"location":"release_v2.2/","text":"PG-Strom v2.2 Release PG-Strom Development Team (1-May-2019) Overview Major enhancement in PG-Strom v2.2 includes: Table partitioning support Columnar store support with Arrow_Fdw Pre-built GPU binary support Enables to implement GPU functions that returns variable length data GpuSort support on GPU memory store (Gstore_Fdw) NVME-oF support (Experimental) Prerequisites PostgreSQL v9.6, v10, v11 CUDA Toolkit 10.1 Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or Volta) New Features Table partitioning support If multi-GPUs configuration, an optimal GPU shall be chosen according to the physical distance between GPU and child tables that construct a partition. If PG-Strom cannot identify the distance from PCIe-bus topology, like NVME-oF configuration, DBA can configure the relation of GPU and NVME-SSD using pg_strom.nvme_distance_map . When we join a partitioned table with non-partition tables, this version can produce a query execution plan that preliminary joins the non-partitioned table with partition child tables for each, and gather the results from child tables. This feature is proposed to PostgreSQL v13 core, as Asymmetric Partition-wise JOIN. Columnar store support with Arrow_Fdw It supports to read external Apache Arrow files using foreign table. It also supports SSD-to-GPU Direct SQL on Apache Arrow files. Pre-built GPU binary support When GPU binary code is generated from SQL, the older version wrote out eitire CUDA C source code, including static portions like libraries, then NVRTC(NVIDIA Run-Time Compiker) built them on the fly. However, a part of complicated function consumed much longer compilation time. v2.2 preliminary builds static functions preliminary, and only dynamic portion from SQL are built dynamically. It reduces the time for GPU binary generation. JSONB data type support This version allows to reference elements of JSONB object, and to utilize them as numeric or test . Enables to implement GPU functions that returns variable length data This version allows to implement SQL functions that returns variable-length data, like textcat , on GPU devices. GpuSort support on GPU memory store (Gstore_Fdw) This version allows to read data from GPU memory store for SQL workloads execution, not only PL/CUDA. Addition of regression test Several simple regression tests are added. NVME-oF support (Experimental) It supports SSD-to-GPU Direct SQL from remote SSD disks which are mounted using NVME-over-Fabric. Please note that it is an experimental feature, and it needs to replace the nvme_rdma kernel module on Red Hat Enterprise Linux 7.x / CentOS 7.x. Features to be deprecated PostgreSQL v9.6 support CustomScan API in PostgreSQL v9.6 lacks a few APIs to handle dynamic shared memory (DSM), so it is unable to collect run-time statistics. It also changes the way to keep expression objects internally, therefore, we had to put #if ... #endif blocks at no little points. It has damaged to code maintainability. Due to the problems, this is the last version to support PostgreSQL v9.6. If you applied PG-Strom on PostgreSQL v9.6, let us recommend to move PostgreSQL v11 as soon as possible. The pgstrom format of Gstore_Fdw foreign table The internal data format on GPU memory store (Gstore_Fdw) is originally designed for data source of PL/CUDA procedures. It is our own format, and used PostgreSQL's data representations as is, like variable-length data, numeric, and so on. After that, NVIDIA released RAPIDS(cuDF), based on Apache Arrow, for data exchange on GPU, then its adoption becomes wider on machine-learning application and Python software stack. PG-Strom will switch its internal data format of Gstore_Fdw, to improve interoperability with these machine-learning software, then existing data format shall be deprecated. Dropped Features In-memory columnar cache As results of use-case analysis, we concluded Arrow_Fdw can replace this feature in most cases. Due to feature duplication, we dropped the in-memory columnar cache.","title":"PG-Strom v2.2"},{"location":"release_v2.2/#pg-strom-v22-release","text":"PG-Strom Development Team (1-May-2019)","title":"PG-Strom v2.2 Release"},{"location":"release_v2.2/#overview","text":"Major enhancement in PG-Strom v2.2 includes: Table partitioning support Columnar store support with Arrow_Fdw Pre-built GPU binary support Enables to implement GPU functions that returns variable length data GpuSort support on GPU memory store (Gstore_Fdw) NVME-oF support (Experimental)","title":"Overview"},{"location":"release_v2.2/#prerequisites","text":"PostgreSQL v9.6, v10, v11 CUDA Toolkit 10.1 Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or Volta)","title":"Prerequisites"},{"location":"release_v2.2/#new-features","text":"Table partitioning support If multi-GPUs configuration, an optimal GPU shall be chosen according to the physical distance between GPU and child tables that construct a partition. If PG-Strom cannot identify the distance from PCIe-bus topology, like NVME-oF configuration, DBA can configure the relation of GPU and NVME-SSD using pg_strom.nvme_distance_map . When we join a partitioned table with non-partition tables, this version can produce a query execution plan that preliminary joins the non-partitioned table with partition child tables for each, and gather the results from child tables. This feature is proposed to PostgreSQL v13 core, as Asymmetric Partition-wise JOIN. Columnar store support with Arrow_Fdw It supports to read external Apache Arrow files using foreign table. It also supports SSD-to-GPU Direct SQL on Apache Arrow files. Pre-built GPU binary support When GPU binary code is generated from SQL, the older version wrote out eitire CUDA C source code, including static portions like libraries, then NVRTC(NVIDIA Run-Time Compiker) built them on the fly. However, a part of complicated function consumed much longer compilation time. v2.2 preliminary builds static functions preliminary, and only dynamic portion from SQL are built dynamically. It reduces the time for GPU binary generation. JSONB data type support This version allows to reference elements of JSONB object, and to utilize them as numeric or test . Enables to implement GPU functions that returns variable length data This version allows to implement SQL functions that returns variable-length data, like textcat , on GPU devices. GpuSort support on GPU memory store (Gstore_Fdw) This version allows to read data from GPU memory store for SQL workloads execution, not only PL/CUDA. Addition of regression test Several simple regression tests are added. NVME-oF support (Experimental) It supports SSD-to-GPU Direct SQL from remote SSD disks which are mounted using NVME-over-Fabric. Please note that it is an experimental feature, and it needs to replace the nvme_rdma kernel module on Red Hat Enterprise Linux 7.x / CentOS 7.x.","title":"New Features"},{"location":"release_v2.2/#features-to-be-deprecated","text":"PostgreSQL v9.6 support CustomScan API in PostgreSQL v9.6 lacks a few APIs to handle dynamic shared memory (DSM), so it is unable to collect run-time statistics. It also changes the way to keep expression objects internally, therefore, we had to put #if ... #endif blocks at no little points. It has damaged to code maintainability. Due to the problems, this is the last version to support PostgreSQL v9.6. If you applied PG-Strom on PostgreSQL v9.6, let us recommend to move PostgreSQL v11 as soon as possible. The pgstrom format of Gstore_Fdw foreign table The internal data format on GPU memory store (Gstore_Fdw) is originally designed for data source of PL/CUDA procedures. It is our own format, and used PostgreSQL's data representations as is, like variable-length data, numeric, and so on. After that, NVIDIA released RAPIDS(cuDF), based on Apache Arrow, for data exchange on GPU, then its adoption becomes wider on machine-learning application and Python software stack. PG-Strom will switch its internal data format of Gstore_Fdw, to improve interoperability with these machine-learning software, then existing data format shall be deprecated.","title":"Features to be deprecated"},{"location":"release_v2.2/#dropped-features","text":"In-memory columnar cache As results of use-case analysis, we concluded Arrow_Fdw can replace this feature in most cases. Due to feature duplication, we dropped the in-memory columnar cache.","title":"Dropped Features"},{"location":"release_v2.3/","text":"PG-Strom v2.3 Release PG-Strom Development Team (1-Apr-2020) Overview Major changes in PG-Strom v2.3 includes: GpuJoin supports parallel construction of inner buffer Arrow_Fdw now becomes writable; supports INSERT/TRUNCATE. pg2arrow command supports 'append' mode. mysql2arrow command was added. Prerequisites PostgreSQL v10, v11, v12 CUDA Toolkit 10.1 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or Volta) New Features GpuJoin supports parallel construction of inner buffer The older version construct inner buffer of GpuJoin by the backend process only. This restriction leads a problem; parallel scan of partitioned table delays extremely. This version allows both of the backend and worker processes to construct inner buffer. In case when we scan a partitioned table, any processes that is assigned to a particular child table can start GpuJoin operations immediately. Refactoring of the partition-wise asymmetric GpuJoin By the refactoring of the partition-wise asymmetric GpuJoin, optimizer becomes to prefer multi-level GpuJoin in case when it offers cheaper execution cost. Arrow_Fdw becomes writable; INSERT/TRUNCATE supported Arrow_Fdw foreign table allows bulk-loading by INSERT and data elimination by pgstrom.arrow_fdw_truncate . pg2arrow command supports 'append' mode. We added --append option for pg2arrow command. As literal, it appends query results on existing Apache Arrow file. Also, -t table option was added as an alias of SELECT * FROM table . mysql2arrow command was added. We added mysql2arrow command that connects to MySQL server, not PostgreSQL, and write out SQL query results as Apache Arrow files. It has equivalent functionality to pg2arrow except for enum data type. mysql2arrow saves enum values as flat Utf8 values without DictionaryBatch chunks. Regression test was added Several test cases were added according to the PostgreSQL regression test framework. Significant bug fixes Revised cache invalidation logic for GPU device functions / types The older version had invalidated all the metadata cache entries of GPU device functions / type on execution of ALTER command. It was revised to invalidate the entries that are actually updated. Revised extreme performance degradation if GROUP BY has same grouping key twice or even number times. GpuPreAgg combined hash values of grouping key of GROUP BY using XOR. So, if case when same column appeared even number time, it always leads 0 for hash-index problematically. Now we add a randomization for better hash distribution. Potential infinite loop on GpuScan By uninitialized values, GpuScan potentially goes to infinite loop when SSD2GPU Direct SQL is available. Potential GPU kernel crash on GpuJoin By uninitialized values, GpuJoin potentially makes GPU kernel crash when 3 or more tables are joined. Deprecated Features PostgreSQL v9.6 Support CustomScan API in PostgreSQL v9.6 lacks a few APIs to handle dynamic shared memory (DSM). It has been a problem to handle a common code for v10 or later. To avoid the problem, we dropped PostgreSQL v9.6 support in this version. PL/CUDA According to the usecase analytics, users prefer familiar programming language environment like Python, rather than own special environment. A combination of Arrow_Fdw's GPU export functionality and CuPy invocation at PL/Python is a successor of PL/CUDA, for in-database machine-learning / statistical analytics. Gstore_Fdw This feature is replaced by the writable Arrow_Fdw and its GPU export functionality. Largeobject export to/import from GPU According to the usecase analytics, we determined this feature is not needed.","title":"PG-Strom v2.3"},{"location":"release_v2.3/#pg-strom-v23-release","text":"PG-Strom Development Team (1-Apr-2020)","title":"PG-Strom v2.3 Release"},{"location":"release_v2.3/#overview","text":"Major changes in PG-Strom v2.3 includes: GpuJoin supports parallel construction of inner buffer Arrow_Fdw now becomes writable; supports INSERT/TRUNCATE. pg2arrow command supports 'append' mode. mysql2arrow command was added.","title":"Overview"},{"location":"release_v2.3/#prerequisites","text":"PostgreSQL v10, v11, v12 CUDA Toolkit 10.1 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or Volta)","title":"Prerequisites"},{"location":"release_v2.3/#new-features","text":"GpuJoin supports parallel construction of inner buffer The older version construct inner buffer of GpuJoin by the backend process only. This restriction leads a problem; parallel scan of partitioned table delays extremely. This version allows both of the backend and worker processes to construct inner buffer. In case when we scan a partitioned table, any processes that is assigned to a particular child table can start GpuJoin operations immediately. Refactoring of the partition-wise asymmetric GpuJoin By the refactoring of the partition-wise asymmetric GpuJoin, optimizer becomes to prefer multi-level GpuJoin in case when it offers cheaper execution cost. Arrow_Fdw becomes writable; INSERT/TRUNCATE supported Arrow_Fdw foreign table allows bulk-loading by INSERT and data elimination by pgstrom.arrow_fdw_truncate . pg2arrow command supports 'append' mode. We added --append option for pg2arrow command. As literal, it appends query results on existing Apache Arrow file. Also, -t table option was added as an alias of SELECT * FROM table . mysql2arrow command was added. We added mysql2arrow command that connects to MySQL server, not PostgreSQL, and write out SQL query results as Apache Arrow files. It has equivalent functionality to pg2arrow except for enum data type. mysql2arrow saves enum values as flat Utf8 values without DictionaryBatch chunks. Regression test was added Several test cases were added according to the PostgreSQL regression test framework.","title":"New Features"},{"location":"release_v2.3/#significant-bug-fixes","text":"Revised cache invalidation logic for GPU device functions / types The older version had invalidated all the metadata cache entries of GPU device functions / type on execution of ALTER command. It was revised to invalidate the entries that are actually updated. Revised extreme performance degradation if GROUP BY has same grouping key twice or even number times. GpuPreAgg combined hash values of grouping key of GROUP BY using XOR. So, if case when same column appeared even number time, it always leads 0 for hash-index problematically. Now we add a randomization for better hash distribution. Potential infinite loop on GpuScan By uninitialized values, GpuScan potentially goes to infinite loop when SSD2GPU Direct SQL is available. Potential GPU kernel crash on GpuJoin By uninitialized values, GpuJoin potentially makes GPU kernel crash when 3 or more tables are joined.","title":"Significant bug fixes"},{"location":"release_v2.3/#deprecated-features","text":"PostgreSQL v9.6 Support CustomScan API in PostgreSQL v9.6 lacks a few APIs to handle dynamic shared memory (DSM). It has been a problem to handle a common code for v10 or later. To avoid the problem, we dropped PostgreSQL v9.6 support in this version. PL/CUDA According to the usecase analytics, users prefer familiar programming language environment like Python, rather than own special environment. A combination of Arrow_Fdw's GPU export functionality and CuPy invocation at PL/Python is a successor of PL/CUDA, for in-database machine-learning / statistical analytics. Gstore_Fdw This feature is replaced by the writable Arrow_Fdw and its GPU export functionality. Largeobject export to/import from GPU According to the usecase analytics, we determined this feature is not needed.","title":"Deprecated Features"},{"location":"release_v3.0/","text":"PG-Strom v3.0 Release PG-Strom Development Team (29-Jun-2021) Overview Major changes in PG-Strom v3.0 are as follows: NVIDIA GPUDirect Storage (cuFile) is now supported. Several PostGIS functions are executable on GPUs. GpuJoin using GiST index is now supported. GPU Cache mechanism is newly implemented. User-defined GPU data types/functions/operators are experimentally supported. Software license was switched from GPLv2 to PostgreSQL license. Prerequisites PostgreSQL v11, v12, v13 CUDA Toolkit 11.2 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or newer) NVIDIA GPUDirect Storage GPUDirect Storage , has been developed by NVIDIA, is now supported as a driver for GPU Direct SQL , in addition to the existing nvme_strom kernel module. Both of drivers have almost equivalent functionalities and performance, but supports of GPUDirect Storage enables P2P direct read from NVME-oF (NVME over Fabrics) devices, SDS (Software Defined Storage) devices and shared filesystem built on these devices. Therefore, it offers larger and more flexible storage configuration. We can use GPUDirect SQL to scan PostgreSQL's heap table and Apache Arrow files. It can expect significant performance improvement for the workloads where table scans are the major bottleneck, in either driver cases. The performance measurement below is by SSBM (Star Schema Benchmark) using 1xGPU and 4xNVME-SSDs under the GPUDirect Storage driver. It shows number of rows processed per unit time is significantly improved regardless of the storage system; either PostgreSQL heap or Apache Arrow. In comparison of the read throughput from NVME-SSD drives during the query execution, it shows the table scan by GPUDirect Storage pulls out almost optimal performance close to the hardware limitation, much faster than the scan by filesystem (PostgreSQL Heap Storage). GPU-PostGIS and GiST-index We have implemented GPU versions of several PostGIS functions. When these PostGIS functions are used in qualifier clauses (like, WHERE-clause), PG-Strom will automatically generate a GPU program to execute it on the GPU. The main target of GPU version of PostGIS is the workload to check the real-time location data of mobile devices, like smartphones or vehicles, against the area definition data like boundary of municipality or school districts. For example, when you want to deliver an advertisement to smartphonws in a particular area, or when you want to deliver traffic jam information to cara in a particular area, it is effective in the process of searching for the corresponding device using the position as a key. In the following example, it creates 16 million random points data in a rectangular area that includes the Tokyo region, then count up number of the points contained in the cities in Tokyo for each. The vanilla PostGIS and GiST index took more than 160sec, on the other hand, GPU-version of PostGIS and GiST index responded in 0.830 sec. GPU Cache GPU Cache mechanism can store a copy of the target table in a pre-allocated area on the GPU device memory. It was designed for efficient execution of analytical/search queries on frequently updated data with relatively small data size (~10GB). The GPU can process SQL workloads by referring to GPU Cache instead of loading data from tables when executing analytical/search queries. This is typically a workload that keeps real-time data from millions of devices on the GPU and frequently updates timestamps and location information. When the table with GPU cache is updated, the update history is stored in the on-memory redo log buffer, then applied to the GPU cache at a regular intervals or before executing the analysis / search workload. By this mechanism, it achieved both of frequent updates and consistency of GPU cache. User-defined GPU datatype/functions A new API is provided to add user-defined GPU data types/functions. This allows users to define and implement their own niche data types and SQL functions to process them, without modifying PG-Strom itself. Notice This API is still under the experimental state, so its specifications may be changed without notifications. Also note that we assume the users of this API well understand PG-Strom internal, so no documentations are provided right now. PostgreSQL License Adoption PG-Strom v3.0 or later adopt the PostgreSQL License. The earlier version of PG-Strom has used GPLv2 due to the historical background, however, we recognized several concerns that license mismatch prevents joint solution development using PG-Strom core features and comprehensive tools. Other updates Unique int1 (8-bit integer) data type and related operators are now supported. --inner-join and --outer-join options are now available for pg2arrow . Apache Arrow files having more columns than the limit of PostgreSQL can now be generated. In a multi-GPU environment, the GPU Memory Keeper background worker will now be launched for each GPU. PostgreSQL v13.x is now supported. CUDA 11.2 and Ampere generation GPUs are now supported. GPUDirect SQL now supports ScaleFlux's Computational Storage CSD2000 series (only cuFile driver). Miscellaneous bug fixes Deprecated Features Support for PostgreSQL v10.x has been discontinued. The feature to link data with Python scripts (PyStrom) has been discontinued.","title":"PG-Strom v3.0"},{"location":"release_v3.0/#pg-strom-v30-release","text":"PG-Strom Development Team (29-Jun-2021)","title":"PG-Strom v3.0 Release"},{"location":"release_v3.0/#overview","text":"Major changes in PG-Strom v3.0 are as follows: NVIDIA GPUDirect Storage (cuFile) is now supported. Several PostGIS functions are executable on GPUs. GpuJoin using GiST index is now supported. GPU Cache mechanism is newly implemented. User-defined GPU data types/functions/operators are experimentally supported. Software license was switched from GPLv2 to PostgreSQL license.","title":"Overview"},{"location":"release_v3.0/#prerequisites","text":"PostgreSQL v11, v12, v13 CUDA Toolkit 11.2 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or newer)","title":"Prerequisites"},{"location":"release_v3.0/#nvidia-gpudirect-storage","text":"GPUDirect Storage , has been developed by NVIDIA, is now supported as a driver for GPU Direct SQL , in addition to the existing nvme_strom kernel module. Both of drivers have almost equivalent functionalities and performance, but supports of GPUDirect Storage enables P2P direct read from NVME-oF (NVME over Fabrics) devices, SDS (Software Defined Storage) devices and shared filesystem built on these devices. Therefore, it offers larger and more flexible storage configuration. We can use GPUDirect SQL to scan PostgreSQL's heap table and Apache Arrow files. It can expect significant performance improvement for the workloads where table scans are the major bottleneck, in either driver cases. The performance measurement below is by SSBM (Star Schema Benchmark) using 1xGPU and 4xNVME-SSDs under the GPUDirect Storage driver. It shows number of rows processed per unit time is significantly improved regardless of the storage system; either PostgreSQL heap or Apache Arrow. In comparison of the read throughput from NVME-SSD drives during the query execution, it shows the table scan by GPUDirect Storage pulls out almost optimal performance close to the hardware limitation, much faster than the scan by filesystem (PostgreSQL Heap Storage).","title":"NVIDIA GPUDirect Storage"},{"location":"release_v3.0/#gpu-postgis-and-gist-index","text":"We have implemented GPU versions of several PostGIS functions. When these PostGIS functions are used in qualifier clauses (like, WHERE-clause), PG-Strom will automatically generate a GPU program to execute it on the GPU. The main target of GPU version of PostGIS is the workload to check the real-time location data of mobile devices, like smartphones or vehicles, against the area definition data like boundary of municipality or school districts. For example, when you want to deliver an advertisement to smartphonws in a particular area, or when you want to deliver traffic jam information to cara in a particular area, it is effective in the process of searching for the corresponding device using the position as a key. In the following example, it creates 16 million random points data in a rectangular area that includes the Tokyo region, then count up number of the points contained in the cities in Tokyo for each. The vanilla PostGIS and GiST index took more than 160sec, on the other hand, GPU-version of PostGIS and GiST index responded in 0.830 sec.","title":"GPU-PostGIS and GiST-index"},{"location":"release_v3.0/#gpu-cache","text":"GPU Cache mechanism can store a copy of the target table in a pre-allocated area on the GPU device memory. It was designed for efficient execution of analytical/search queries on frequently updated data with relatively small data size (~10GB). The GPU can process SQL workloads by referring to GPU Cache instead of loading data from tables when executing analytical/search queries. This is typically a workload that keeps real-time data from millions of devices on the GPU and frequently updates timestamps and location information. When the table with GPU cache is updated, the update history is stored in the on-memory redo log buffer, then applied to the GPU cache at a regular intervals or before executing the analysis / search workload. By this mechanism, it achieved both of frequent updates and consistency of GPU cache.","title":"GPU Cache"},{"location":"release_v3.0/#user-defined-gpu-datatypefunctions","text":"A new API is provided to add user-defined GPU data types/functions. This allows users to define and implement their own niche data types and SQL functions to process them, without modifying PG-Strom itself. Notice This API is still under the experimental state, so its specifications may be changed without notifications. Also note that we assume the users of this API well understand PG-Strom internal, so no documentations are provided right now.","title":"User-defined GPU datatype/functions"},{"location":"release_v3.0/#postgresql-license-adoption","text":"PG-Strom v3.0 or later adopt the PostgreSQL License. The earlier version of PG-Strom has used GPLv2 due to the historical background, however, we recognized several concerns that license mismatch prevents joint solution development using PG-Strom core features and comprehensive tools.","title":"PostgreSQL License Adoption"},{"location":"release_v3.0/#other-updates","text":"Unique int1 (8-bit integer) data type and related operators are now supported. --inner-join and --outer-join options are now available for pg2arrow . Apache Arrow files having more columns than the limit of PostgreSQL can now be generated. In a multi-GPU environment, the GPU Memory Keeper background worker will now be launched for each GPU. PostgreSQL v13.x is now supported. CUDA 11.2 and Ampere generation GPUs are now supported. GPUDirect SQL now supports ScaleFlux's Computational Storage CSD2000 series (only cuFile driver). Miscellaneous bug fixes","title":"Other updates"},{"location":"release_v3.0/#deprecated-features","text":"Support for PostgreSQL v10.x has been discontinued. The feature to link data with Python scripts (PyStrom) has been discontinued.","title":"Deprecated Features"},{"location":"release_v5.0/","text":"PG-Strom v5.0 Release PG-Strom Development Team (15-Dec-2023) Overview Major changes in PG-Strom v5.0 are as follows: The code base has been re-designed entirely with various improvement. Process model was revised to multi-threaded background worker (PG-Strom GPU Service) from multi-process model. It reduced GPU resource consumption and overhead of task-switching. GPU device code dynamically generated using CUDA C++ was replaced by the pseudo kernel code. It eliminates just-in-time compilation using NVRTC, and improved the first response time. This is also a groundwork for the future support of CSD(Computational Storage Drive) and DPU(Data Processing Unit). GPU-Cache is now deployed on CUDA managed memory that allows overcommit of GPU device memory. Data layout of PostgreSQL data types were revised to adjust Coalesced Memory Access. GpuPreAgg replaced entire GROUP BY implementation, then improved whole performance. GpuJoin extract tuples only once regardless of the depth of Join. Arrow_Fdw and Pg2Arrow supports min/max statistics of arrow files. Two arrow tools were added: Pca2Arrow captures network packets, and arrow2csv dumps arrow files in CSV format. Prerequisites PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal at least; Volta or newer is recommended) New Process Model In v5.0, the multi-threaded background worker process (PG-Strom GPU Service) coordinates GPU resources and task executions, and individual PostgreSQL backend processes send requests to and receive results from the GPU service over IPC. Before the v3.x series, each PostgreSQL backend controls GPU devices individually. This design helps software debugging by easy identification of the problematic code when software quality of CUDA and PG-Strom were not sufficient, however, it extremely consumed GPU resources according to increase of database sessions, and was not recommended software architecture from the standpoint of task-switching. This design change makes PG-Strom v5.0 more stable towards increase of concurrent database sessions, and improves heavy GPU task's performance. Pseudo device code PG-Strom v5.0 now generates its own \"pseudo-code\" from the supplied SQL, and the GPU device code works as an interpreter to execute this \"pseudo-code\". Unlike v3.x series, it does not generate CUDA C++ native code no longer. At first glance, this may appear to be a factor in performance degradation. However, dynamic code generation was originally targeted for only a small part of the code that changes with each query, such as the WHERE clause; most implementations were statically built, and runtime compilation was handled by NVRTC. (approximately 150ms) can now be omitted, contributing to improved response time. The \"pseudo-code\" is a set of low-level commands, can be displayed in EXPLAIN VERBOSE. For example, the query below contains the expression lo_quantity > 10 in the WHERE clause. This operation is defined as Scan Quals OpCode to call the numeric_gt function which compares the magnitude relationship between the lo_quantity column and the constant 10 . postgres=# explain verbose select count(*), sum(lo_quantity), lo_shipmode from lineorder where lo_quantity > 10 group by lo_shipmode; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- HashAggregate (cost=3242387.01..3242387.10 rows=7 width=51) Output: pgstrom.fcount((pgstrom.nrows())), pgstrom.sum_fp_num((pgstrom.psum((lo_quantity)::double precision))), lo_shipmode Group Key: lineorder.lo_shipmode -> Custom Scan (GpuPreAgg) on public.lineorder (cost=3242386.89..3242386.96 rows=7 width=51) Output: (pgstrom.nrows()), (pgstrom.psum((lo_quantity)::double precision)), lo_shipmode GPU Projection: pgstrom.nrows(), pgstrom.psum((lo_quantity)::double precision), lo_shipmode GPU Scan Quals: (lo_quantity > '10'::numeric) [rows: 600128800 -> 479262800] GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , KVecs-Buffer: nbytes: 83968, ndims: 2, items=[kvec0=<0x0000-dfff, type='numeric', expr='lo_quantity'>, kvec1=<0xe000-147ff, type='bpchar', expr='lo_shipmode'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, ]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, ]}}} Scan Quals OpCode: {Func(bool)::numeric_gt args=[{Var(numeric): slot=0, expr='lo_quantity'}, {Const(numeric): value='10'}]} Group-By KeyHash OpCode: {HashValue arg={SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}} Group-By KeyLoad OpCode: {LoadVars(depth=-2): kvars=[]} Group-By KeyComp OpCode: {Func(bool)::bpchareq args=[{Var(bpchar): slot=1, expr='lo_shipmode'}, {Var(bpchar): slot=2, expr='lo_shipmode'}]} Partial Aggregation OpCode: {AggFuncs args=[{SaveExpr: arg={Func(float8)::float8 arg={Var(numeric): kvec=0x0000-e000, expr='lo_quantity'}}}, {SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}]} Partial Function BufSz: 24 (18 rows) Although not currently implemented, this pseudo-code is also designed to offload SQL processing to a CSD (Computational Storage Drive) or DPU (Data Processing Unit) in the future. Improvement of data layout GPU has a wider memory bandwidth than CPU, but in order to take advantage of this performance, it is necessary to satisfy the condition of coalesced memory access, which accesses nearby memory areas at the same time. In v5.0, the layout of PostgreSQL data types in GPU device code has been improved to make them more suitable for Coalesced Memory Access. If we would use the PostgreSQL data type as is, fields that are referenced at certain times will be placed in discrete positions, making it impossible to effectively utilize the read bandwidth from DRAM. By arranging multiple of these for each field, adjacent cores can read data from adjacent areas, making it easier to satisfy the conditions of Coalesced Memory Access. This improvement is aimed at bringing out sufficient execution performance not only for high-end GPU products with extremely high performance memory bandwidth, but also for mid-end GPUs. Arrow_Fdw supports min/max statistics Pg2Arrow can now generate Apache Arrow files with min/max statistics. Its new option --stat=COLUMN_NAME records the maximum/minimum value of the specified column for each RecordBatch and embeds it in the footer using Apache Arrow's Custom-Metadata mechanism. When reading an Apache Arrow file using Arrow_Fdw, perform like a range index scan using the above min/max statistics. For example, if the WHERE-clause for the Arrow_Fdw foreign table is as follows: WHERE ymd BETERRN '2020-01-01'::date AND '2021-12-31'::date Arrow_Fdw will skip the record-batch where the maximum value of the ymd field is less than '2020-01-01'::date , or the record-batch where the minimum value of ymd field is greater than '2021-12-31 ::date`, because it is obvious that it does not match the search conditions. As a result, performance equivalent to narrowing down using a range index can be obtained for datasets with patterns in which records with similar values \u200b\u200bare clustered nearby, such as log data timestamps. Other changes PG-Strom v5.0 stopped support of PostgreSQL v14 or older. Plan version up v15 or later. Due to development schedule reason, v5.0 disables partition-wise GpuJoin. It shall be re-implemented at the near future version.","title":"PG-Strom v5.0"},{"location":"release_v5.0/#pg-strom-v50-release","text":"PG-Strom Development Team (15-Dec-2023)","title":"PG-Strom v5.0 Release"},{"location":"release_v5.0/#overview","text":"Major changes in PG-Strom v5.0 are as follows: The code base has been re-designed entirely with various improvement. Process model was revised to multi-threaded background worker (PG-Strom GPU Service) from multi-process model. It reduced GPU resource consumption and overhead of task-switching. GPU device code dynamically generated using CUDA C++ was replaced by the pseudo kernel code. It eliminates just-in-time compilation using NVRTC, and improved the first response time. This is also a groundwork for the future support of CSD(Computational Storage Drive) and DPU(Data Processing Unit). GPU-Cache is now deployed on CUDA managed memory that allows overcommit of GPU device memory. Data layout of PostgreSQL data types were revised to adjust Coalesced Memory Access. GpuPreAgg replaced entire GROUP BY implementation, then improved whole performance. GpuJoin extract tuples only once regardless of the depth of Join. Arrow_Fdw and Pg2Arrow supports min/max statistics of arrow files. Two arrow tools were added: Pca2Arrow captures network packets, and arrow2csv dumps arrow files in CSV format.","title":"Overview"},{"location":"release_v5.0/#prerequisites","text":"PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal at least; Volta or newer is recommended)","title":"Prerequisites"},{"location":"release_v5.0/#new-process-model","text":"In v5.0, the multi-threaded background worker process (PG-Strom GPU Service) coordinates GPU resources and task executions, and individual PostgreSQL backend processes send requests to and receive results from the GPU service over IPC. Before the v3.x series, each PostgreSQL backend controls GPU devices individually. This design helps software debugging by easy identification of the problematic code when software quality of CUDA and PG-Strom were not sufficient, however, it extremely consumed GPU resources according to increase of database sessions, and was not recommended software architecture from the standpoint of task-switching. This design change makes PG-Strom v5.0 more stable towards increase of concurrent database sessions, and improves heavy GPU task's performance.","title":"New Process Model"},{"location":"release_v5.0/#pseudo-device-code","text":"PG-Strom v5.0 now generates its own \"pseudo-code\" from the supplied SQL, and the GPU device code works as an interpreter to execute this \"pseudo-code\". Unlike v3.x series, it does not generate CUDA C++ native code no longer. At first glance, this may appear to be a factor in performance degradation. However, dynamic code generation was originally targeted for only a small part of the code that changes with each query, such as the WHERE clause; most implementations were statically built, and runtime compilation was handled by NVRTC. (approximately 150ms) can now be omitted, contributing to improved response time. The \"pseudo-code\" is a set of low-level commands, can be displayed in EXPLAIN VERBOSE. For example, the query below contains the expression lo_quantity > 10 in the WHERE clause. This operation is defined as Scan Quals OpCode to call the numeric_gt function which compares the magnitude relationship between the lo_quantity column and the constant 10 . postgres=# explain verbose select count(*), sum(lo_quantity), lo_shipmode from lineorder where lo_quantity > 10 group by lo_shipmode; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- HashAggregate (cost=3242387.01..3242387.10 rows=7 width=51) Output: pgstrom.fcount((pgstrom.nrows())), pgstrom.sum_fp_num((pgstrom.psum((lo_quantity)::double precision))), lo_shipmode Group Key: lineorder.lo_shipmode -> Custom Scan (GpuPreAgg) on public.lineorder (cost=3242386.89..3242386.96 rows=7 width=51) Output: (pgstrom.nrows()), (pgstrom.psum((lo_quantity)::double precision)), lo_shipmode GPU Projection: pgstrom.nrows(), pgstrom.psum((lo_quantity)::double precision), lo_shipmode GPU Scan Quals: (lo_quantity > '10'::numeric) [rows: 600128800 -> 479262800] GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , KVecs-Buffer: nbytes: 83968, ndims: 2, items=[kvec0=<0x0000-dfff, type='numeric', expr='lo_quantity'>, kvec1=<0xe000-147ff, type='bpchar', expr='lo_shipmode'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, ]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, ]}}} Scan Quals OpCode: {Func(bool)::numeric_gt args=[{Var(numeric): slot=0, expr='lo_quantity'}, {Const(numeric): value='10'}]} Group-By KeyHash OpCode: {HashValue arg={SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}} Group-By KeyLoad OpCode: {LoadVars(depth=-2): kvars=[]} Group-By KeyComp OpCode: {Func(bool)::bpchareq args=[{Var(bpchar): slot=1, expr='lo_shipmode'}, {Var(bpchar): slot=2, expr='lo_shipmode'}]} Partial Aggregation OpCode: {AggFuncs args=[{SaveExpr: arg={Func(float8)::float8 arg={Var(numeric): kvec=0x0000-e000, expr='lo_quantity'}}}, {SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}]} Partial Function BufSz: 24 (18 rows) Although not currently implemented, this pseudo-code is also designed to offload SQL processing to a CSD (Computational Storage Drive) or DPU (Data Processing Unit) in the future.","title":"Pseudo device code"},{"location":"release_v5.0/#improvement-of-data-layout","text":"GPU has a wider memory bandwidth than CPU, but in order to take advantage of this performance, it is necessary to satisfy the condition of coalesced memory access, which accesses nearby memory areas at the same time. In v5.0, the layout of PostgreSQL data types in GPU device code has been improved to make them more suitable for Coalesced Memory Access. If we would use the PostgreSQL data type as is, fields that are referenced at certain times will be placed in discrete positions, making it impossible to effectively utilize the read bandwidth from DRAM. By arranging multiple of these for each field, adjacent cores can read data from adjacent areas, making it easier to satisfy the conditions of Coalesced Memory Access. This improvement is aimed at bringing out sufficient execution performance not only for high-end GPU products with extremely high performance memory bandwidth, but also for mid-end GPUs.","title":"Improvement of data layout"},{"location":"release_v5.0/#arrow_fdw-supports-minmax-statistics","text":"Pg2Arrow can now generate Apache Arrow files with min/max statistics. Its new option --stat=COLUMN_NAME records the maximum/minimum value of the specified column for each RecordBatch and embeds it in the footer using Apache Arrow's Custom-Metadata mechanism. When reading an Apache Arrow file using Arrow_Fdw, perform like a range index scan using the above min/max statistics. For example, if the WHERE-clause for the Arrow_Fdw foreign table is as follows: WHERE ymd BETERRN '2020-01-01'::date AND '2021-12-31'::date Arrow_Fdw will skip the record-batch where the maximum value of the ymd field is less than '2020-01-01'::date , or the record-batch where the minimum value of ymd field is greater than '2021-12-31 ::date`, because it is obvious that it does not match the search conditions. As a result, performance equivalent to narrowing down using a range index can be obtained for datasets with patterns in which records with similar values \u200b\u200bare clustered nearby, such as log data timestamps.","title":"Arrow_Fdw supports min/max statistics"},{"location":"release_v5.0/#other-changes","text":"PG-Strom v5.0 stopped support of PostgreSQL v14 or older. Plan version up v15 or later. Due to development schedule reason, v5.0 disables partition-wise GpuJoin. It shall be re-implemented at the near future version.","title":"Other changes"},{"location":"release_v5.1/","text":"PG-Strom v5.1 Release PG-Strom Development Team (17-Apr-2024) Overview Major changes in PG-Strom v5.1 are as follows: Added support for partition-wise GPU-Join/PreAgg. GPU code is now built in the execution environment at startup. pg2arrow now support parallel execution. CUDA Stack size is now set adaptically. Cumulative bug fixes Prerequisites PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal at least; Volta or newer is recommended) Partition-wise GpuJoin/GpuPreAgg Support for PostgreSQL partitions itself was also included in PG-Strom v3.0, but execution plans often could not be created properly, therefore it could not be moved out of its experimental status. Then, in PG-Strom v5.1, we fundamentally revised the internal design, re-implemented it, and incorporated it as an official feature again. If the lineorder table below is partitioned and the date1 table is a non-partitioned table, previously all the data read from the partitioned tables under lineorder must be joined with date1 table after the consolidation of all the partition leafs by the Append node. Usually, PG-Strom bypasses the CPU and loads data from the NVME-SSD to the GPU to perform various SQL processing (GPU-Direct SQL), so the data must be returned to the CPU before JOIN. It has been a big penalty. ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate -> Hash Join Hash Cond: (lineorder.lo_orderdate = date1.d_datekey) -> Append -> Custom Scan (GpuScan) on lineorder__p1992 lineorder_1 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1993 lineorder_2 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1994 lineorder_3 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1995 lineorder_4 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1996 lineorder_5 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1997 lineorder_6 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1998 lineorder_7 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on lineorder__p1999 lineorder_8 Filter: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash -> Seq Scan on date1 Filter: (d_year = 1993) (37 rows) In PG-Strom v5.1, it is now possible to push-down JOINs with non-partitioned tables to partitioned child tables. In some cases, it is also possible to complete the GROUP-BY processing and then return much smaller results to CPU. For example, in the example below, 70 million rows extracted from a total of 600 million rows in the partitioned child tables. By performing a JOIN with the non-partitioned table date1 and then aggregation function SUM() pushed-down to the partitioned child tables, the CPU only needs to process 8 rows. Although there is a disadvantage that reading on the INNER side occurs multiple times (* This will be fixed in a future version), this type of rewriting will significantly reduce the amount of data that must be processed by the CPU, contributing to improved processing speed. To do. ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------- Aggregate -> Append -> Custom Scan (GpuPreAgg) on lineorder__p1992 lineorder_1 GPU Projection: pgstrom.psum(((lineorder_1.lo_extendedprice * lineorder_1.lo_discount))::double precision) GPU Scan Quals: ((lineorder_1.lo_discount >= '1'::numeric) AND (lineorder_1.lo_discount <= '3'::numeric) AND (lineorder_1.lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU Join Quals [1]: (lineorder_1.lo_orderdate = date1.d_datekey) ... [nrows: 11911380 -> 1700960] GPU Outer Hash [1]: lineorder_1.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1993 lineorder_2 GPU Projection: pgstrom.psum(((lineorder_2.lo_extendedprice * lineorder_2.lo_discount))::double precision) GPU Scan Quals: ((lineorder_2.lo_discount >= '1'::numeric) AND (lineorder_2.lo_discount <= '3'::numeric) AND (lineorder_2.lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU Join Quals [1]: (lineorder_2.lo_orderdate = date1.d_datekey) ... [nrows: 11980460 -> 1710824] GPU Outer Hash [1]: lineorder_2.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1994 lineorder_3 GPU Projection: pgstrom.psum(((lineorder_3.lo_extendedprice * lineorder_3.lo_discount))::double precision) GPU Scan Quals: ((lineorder_3.lo_discount >= '1'::numeric) AND (lineorder_3.lo_discount <= '3'::numeric) AND (lineorder_3.lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU Join Quals [1]: (lineorder_3.lo_orderdate = date1.d_datekey) ... [nrows: 12150700 -> 1735135] GPU Outer Hash [1]: lineorder_3.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1995 lineorder_4 GPU Projection: pgstrom.psum(((lineorder_4.lo_extendedprice * lineorder_4.lo_discount))::double precision) GPU Scan Quals: ((lineorder_4.lo_discount >= '1'::numeric) AND (lineorder_4.lo_discount <= '3'::numeric) AND (lineorder_4.lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU Join Quals [1]: (lineorder_4.lo_orderdate = date1.d_datekey) ... [nrows: 11779920 -> 1682188] GPU Outer Hash [1]: lineorder_4.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1996 lineorder_5 GPU Projection: pgstrom.psum(((lineorder_5.lo_extendedprice * lineorder_5.lo_discount))::double precision) GPU Scan Quals: ((lineorder_5.lo_discount >= '1'::numeric) AND (lineorder_5.lo_discount <= '3'::numeric) AND (lineorder_5.lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU Join Quals [1]: (lineorder_5.lo_orderdate = date1.d_datekey) ... [nrows: 11942810 -> 1705448] GPU Outer Hash [1]: lineorder_5.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1997 lineorder_6 GPU Projection: pgstrom.psum(((lineorder_6.lo_extendedprice * lineorder_6.lo_discount))::double precision) GPU Scan Quals: ((lineorder_6.lo_discount >= '1'::numeric) AND (lineorder_6.lo_discount <= '3'::numeric) AND (lineorder_6.lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU Join Quals [1]: (lineorder_6.lo_orderdate = date1.d_datekey) ... [nrows: 12069740 -> 1723574] GPU Outer Hash [1]: lineorder_6.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1998 lineorder_7 GPU Projection: pgstrom.psum(((lineorder_7.lo_extendedprice * lineorder_7.lo_discount))::double precision) GPU Scan Quals: ((lineorder_7.lo_discount >= '1'::numeric) AND (lineorder_7.lo_discount <= '3'::numeric) AND (lineorder_7.lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU Join Quals [1]: (lineorder_7.lo_orderdate = date1.d_datekey) ... [nrows: 6898138 -> 985063] GPU Outer Hash [1]: lineorder_7.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1999 lineorder_8 GPU Projection: pgstrom.psum(((lineorder_8.lo_extendedprice * lineorder_8.lo_discount))::double precision) GPU Scan Quals: ((lineorder_8.lo_discount >= '1'::numeric) AND (lineorder_8.lo_discount <= '3'::numeric) AND (lineorder_8.lo_quantity < '25'::numeric)) [rows: 150 -> 1] GPU Join Quals [1]: (lineorder_8.lo_orderdate = date1.d_datekey) ... [nrows: 1 -> 1] GPU Outer Hash [1]: lineorder_8.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) (82 rows) Build GPU code on startup Previous versions of PG-Strom was distributing pre-built binary modules for GPUs. Although this is simple, the GPU binary module often raised a runtime error depending on the combination of CUDA Toolkit and NVIDIA driver versions in the PG-Strom (PostgreSQL) execution environment. Typically, this is when the execution environment has an older version of the CUDA Toolkit or NVIDIA driver installed than the environment in which the RPM package was built. PG-Strom v5.1 has been changed to check the GPU source code and CUDA Toolkit version at startup, and build a GPU binary module if there are any difference. With this fix, PG-Strom can now utilize GPU devices and GPU binary modules for CUDA Toolkit in the execution environment. pg2arrow parallel execution pg2arrow now supports the new -n|--num-workers and -k|--parallel-keys options. -n N_WORKERS option launches the specified number of threads to connect to PostgreSQL for each, execute queries in parallel, and write the results to the Apache Arrow file. Queries can contain the special token $(N_WORKERS) and $(WORKER_ID) , which will be replaced by the number of workers and worker-specific ID values, respectively, when querying PostgreSQL. It is user's responsibility to ensure the tuples read by each worker thread do not overlap or are missing. Another -k|--parallel-key option starts a worker thread for each comma-separated key value given by the argument, and replaces $(PARALLEL_KEY) with the key in the query. The worker thread runs this query for each, then write the result as an Apache Arrow file. For example, if the lineorder table is partitioned and there are child tables lineorder__sun , lineorder__mon , ... lineorder__sat , each worker thread scans each child table of the partition according to the keys given by the -k sun,mon,tue,wed,thu,fri,sat option. This parallel key is replaced by the $(PARALLEL_KEY) in the query given by -c 'SELECT * FROM lineorder__$(PARALLEL_KEY)' option. It launches 7 worker threads which shall scan the partitioned child table for each. $ pg2arrow -d ssbm -c 'SELECT * FROM lineorder__$(PARALLEL_KEY)' -o /path/to/f_lineorder.arrow -k=sun,mon,tue,wed,thu,fri,sat --progress worker:1 SQL=[SELECT * FROM lineorder__sun] worker:3 SQL=[SELECT * FROM lineorder__tue] worker:2 SQL=[SELECT * FROM lineorder__mon] worker:4 SQL=[SELECT * FROM lineorder__wed] worker:5 SQL=[SELECT * FROM lineorder__thu] : :","title":"PG-Strom v5.1"},{"location":"release_v5.1/#pg-strom-v51-release","text":"PG-Strom Development Team (17-Apr-2024)","title":"PG-Strom v5.1 Release"},{"location":"release_v5.1/#overview","text":"Major changes in PG-Strom v5.1 are as follows: Added support for partition-wise GPU-Join/PreAgg. GPU code is now built in the execution environment at startup. pg2arrow now support parallel execution. CUDA Stack size is now set adaptically. Cumulative bug fixes","title":"Overview"},{"location":"release_v5.1/#prerequisites","text":"PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal at least; Volta or newer is recommended)","title":"Prerequisites"},{"location":"release_v5.1/#partition-wise-gpujoingpupreagg","text":"Support for PostgreSQL partitions itself was also included in PG-Strom v3.0, but execution plans often could not be created properly, therefore it could not be moved out of its experimental status. Then, in PG-Strom v5.1, we fundamentally revised the internal design, re-implemented it, and incorporated it as an official feature again. If the lineorder table below is partitioned and the date1 table is a non-partitioned table, previously all the data read from the partitioned tables under lineorder must be joined with date1 table after the consolidation of all the partition leafs by the Append node. Usually, PG-Strom bypasses the CPU and loads data from the NVME-SSD to the GPU to perform various SQL processing (GPU-Direct SQL), so the data must be returned to the CPU before JOIN. It has been a big penalty. ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate -> Hash Join Hash Cond: (lineorder.lo_orderdate = date1.d_datekey) -> Append -> Custom Scan (GpuScan) on lineorder__p1992 lineorder_1 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1993 lineorder_2 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1994 lineorder_3 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1995 lineorder_4 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1996 lineorder_5 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1997 lineorder_6 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1998 lineorder_7 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on lineorder__p1999 lineorder_8 Filter: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash -> Seq Scan on date1 Filter: (d_year = 1993) (37 rows) In PG-Strom v5.1, it is now possible to push-down JOINs with non-partitioned tables to partitioned child tables. In some cases, it is also possible to complete the GROUP-BY processing and then return much smaller results to CPU. For example, in the example below, 70 million rows extracted from a total of 600 million rows in the partitioned child tables. By performing a JOIN with the non-partitioned table date1 and then aggregation function SUM() pushed-down to the partitioned child tables, the CPU only needs to process 8 rows. Although there is a disadvantage that reading on the INNER side occurs multiple times (* This will be fixed in a future version), this type of rewriting will significantly reduce the amount of data that must be processed by the CPU, contributing to improved processing speed. To do. ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------- Aggregate -> Append -> Custom Scan (GpuPreAgg) on lineorder__p1992 lineorder_1 GPU Projection: pgstrom.psum(((lineorder_1.lo_extendedprice * lineorder_1.lo_discount))::double precision) GPU Scan Quals: ((lineorder_1.lo_discount >= '1'::numeric) AND (lineorder_1.lo_discount <= '3'::numeric) AND (lineorder_1.lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU Join Quals [1]: (lineorder_1.lo_orderdate = date1.d_datekey) ... [nrows: 11911380 -> 1700960] GPU Outer Hash [1]: lineorder_1.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1993 lineorder_2 GPU Projection: pgstrom.psum(((lineorder_2.lo_extendedprice * lineorder_2.lo_discount))::double precision) GPU Scan Quals: ((lineorder_2.lo_discount >= '1'::numeric) AND (lineorder_2.lo_discount <= '3'::numeric) AND (lineorder_2.lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU Join Quals [1]: (lineorder_2.lo_orderdate = date1.d_datekey) ... [nrows: 11980460 -> 1710824] GPU Outer Hash [1]: lineorder_2.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1994 lineorder_3 GPU Projection: pgstrom.psum(((lineorder_3.lo_extendedprice * lineorder_3.lo_discount))::double precision) GPU Scan Quals: ((lineorder_3.lo_discount >= '1'::numeric) AND (lineorder_3.lo_discount <= '3'::numeric) AND (lineorder_3.lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU Join Quals [1]: (lineorder_3.lo_orderdate = date1.d_datekey) ... [nrows: 12150700 -> 1735135] GPU Outer Hash [1]: lineorder_3.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1995 lineorder_4 GPU Projection: pgstrom.psum(((lineorder_4.lo_extendedprice * lineorder_4.lo_discount))::double precision) GPU Scan Quals: ((lineorder_4.lo_discount >= '1'::numeric) AND (lineorder_4.lo_discount <= '3'::numeric) AND (lineorder_4.lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU Join Quals [1]: (lineorder_4.lo_orderdate = date1.d_datekey) ... [nrows: 11779920 -> 1682188] GPU Outer Hash [1]: lineorder_4.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1996 lineorder_5 GPU Projection: pgstrom.psum(((lineorder_5.lo_extendedprice * lineorder_5.lo_discount))::double precision) GPU Scan Quals: ((lineorder_5.lo_discount >= '1'::numeric) AND (lineorder_5.lo_discount <= '3'::numeric) AND (lineorder_5.lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU Join Quals [1]: (lineorder_5.lo_orderdate = date1.d_datekey) ... [nrows: 11942810 -> 1705448] GPU Outer Hash [1]: lineorder_5.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1997 lineorder_6 GPU Projection: pgstrom.psum(((lineorder_6.lo_extendedprice * lineorder_6.lo_discount))::double precision) GPU Scan Quals: ((lineorder_6.lo_discount >= '1'::numeric) AND (lineorder_6.lo_discount <= '3'::numeric) AND (lineorder_6.lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU Join Quals [1]: (lineorder_6.lo_orderdate = date1.d_datekey) ... [nrows: 12069740 -> 1723574] GPU Outer Hash [1]: lineorder_6.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1998 lineorder_7 GPU Projection: pgstrom.psum(((lineorder_7.lo_extendedprice * lineorder_7.lo_discount))::double precision) GPU Scan Quals: ((lineorder_7.lo_discount >= '1'::numeric) AND (lineorder_7.lo_discount <= '3'::numeric) AND (lineorder_7.lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU Join Quals [1]: (lineorder_7.lo_orderdate = date1.d_datekey) ... [nrows: 6898138 -> 985063] GPU Outer Hash [1]: lineorder_7.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1999 lineorder_8 GPU Projection: pgstrom.psum(((lineorder_8.lo_extendedprice * lineorder_8.lo_discount))::double precision) GPU Scan Quals: ((lineorder_8.lo_discount >= '1'::numeric) AND (lineorder_8.lo_discount <= '3'::numeric) AND (lineorder_8.lo_quantity < '25'::numeric)) [rows: 150 -> 1] GPU Join Quals [1]: (lineorder_8.lo_orderdate = date1.d_datekey) ... [nrows: 1 -> 1] GPU Outer Hash [1]: lineorder_8.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) (82 rows)","title":"Partition-wise GpuJoin/GpuPreAgg"},{"location":"release_v5.1/#build-gpu-code-on-startup","text":"Previous versions of PG-Strom was distributing pre-built binary modules for GPUs. Although this is simple, the GPU binary module often raised a runtime error depending on the combination of CUDA Toolkit and NVIDIA driver versions in the PG-Strom (PostgreSQL) execution environment. Typically, this is when the execution environment has an older version of the CUDA Toolkit or NVIDIA driver installed than the environment in which the RPM package was built. PG-Strom v5.1 has been changed to check the GPU source code and CUDA Toolkit version at startup, and build a GPU binary module if there are any difference. With this fix, PG-Strom can now utilize GPU devices and GPU binary modules for CUDA Toolkit in the execution environment.","title":"Build GPU code on startup"},{"location":"release_v5.1/#pg2arrow-parallel-execution","text":"pg2arrow now supports the new -n|--num-workers and -k|--parallel-keys options. -n N_WORKERS option launches the specified number of threads to connect to PostgreSQL for each, execute queries in parallel, and write the results to the Apache Arrow file. Queries can contain the special token $(N_WORKERS) and $(WORKER_ID) , which will be replaced by the number of workers and worker-specific ID values, respectively, when querying PostgreSQL. It is user's responsibility to ensure the tuples read by each worker thread do not overlap or are missing. Another -k|--parallel-key option starts a worker thread for each comma-separated key value given by the argument, and replaces $(PARALLEL_KEY) with the key in the query. The worker thread runs this query for each, then write the result as an Apache Arrow file. For example, if the lineorder table is partitioned and there are child tables lineorder__sun , lineorder__mon , ... lineorder__sat , each worker thread scans each child table of the partition according to the keys given by the -k sun,mon,tue,wed,thu,fri,sat option. This parallel key is replaced by the $(PARALLEL_KEY) in the query given by -c 'SELECT * FROM lineorder__$(PARALLEL_KEY)' option. It launches 7 worker threads which shall scan the partitioned child table for each. $ pg2arrow -d ssbm -c 'SELECT * FROM lineorder__$(PARALLEL_KEY)' -o /path/to/f_lineorder.arrow -k=sun,mon,tue,wed,thu,fri,sat --progress worker:1 SQL=[SELECT * FROM lineorder__sun] worker:3 SQL=[SELECT * FROM lineorder__tue] worker:2 SQL=[SELECT * FROM lineorder__mon] worker:4 SQL=[SELECT * FROM lineorder__wed] worker:5 SQL=[SELECT * FROM lineorder__thu] : :","title":"pg2arrow parallel execution"},{"location":"ssd2gpu/","text":"GPU Direct SQL Execution Overview For the fast execution of SQL workloads, it needs to provide processors rapid data stream from storage or memory, in addition to processor's execution efficiency. Processor will run idle if data stream would not be delivered. GPUDirect SQL Execution directly connects NVMe-SSD which enables high-speed I/O processing by direct attach to the PCIe bus and GPU device that is also attached on the same PCIe bus, and runs SQL workloads very high speed by supplying data stream close to the wired speed of the hardware. Usually, PostgreSQL data blocks on the storage shall be once loaded to CPU/RAM through the PCIe bus, then, PostgreSQL runs WHERE-clause for filtering or JOIN/GROUP BY according to the query execution plan. Due to the characteristics of analytic workloads, the amount of result data set is much smaller than the source data set. For example, it is not rare case to read billions rows but output just hundreds rows after the aggregation operations with GROUP BY. In the other words, we consume bandwidth of the PCIe bus to move junk data, however, we cannot determine whether rows are necessary or not prior to the evaluation by SQL workloads on CPU. So, it is not avoidable restriction in usual implementation. GPU Direct SQL Execution changes the flow to read blocks from the storage sequentially. It directly loads data blocks to GPU using peer-to-peer DMA over PCIe bus, then runs SQL workloads on GPU device to reduce number of rows to be processed by CPU. In other words, it utilizes GPU as a pre-processor of SQL which locates in the middle of the storage and CPU/RAM for reduction of CPU's load, then tries to accelerate I/O processing in the results. This feature internally uses the NVIDIA GPUDirect Storage module ( nvidia-fs ) to coordinate P2P data transfer from NVME storage to GPU device memory. So, this feature requires this Linux kernel module, in addition to PG-Strom as an extension of PostgreSQL. Also note that this feature supports only NVME-SSD or NVME-oF remove devices. It does not support legacy storages like SAS or SATA-SSD. We have tested several NVMD-SSD models. You can refer 002: HW Validation List for your information. System Setup Driver Installation The previous version of PG-Strom required its original Linux kernel module developed by HeteroDB for GPU-Direct SQL support, however, the version 3.0 revised the software design to use GPUDirect Storage provided by NVIDIA, as a part of CUDA Toolkit. The Linux kernel module for GPUDirect Storage ( nvidia-fs ) is integrated into the CUDA Toolkit installation process and requires no additional configuration if you have set up your system as described in the Installation chapter of this manual. You can check whether the required Linux kernel drivers are installed using the modinfo command or lsmod command. $ modinfo nvidia-fs filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/nvidia-fs.ko.xz description: NVIDIA GPUDirect Storage license: GPL v2 version: 2.20.5 rhelversion: 9.4 srcversion: 096A726CAEC0A059E24049E depends: retpoline: Y name: nvidia_fs vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions sig_id: PKCS#7 signer: DKMS module signing key sig_key: 18:B4:AE:27:B8:7D:74:4F:C2:27:68:2A:EB:E0:6A:F0:84:B2:94:EE sig_hashalgo: sha512 : : $ lsmod | grep nvidia nvidia_fs 323584 32 nvidia_uvm 6877184 4 nvidia 8822784 43 nvidia_uvm,nvidia_fs drm 741376 2 drm_kms_helper,nvidia Designing Tablespace GPU Direct SQL Execution shall be invoked in the following case. The target table to be scanned locates on the partition being consist of NVMe-SSD. /dev/nvmeXXXX block device, or md-raid0 volume which consists of NVMe-SSDs only. The target table size is larger than pg_strom.gpudirect_threshold . You can adjust this configuration. Its default is physical RAM size of the system plus 1/3 of shared_buffers configuration. Note Striped read from multiple NVMe-SSD using md-raid0 requires the enterprise subscription provided by HeteroDB,Inc. In order to deploy the tables on the partition consists of NVMe-SSD, you can use the tablespace function of PostgreSQL to specify particular tables or databases to place them on NVMe-SSD volume, in addition to construction of the entire database cluster on the NVMe-SSD volume. For example, you can create a new tablespace below, if NVMe-SSD is mounted at /opt/nvme . CREATE TABLESPACE my_nvme LOCATION '/opt/nvme'; In order to create a new table on the tablespace, specify the TABLESPACE option at the CREATE TABLE command below. CREATE TABLE my_table (...) TABLESPACE my_nvme; Or, use ALTER DATABASE command as follows, to change the default tablespace of the database. Note that tablespace of the existing tables are not changed in thie case. ALTER DATABASE my_database SET TABLESPACE my_nvme; Operations Distance between GPU and NVME-SSD On selection of server hardware and installation of GPU and NVME-SSD, hardware configuration needs to pay attention to the distance between devices, to pull out maximum performance of the device. NVIDIA GPUDirect RDMA , basis of the GPU Direct SQL mechanism, requires both of the edge devices of P2P DMA are connected on the same PCIe root complex. In the other words, unable to configure the P2P DMA traverses QPI between CPUs when NVME-SSD is attached on CPU1 and GPU is attached on CPU2 at dual socket system. From standpoint of the performance, it is recommended to use dedicated PCIe-switch to connect both of the devices more than the PCIe controller built in CPU. The photo below is a motherboard of HPC server. It has 8 of PCIe x16 slots, and each pair is linked to the other over the PCIe switch. The slots in the left-side of the photo are connected to CPU1, and right-side are connected to CPU2. When a table on SSD-2 is scanned using GPU Direct SQL, the optimal GPU choice is GPU-2, and it may be able to use GPU1. However, we have to avoid to choose GPU-3 and GPU-4 due to the restriction of GPUDirect RDMA. PG-Strom calculate logical distances on any pairs of GPU and NVME-SSD using PCIe bus topology information of the system on startup time. It is displayed at the start up log. Each NVME-SSD determines the preferable GPU based on the distance, for example, GPU1 shall be used on scan of the /dev/nvme2 . $ pg_ctl restart : LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78> LOG: [0000:81:00:0] nvme0 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] LOG: [0000:82:00:0] nvme2 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c2:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c6:00:0] nvme5 (Corsair MP600 CORE) --> GPU0 [dist=9] LOG: [0000:c3:00:0] nvme4 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c1:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c4:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Usually automatic configuration works well. In case when NVME-over-Fabric(RDMA) is used, unable to identify the location of nvme device on the PCIe-bus, so you need to configure the logical distance between NVME-SSD and GPU manually. The example below shows the configuration of gpu2 for nvme1 , and gpu1 for nvme2 and nvme3 . It shall be added to postgresql.conf . Please note than manual configuration takes priority than the automatic configuration. pg_strom.nvme_distance_map = 'nvme1=gpu2,nvme2=gpu1,nvme3=gpu1' If the concept of distance on the PCI-E bus is not suitable, such as when running GPU-Direct SQL from a storage server connected via 100Gb Ethernet, other than a local NVME-SSD device, you can specify the directory where the storage is mounted, and the preferable GPU devices to be associated with. Below is a setting example. pg_strom.nvme_distance_map = '/mnt/0=gpu0,/mnt/1=gpu1' Controls using GUC parameters There are two GPU parameters related to GPU Direct SQL Execution. The first is pg_strom.gpudirect_enabled that simply turn on/off the function of GPU Direct SQL Execution. If off , GPU Direct SQL Execution should not be used regardless of the table size or physical location. Default is on . The other one is pg_strom.gpudirect_threshold which specifies the least table size to invoke GPU Direct SQL Execution. PG-Strom will choose GPU Direct SQL Execution when target table is located on NVME-SSD volume (or md-raid0 volume which consists of NVME-SSD only), and the table size is larger than this parameter. Its default configuration is 2GB . In other words, for obviously small tables, priority is given to reading from PostgreSQL's buffer rather than GPU-Direct SQL. Even if GPU Direct SQL Execution has advantages on a single table scan workload, usage of disk cache may work better on the second or later trial for the tables which are available to load onto the main memory. On course, this assumption is not always right depending on the workload charasteristics. Ensure usage of GPU Direct SQL Execution EXPLAIN command allows to ensure whether GPU Direct SQL Execution shall be used in the target query, or not. In the example below, a scan on the lineorder table by Custom Scan (GpuJoin) shows NVMe-Strom: enabled . In this case, GPU Direct SQL Execution shall be used to read from the lineorder table. # explain (costs off) select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_category = 'MFGR#12' and s_region = 'AMERICA' group by d_year, p_brand1 order by d_year, p_brand1; QUERY PLAN ---------------------------------------------------------------------------------------------- GroupAggregate Group Key: date1.d_year, part.p_brand1 -> Sort Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuPreAgg) Reduction: Local GPU Projection: pgstrom.psum((lo_revenue)::double precision), d_year, p_brand1 Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on lineorder GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue Outer Scan: lineorder Depth 1: GpuHashJoin (nrows 2406009600...97764190) HashKeys: lineorder.lo_partkey JoinQuals: (lineorder.lo_partkey = part.p_partkey) KDS-Hash (size: 10.67MB) Depth 2: GpuHashJoin (nrows 97764190...18544060) HashKeys: lineorder.lo_suppkey JoinQuals: (lineorder.lo_suppkey = supplier.s_suppkey) KDS-Hash (size: 131.59MB) Depth 3: GpuHashJoin (nrows 18544060...18544060) HashKeys: lineorder.lo_orderdate JoinQuals: (lineorder.lo_orderdate = date1.d_datekey) KDS-Hash (size: 461.89KB) NVMe-Strom: enabled -> Custom Scan (GpuScan) on part GPU Projection: p_brand1, p_partkey GPU Filter: (p_category = 'MFGR#12'::bpchar) -> Custom Scan (GpuScan) on supplier GPU Projection: s_suppkey GPU Filter: (s_region = 'AMERICA'::bpchar) -> Seq Scan on date1 (31 rows) Attension for visibility map Right now, GPU routines of PG-Strom cannot run MVCC visibility checks per row, because only host code has a special data structure for visibility checks. It also leads a problem. We cannot know which row is visible, or invisible at the time when PG-Strom requires P2P DMA for NVMe-SSD, because contents of the storage blocks are not yet loaded to CPU/RAM, and MVCC related attributes are written with individual records. PostgreSQL had similar problem when it supports IndexOnlyScan. To address the problem, PostgreSQL has an infrastructure of visibility map which is a bunch of flags to indicate whether any records in a particular data block are visible from all the transactions. If associated bit is set, we can know the associated block has no invisible records without reading the block itself. GPU Direct SQL Execution utilizes this infrastructure. It checks the visibility map first, then only \"all-visible\" blocks are required to read with P2P DMA. VACUUM constructs visibility map, so you can enforce PostgreSQL to construct visibility map by explicit launch of VACUUM command. VACUUM ANALYZE linerorder;","title":"GPUDirect SQL"},{"location":"ssd2gpu/#gpu-direct-sql-execution","text":"","title":"GPU Direct SQL Execution"},{"location":"ssd2gpu/#overview","text":"For the fast execution of SQL workloads, it needs to provide processors rapid data stream from storage or memory, in addition to processor's execution efficiency. Processor will run idle if data stream would not be delivered. GPUDirect SQL Execution directly connects NVMe-SSD which enables high-speed I/O processing by direct attach to the PCIe bus and GPU device that is also attached on the same PCIe bus, and runs SQL workloads very high speed by supplying data stream close to the wired speed of the hardware. Usually, PostgreSQL data blocks on the storage shall be once loaded to CPU/RAM through the PCIe bus, then, PostgreSQL runs WHERE-clause for filtering or JOIN/GROUP BY according to the query execution plan. Due to the characteristics of analytic workloads, the amount of result data set is much smaller than the source data set. For example, it is not rare case to read billions rows but output just hundreds rows after the aggregation operations with GROUP BY. In the other words, we consume bandwidth of the PCIe bus to move junk data, however, we cannot determine whether rows are necessary or not prior to the evaluation by SQL workloads on CPU. So, it is not avoidable restriction in usual implementation. GPU Direct SQL Execution changes the flow to read blocks from the storage sequentially. It directly loads data blocks to GPU using peer-to-peer DMA over PCIe bus, then runs SQL workloads on GPU device to reduce number of rows to be processed by CPU. In other words, it utilizes GPU as a pre-processor of SQL which locates in the middle of the storage and CPU/RAM for reduction of CPU's load, then tries to accelerate I/O processing in the results. This feature internally uses the NVIDIA GPUDirect Storage module ( nvidia-fs ) to coordinate P2P data transfer from NVME storage to GPU device memory. So, this feature requires this Linux kernel module, in addition to PG-Strom as an extension of PostgreSQL. Also note that this feature supports only NVME-SSD or NVME-oF remove devices. It does not support legacy storages like SAS or SATA-SSD. We have tested several NVMD-SSD models. You can refer 002: HW Validation List for your information.","title":"Overview"},{"location":"ssd2gpu/#system-setup","text":"","title":"System Setup"},{"location":"ssd2gpu/#driver-installation","text":"The previous version of PG-Strom required its original Linux kernel module developed by HeteroDB for GPU-Direct SQL support, however, the version 3.0 revised the software design to use GPUDirect Storage provided by NVIDIA, as a part of CUDA Toolkit. The Linux kernel module for GPUDirect Storage ( nvidia-fs ) is integrated into the CUDA Toolkit installation process and requires no additional configuration if you have set up your system as described in the Installation chapter of this manual. You can check whether the required Linux kernel drivers are installed using the modinfo command or lsmod command. $ modinfo nvidia-fs filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/nvidia-fs.ko.xz description: NVIDIA GPUDirect Storage license: GPL v2 version: 2.20.5 rhelversion: 9.4 srcversion: 096A726CAEC0A059E24049E depends: retpoline: Y name: nvidia_fs vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions sig_id: PKCS#7 signer: DKMS module signing key sig_key: 18:B4:AE:27:B8:7D:74:4F:C2:27:68:2A:EB:E0:6A:F0:84:B2:94:EE sig_hashalgo: sha512 : : $ lsmod | grep nvidia nvidia_fs 323584 32 nvidia_uvm 6877184 4 nvidia 8822784 43 nvidia_uvm,nvidia_fs drm 741376 2 drm_kms_helper,nvidia","title":"Driver Installation"},{"location":"ssd2gpu/#designing-tablespace","text":"GPU Direct SQL Execution shall be invoked in the following case. The target table to be scanned locates on the partition being consist of NVMe-SSD. /dev/nvmeXXXX block device, or md-raid0 volume which consists of NVMe-SSDs only. The target table size is larger than pg_strom.gpudirect_threshold . You can adjust this configuration. Its default is physical RAM size of the system plus 1/3 of shared_buffers configuration. Note Striped read from multiple NVMe-SSD using md-raid0 requires the enterprise subscription provided by HeteroDB,Inc. In order to deploy the tables on the partition consists of NVMe-SSD, you can use the tablespace function of PostgreSQL to specify particular tables or databases to place them on NVMe-SSD volume, in addition to construction of the entire database cluster on the NVMe-SSD volume. For example, you can create a new tablespace below, if NVMe-SSD is mounted at /opt/nvme . CREATE TABLESPACE my_nvme LOCATION '/opt/nvme'; In order to create a new table on the tablespace, specify the TABLESPACE option at the CREATE TABLE command below. CREATE TABLE my_table (...) TABLESPACE my_nvme; Or, use ALTER DATABASE command as follows, to change the default tablespace of the database. Note that tablespace of the existing tables are not changed in thie case. ALTER DATABASE my_database SET TABLESPACE my_nvme;","title":"Designing Tablespace"},{"location":"ssd2gpu/#operations","text":"","title":"Operations"},{"location":"ssd2gpu/#distance-between-gpu-and-nvme-ssd","text":"On selection of server hardware and installation of GPU and NVME-SSD, hardware configuration needs to pay attention to the distance between devices, to pull out maximum performance of the device. NVIDIA GPUDirect RDMA , basis of the GPU Direct SQL mechanism, requires both of the edge devices of P2P DMA are connected on the same PCIe root complex. In the other words, unable to configure the P2P DMA traverses QPI between CPUs when NVME-SSD is attached on CPU1 and GPU is attached on CPU2 at dual socket system. From standpoint of the performance, it is recommended to use dedicated PCIe-switch to connect both of the devices more than the PCIe controller built in CPU. The photo below is a motherboard of HPC server. It has 8 of PCIe x16 slots, and each pair is linked to the other over the PCIe switch. The slots in the left-side of the photo are connected to CPU1, and right-side are connected to CPU2. When a table on SSD-2 is scanned using GPU Direct SQL, the optimal GPU choice is GPU-2, and it may be able to use GPU1. However, we have to avoid to choose GPU-3 and GPU-4 due to the restriction of GPUDirect RDMA. PG-Strom calculate logical distances on any pairs of GPU and NVME-SSD using PCIe bus topology information of the system on startup time. It is displayed at the start up log. Each NVME-SSD determines the preferable GPU based on the distance, for example, GPU1 shall be used on scan of the /dev/nvme2 . $ pg_ctl restart : LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78> LOG: [0000:81:00:0] nvme0 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] LOG: [0000:82:00:0] nvme2 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c2:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c6:00:0] nvme5 (Corsair MP600 CORE) --> GPU0 [dist=9] LOG: [0000:c3:00:0] nvme4 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c1:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c4:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Usually automatic configuration works well. In case when NVME-over-Fabric(RDMA) is used, unable to identify the location of nvme device on the PCIe-bus, so you need to configure the logical distance between NVME-SSD and GPU manually. The example below shows the configuration of gpu2 for nvme1 , and gpu1 for nvme2 and nvme3 . It shall be added to postgresql.conf . Please note than manual configuration takes priority than the automatic configuration. pg_strom.nvme_distance_map = 'nvme1=gpu2,nvme2=gpu1,nvme3=gpu1' If the concept of distance on the PCI-E bus is not suitable, such as when running GPU-Direct SQL from a storage server connected via 100Gb Ethernet, other than a local NVME-SSD device, you can specify the directory where the storage is mounted, and the preferable GPU devices to be associated with. Below is a setting example. pg_strom.nvme_distance_map = '/mnt/0=gpu0,/mnt/1=gpu1'","title":"Distance between GPU and NVME-SSD"},{"location":"ssd2gpu/#controls-using-guc-parameters","text":"There are two GPU parameters related to GPU Direct SQL Execution. The first is pg_strom.gpudirect_enabled that simply turn on/off the function of GPU Direct SQL Execution. If off , GPU Direct SQL Execution should not be used regardless of the table size or physical location. Default is on . The other one is pg_strom.gpudirect_threshold which specifies the least table size to invoke GPU Direct SQL Execution. PG-Strom will choose GPU Direct SQL Execution when target table is located on NVME-SSD volume (or md-raid0 volume which consists of NVME-SSD only), and the table size is larger than this parameter. Its default configuration is 2GB . In other words, for obviously small tables, priority is given to reading from PostgreSQL's buffer rather than GPU-Direct SQL. Even if GPU Direct SQL Execution has advantages on a single table scan workload, usage of disk cache may work better on the second or later trial for the tables which are available to load onto the main memory. On course, this assumption is not always right depending on the workload charasteristics.","title":"Controls using GUC parameters"},{"location":"ssd2gpu/#ensure-usage-of-gpu-direct-sql-execution","text":"EXPLAIN command allows to ensure whether GPU Direct SQL Execution shall be used in the target query, or not. In the example below, a scan on the lineorder table by Custom Scan (GpuJoin) shows NVMe-Strom: enabled . In this case, GPU Direct SQL Execution shall be used to read from the lineorder table. # explain (costs off) select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_category = 'MFGR#12' and s_region = 'AMERICA' group by d_year, p_brand1 order by d_year, p_brand1; QUERY PLAN ---------------------------------------------------------------------------------------------- GroupAggregate Group Key: date1.d_year, part.p_brand1 -> Sort Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuPreAgg) Reduction: Local GPU Projection: pgstrom.psum((lo_revenue)::double precision), d_year, p_brand1 Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on lineorder GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue Outer Scan: lineorder Depth 1: GpuHashJoin (nrows 2406009600...97764190) HashKeys: lineorder.lo_partkey JoinQuals: (lineorder.lo_partkey = part.p_partkey) KDS-Hash (size: 10.67MB) Depth 2: GpuHashJoin (nrows 97764190...18544060) HashKeys: lineorder.lo_suppkey JoinQuals: (lineorder.lo_suppkey = supplier.s_suppkey) KDS-Hash (size: 131.59MB) Depth 3: GpuHashJoin (nrows 18544060...18544060) HashKeys: lineorder.lo_orderdate JoinQuals: (lineorder.lo_orderdate = date1.d_datekey) KDS-Hash (size: 461.89KB) NVMe-Strom: enabled -> Custom Scan (GpuScan) on part GPU Projection: p_brand1, p_partkey GPU Filter: (p_category = 'MFGR#12'::bpchar) -> Custom Scan (GpuScan) on supplier GPU Projection: s_suppkey GPU Filter: (s_region = 'AMERICA'::bpchar) -> Seq Scan on date1 (31 rows)","title":"Ensure usage of GPU Direct SQL Execution"},{"location":"ssd2gpu/#attension-for-visibility-map","text":"Right now, GPU routines of PG-Strom cannot run MVCC visibility checks per row, because only host code has a special data structure for visibility checks. It also leads a problem. We cannot know which row is visible, or invisible at the time when PG-Strom requires P2P DMA for NVMe-SSD, because contents of the storage blocks are not yet loaded to CPU/RAM, and MVCC related attributes are written with individual records. PostgreSQL had similar problem when it supports IndexOnlyScan. To address the problem, PostgreSQL has an infrastructure of visibility map which is a bunch of flags to indicate whether any records in a particular data block are visible from all the transactions. If associated bit is set, we can know the associated block has no invisible records without reading the block itself. GPU Direct SQL Execution utilizes this infrastructure. It checks the visibility map first, then only \"all-visible\" blocks are required to read with P2P DMA. VACUUM constructs visibility map, so you can enforce PostgreSQL to construct visibility map by explicit launch of VACUUM command. VACUUM ANALYZE linerorder;","title":"Attension for visibility map"},{"location":"troubles/","text":"Trouble Shooting Identify the problem In case when a particular workloads produce problems, it is the first step to identify which stuff may cause the problem. Unfortunately, much smaller number of developer supports the PG-Strom development community than PostgreSQL developer's community, thus, due to the standpoint of software quality and history, it is a reasonable estimation to suspect PG-Strom first. The pg_strom.enabled parameter allows to turn on/off all the functionality of PG-Strom at once. The configuration below disables PG-Strom, thus identically performs with the standard PostgreSQL. # SET pg_strom.enabled = off; In addition, we provide parameters to disable particular execution plan like GpuScan, GpuJoin and GpuPreAgg. See references/GUC Parameters for more details. Collecting crash dump Crash dump is very helpful for analysis of serious problems which lead system crash for example. This session introduces the way to collect crash dump of the PostgreSQL and PG-Strom process (CPU side) and PG-Strom's GPU kernel, and show the back trace on the serious problems. Add configuration on PostgreSQL startup For generation of crash dump (CPU-side) on process crash, you need to change the resource limitation of the operating system for size of core file PostgreSQL server process can generate. For generation of crash dump (GPU-size) on errors of GPU kernel, PostgreSQL server process has CUDA_ENABLE_COREDUMP_ON_EXCEPTION environment variable, and its value has 1 . You can put a configuration file at /etc/systemd/system/postgresql-.service.d/ when PostgreSQL is kicked by systemd. In case of RPM installation, a configuration file pg_strom.conf is also installed on the directory, and contains the following initial configuration. [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1 In CUDA 9.1, it usually takes more than several minutes to generate crash dump of GPU kernel, and it entirely stops response of the PostgreSQL session which causes an error. So, we recommend to set CUDA_ENABLE_COREDUMP_ON_EXCEPTION environment variable only if you investigate errors of GPU kernels which happen on a certain query. The default configuration on RPM installation comments out the line of CUDA_ENABLE_COREDUMP_ON_EXCEPTION environment variable. PostgreSQL server process should have unlimited Max core file size configuration, after the next restart. You can check it as follows. # cat /proc//limits Limit Soft Limit Hard Limit Units : : : : Max core file size unlimited unlimited bytes : : : : Installation of debuginfo package # yum install postgresql10-debuginfo pg_strom-PG10-debuginfo : ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: pg_strom-PG10-debuginfo x86_64 1.9-180301.el7 heterodb-debuginfo 766 k postgresql10-debuginfo x86_64 10.3-1PGDG.rhel7 pgdg10 9.7 M Transaction Summary ================================================================================ Install 2 Packages : Installed: pg_strom-PG10-debuginfo.x86_64 0:1.9-180301.el7 postgresql10-debuginfo.x86_64 0:10.3-1PGDG.rhel7 Complete! Checking the back-trace on CPU side The kernel parameter kernel.core_pattern and kernel.core_uses_pid determine the path where crash dump is written out. It is usually created on the current working directory of the process, check /var/lib/pgdata where the database cluster is deployed, if you start PostgreSQL server using systemd. Once core. file gets generated, you can check its back-trace to reach system crash using gdb . gdb speficies the core file by -c option, and the crashed program by -f option. # gdb -c /var/lib/pgdata/core.134680 -f /usr/pgsql-10/bin/postgres GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7_4.1 : (gdb) bt #0 0x00007fb942af3903 in __epoll_wait_nocancel () from /lib64/libc.so.6 #1 0x00000000006f71ae in WaitEventSetWaitBlock (nevents=1, occurred_events=0x7ffee51e1d70, cur_timeout=-1, set=0x2833298) at latch.c:1048 #2 WaitEventSetWait (set=0x2833298, timeout=timeout@entry-1, occurred_events=occurred_events@entry0x7ffee51e1d70, nevents=nevents@entry1, wait_event_info=wait_event_info@entry100663296) at latch.c:1000 #3 0x00000000006210fb in secure_read (port=0x2876120, ptr=0xcaa7e0 , len=8192) at be-secure.c:166 #4 0x000000000062b6e8 in pq_recvbuf () at pqcomm.c:963 #5 0x000000000062c345 in pq_getbyte () at pqcomm.c:1006 #6 0x0000000000718682 in SocketBackend (inBuf=0x7ffee51e1ef0) at postgres.c:328 #7 ReadCommand (inBuf=0x7ffee51e1ef0) at postgres.c:501 #8 PostgresMain (argc=, argv=argv@entry0x287bb68, dbname=0x28333f8 \"postgres\", username=) at postgres.c:4030 #9 0x000000000047adbc in BackendRun (port=0x2876120) at postmaster.c:4405 #10 BackendStartup (port=0x2876120) at postmaster.c:4077 #11 ServerLoop () at postmaster.c:1755 #12 0x00000000006afb7f in PostmasterMain (argc=argc@entry3, argv=argv@entry0x2831280) at postmaster.c:1363 #13 0x000000000047bbef in main (argc=3, argv=0x2831280) at main.c:228 bt command of gdb displays the backtrace. In this case, I sent SIGSEGV signal to the PostgreSQL backend which is waiting for queries from the client for intentional crash, the process got crashed at __epoll_wait_nocancel invoked by WaitEventSetWait . Checking the backtrace on GPU Crash dump of GPU kernel is generated on the current working directory of PostgreSQL server process, unless you don't specify the path using CUDA_COREDUMP_FILE environment variable explicitly. Check /var/lib/pgdata where the database cluster is deployed, if systemd started PostgreSQL. Dump file will have the following naming convension. core___.nvcudmp Note that the dump-file of GPU kernel contains no debug information like symbol information in the default configuration. It is nearly impossible to investigate the problem, so enable inclusion of debug information for the GPU programs generated by PG-Strom, as follows. Also note than we don't recommend to turn on the configuration for daily usage, because it makes query execution performan slow down. Turn on only when you investigate the troubles. nvme=# set pg_strom.debug_jit_compile_options = on; SET You can check crash dump of the GPU kernel using cuda-gdb command. # /usr/local/cuda/bin/cuda-gdb NVIDIA (R) CUDA Debugger 9.1 release Portions Copyright (C) 2007-2017 NVIDIA Corporation : For help, type \"help\". Type \"apropos word\" to search for commands related to \"word\". (cuda-gdb) Run cuda-gdb command, then load the crash dump file above using target command on the prompt. (cuda-gdb) target cudacore /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp Opening GPU coredump: /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp [New Thread 216240] CUDA Exception: Warp Illegal Address The exception was triggered at PC 0x7ff4dc82f930 (cuda_gpujoin.h:1159) [Current focus set to CUDA kernel 0, grid 1, block (0,0,0), thread (0,0,0), device 0, sm 0, warp 0, lane 0] #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 1159 while (khitem && khitem->hash != hash_value) You can check backtrace where the error happened on GPU kernel using bt command. (cuda-gdb) bt #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 #1 0x00007ff4dc9428f0 in gpujoin_main<<<(30,1,1),(256,1,1)>>> (kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, kds_dst=0x7fe9e8800030, kparams_gpreagg=0x0) at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1347 Please check CUDA Toolkit Documentation - CUDA-GDB for more detailed usage of cuda-gdb command.","title":"Trouble Shooting"},{"location":"troubles/#trouble-shooting","text":"","title":"Trouble Shooting"},{"location":"troubles/#identify-the-problem","text":"In case when a particular workloads produce problems, it is the first step to identify which stuff may cause the problem. Unfortunately, much smaller number of developer supports the PG-Strom development community than PostgreSQL developer's community, thus, due to the standpoint of software quality and history, it is a reasonable estimation to suspect PG-Strom first. The pg_strom.enabled parameter allows to turn on/off all the functionality of PG-Strom at once. The configuration below disables PG-Strom, thus identically performs with the standard PostgreSQL. # SET pg_strom.enabled = off; In addition, we provide parameters to disable particular execution plan like GpuScan, GpuJoin and GpuPreAgg. See references/GUC Parameters for more details.","title":"Identify the problem"},{"location":"troubles/#collecting-crash-dump","text":"Crash dump is very helpful for analysis of serious problems which lead system crash for example. This session introduces the way to collect crash dump of the PostgreSQL and PG-Strom process (CPU side) and PG-Strom's GPU kernel, and show the back trace on the serious problems.","title":"Collecting crash dump"},{"location":"troubles/#add-configuration-on-postgresql-startup","text":"For generation of crash dump (CPU-side) on process crash, you need to change the resource limitation of the operating system for size of core file PostgreSQL server process can generate. For generation of crash dump (GPU-size) on errors of GPU kernel, PostgreSQL server process has CUDA_ENABLE_COREDUMP_ON_EXCEPTION environment variable, and its value has 1 . You can put a configuration file at /etc/systemd/system/postgresql-.service.d/ when PostgreSQL is kicked by systemd. In case of RPM installation, a configuration file pg_strom.conf is also installed on the directory, and contains the following initial configuration. [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1 In CUDA 9.1, it usually takes more than several minutes to generate crash dump of GPU kernel, and it entirely stops response of the PostgreSQL session which causes an error. So, we recommend to set CUDA_ENABLE_COREDUMP_ON_EXCEPTION environment variable only if you investigate errors of GPU kernels which happen on a certain query. The default configuration on RPM installation comments out the line of CUDA_ENABLE_COREDUMP_ON_EXCEPTION environment variable. PostgreSQL server process should have unlimited Max core file size configuration, after the next restart. You can check it as follows. # cat /proc//limits Limit Soft Limit Hard Limit Units : : : : Max core file size unlimited unlimited bytes : : : :","title":"Add configuration on PostgreSQL startup"},{"location":"troubles/#installation-of-debuginfo-package","text":"# yum install postgresql10-debuginfo pg_strom-PG10-debuginfo : ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: pg_strom-PG10-debuginfo x86_64 1.9-180301.el7 heterodb-debuginfo 766 k postgresql10-debuginfo x86_64 10.3-1PGDG.rhel7 pgdg10 9.7 M Transaction Summary ================================================================================ Install 2 Packages : Installed: pg_strom-PG10-debuginfo.x86_64 0:1.9-180301.el7 postgresql10-debuginfo.x86_64 0:10.3-1PGDG.rhel7 Complete!","title":"Installation of debuginfo package"},{"location":"troubles/#checking-the-back-trace-on-cpu-side","text":"The kernel parameter kernel.core_pattern and kernel.core_uses_pid determine the path where crash dump is written out. It is usually created on the current working directory of the process, check /var/lib/pgdata where the database cluster is deployed, if you start PostgreSQL server using systemd. Once core. file gets generated, you can check its back-trace to reach system crash using gdb . gdb speficies the core file by -c option, and the crashed program by -f option. # gdb -c /var/lib/pgdata/core.134680 -f /usr/pgsql-10/bin/postgres GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7_4.1 : (gdb) bt #0 0x00007fb942af3903 in __epoll_wait_nocancel () from /lib64/libc.so.6 #1 0x00000000006f71ae in WaitEventSetWaitBlock (nevents=1, occurred_events=0x7ffee51e1d70, cur_timeout=-1, set=0x2833298) at latch.c:1048 #2 WaitEventSetWait (set=0x2833298, timeout=timeout@entry-1, occurred_events=occurred_events@entry0x7ffee51e1d70, nevents=nevents@entry1, wait_event_info=wait_event_info@entry100663296) at latch.c:1000 #3 0x00000000006210fb in secure_read (port=0x2876120, ptr=0xcaa7e0 , len=8192) at be-secure.c:166 #4 0x000000000062b6e8 in pq_recvbuf () at pqcomm.c:963 #5 0x000000000062c345 in pq_getbyte () at pqcomm.c:1006 #6 0x0000000000718682 in SocketBackend (inBuf=0x7ffee51e1ef0) at postgres.c:328 #7 ReadCommand (inBuf=0x7ffee51e1ef0) at postgres.c:501 #8 PostgresMain (argc=, argv=argv@entry0x287bb68, dbname=0x28333f8 \"postgres\", username=) at postgres.c:4030 #9 0x000000000047adbc in BackendRun (port=0x2876120) at postmaster.c:4405 #10 BackendStartup (port=0x2876120) at postmaster.c:4077 #11 ServerLoop () at postmaster.c:1755 #12 0x00000000006afb7f in PostmasterMain (argc=argc@entry3, argv=argv@entry0x2831280) at postmaster.c:1363 #13 0x000000000047bbef in main (argc=3, argv=0x2831280) at main.c:228 bt command of gdb displays the backtrace. In this case, I sent SIGSEGV signal to the PostgreSQL backend which is waiting for queries from the client for intentional crash, the process got crashed at __epoll_wait_nocancel invoked by WaitEventSetWait .","title":"Checking the back-trace on CPU side"},{"location":"troubles/#checking-the-backtrace-on-gpu","text":"Crash dump of GPU kernel is generated on the current working directory of PostgreSQL server process, unless you don't specify the path using CUDA_COREDUMP_FILE environment variable explicitly. Check /var/lib/pgdata where the database cluster is deployed, if systemd started PostgreSQL. Dump file will have the following naming convension. core___.nvcudmp Note that the dump-file of GPU kernel contains no debug information like symbol information in the default configuration. It is nearly impossible to investigate the problem, so enable inclusion of debug information for the GPU programs generated by PG-Strom, as follows. Also note than we don't recommend to turn on the configuration for daily usage, because it makes query execution performan slow down. Turn on only when you investigate the troubles. nvme=# set pg_strom.debug_jit_compile_options = on; SET You can check crash dump of the GPU kernel using cuda-gdb command. # /usr/local/cuda/bin/cuda-gdb NVIDIA (R) CUDA Debugger 9.1 release Portions Copyright (C) 2007-2017 NVIDIA Corporation : For help, type \"help\". Type \"apropos word\" to search for commands related to \"word\". (cuda-gdb) Run cuda-gdb command, then load the crash dump file above using target command on the prompt. (cuda-gdb) target cudacore /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp Opening GPU coredump: /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp [New Thread 216240] CUDA Exception: Warp Illegal Address The exception was triggered at PC 0x7ff4dc82f930 (cuda_gpujoin.h:1159) [Current focus set to CUDA kernel 0, grid 1, block (0,0,0), thread (0,0,0), device 0, sm 0, warp 0, lane 0] #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 1159 while (khitem && khitem->hash != hash_value) You can check backtrace where the error happened on GPU kernel using bt command. (cuda-gdb) bt #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 #1 0x00007ff4dc9428f0 in gpujoin_main<<<(30,1,1),(256,1,1)>>> (kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, kds_dst=0x7fe9e8800030, kparams_gpreagg=0x0) at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1347 Please check CUDA Toolkit Documentation - CUDA-GDB for more detailed usage of cuda-gdb command.","title":"Checking the backtrace on GPU"}]} \ No newline at end of file +{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Home This chapter introduces the overview of PG-Strom, and developer's community. What is PG-Strom? PG-Strom is an extension module of PostgreSQL designed for version 15 or later. By utilization of GPU (Graphic Processor Unit) device which has thousands cores per chip, it enables to accelerate SQL workloads for data analytics or batch processing to big data set. Its core features are GPU code generator that automatically generates GPU program according to the SQL commands and asynchronous parallel execution engine to run SQL workloads on GPU device. The latest version supports SCAN (evaluation of WHERE-clause), JOIN and GROUP BY workloads. In the case when GPU-processing has advantage, PG-Strom replaces the vanilla implementation of PostgreSQL and transparentlly works from users and applications. PG-Strom has two storage options. The first one is the heap storage system of PostgreSQL. It is not always optimal for aggregation / analysis workloads because of its row data format, on the other hands, it has an advantage to run aggregation workloads without data transfer from the transactional database. The other one is Apache Arrow files, that have structured columnar format. Even though it is not suitable for update per row basis, it enables to import large amount of data efficiently, and efficiently search / aggregate the data through foreign data wrapper (FDW). One of the characteristic feature of PG-Strom is GPUDirect SQL that bypasses the CPU/RAM to read the data from NVME / NVME-oF to the GPU directly. SQL processing on the GPU maximizes the bandwidth of these devices. PG-Strom v3.0 newly supports NVIDIA GPUDirect Storage, it allows to support SDS (Software Defined Storage) over the NVME-oF protocol and shared filesystems. The v3.0 newly supports execution of some PostGIS function and GiST index search on the GPU side. Along with the GPU cache, that duplicates the table contents often updated very frequently, it enables search / analysis processing based on the real-time locational information. The v5.0 entirely revised the software architecture design, like update of the process model (multi-process to multi-thread), or switch from the CUDA C++ native code to the portable pseudo code. It improves overall performance and stability. License and Copyright PG-Strom is an open source software distributed under the PostgreSQL License. See LICENSE for the license details. Community Please post your questions, requests and trouble reports to the Discussion of GitHub\u306e . Please pay attention it is a public board for world wide. So, it is your own responsibility not to disclose confidential information. The primary language of the discussion board is English. On the other hands, we know major portion of PG-Strom users are Japanese because of its development history, so we admit to have a discussion on the list in Japanese language. In this case, please don't forget to attach (JP) prefix on the subject like, for non-Japanese speakers to skip messages. Bug or troubles report If you got troubles like incorrect results, system crash / lockup, or something strange behavior, please open a new issue at the PG-Strom Issue Tracker . Please ensure the items below on bug reports. Whether you can reproduce the same problem on the latest revision? Hopefully, we recommend to test on the latest OS, CUDA, PostgreSQL and related software. Whether you can reproduce the same problem if PG-Strom is disabled? GUC option pg_strom.enabled can turn on/off PG-Strom. Is there any known issues on the issue tracker of GitHub? Please don't forget to search closed issues The information below are helpful for bug-reports. Steps to reproduce the problem (Data and Query) Output of EXPLAIN VERBOSE for the queries in trouble. Data structure of the tables involved with \\d+
on psql command. Log messages (verbose messages are more helpful) Status of GUC options you modified from the default configurations. Hardware configuration - GPU model and host RAM size especially. If you are not certain whether the strange behavior on your site is bug or not, please report it to the discussion board prior to the open a new issue ticket. Developers may be able to suggest you next action - like a request for extra information. New features proposition If you have any ideas of new features, please open a new issue with feature tag at the PG-Strom Issue Tracker , then have a discussion with other developers. A preferable design proposal will contain the items below. What is your problem to solve / improve? How much serious is it on your workloads / user case? Way to implement your idea? Expected downside, if any. Once we could make a consensus about its necessity, coordinator will attach accepted tag and the issue ticket is used to track rest of the development. Elsewhere, the issue ticket got rejected tag and closed. Once a proposal got rejected, we may have different decision in the future. If comprehensive circumstance would be changed, you don't need to hesitate revised proposition again. On the development stage, please attach patch file on the issue ticket. We don't use pull request. Support Policy The PG-Strom development team will support the latest release which are distributed from the HeteroDB Software Distribution Center only. So, people who met troubles needs to ensure the problems can be reproduced with the latest release. Please note that it is volunteer based community support policy, so our support is best effort and no SLA definition. If you need commercial support, contact to HeteroDB,Inc (contact@heterodbcom).","title":"Home"},{"location":"#home","text":"This chapter introduces the overview of PG-Strom, and developer's community.","title":"Home"},{"location":"#what-is-pg-strom","text":"PG-Strom is an extension module of PostgreSQL designed for version 15 or later. By utilization of GPU (Graphic Processor Unit) device which has thousands cores per chip, it enables to accelerate SQL workloads for data analytics or batch processing to big data set. Its core features are GPU code generator that automatically generates GPU program according to the SQL commands and asynchronous parallel execution engine to run SQL workloads on GPU device. The latest version supports SCAN (evaluation of WHERE-clause), JOIN and GROUP BY workloads. In the case when GPU-processing has advantage, PG-Strom replaces the vanilla implementation of PostgreSQL and transparentlly works from users and applications. PG-Strom has two storage options. The first one is the heap storage system of PostgreSQL. It is not always optimal for aggregation / analysis workloads because of its row data format, on the other hands, it has an advantage to run aggregation workloads without data transfer from the transactional database. The other one is Apache Arrow files, that have structured columnar format. Even though it is not suitable for update per row basis, it enables to import large amount of data efficiently, and efficiently search / aggregate the data through foreign data wrapper (FDW). One of the characteristic feature of PG-Strom is GPUDirect SQL that bypasses the CPU/RAM to read the data from NVME / NVME-oF to the GPU directly. SQL processing on the GPU maximizes the bandwidth of these devices. PG-Strom v3.0 newly supports NVIDIA GPUDirect Storage, it allows to support SDS (Software Defined Storage) over the NVME-oF protocol and shared filesystems. The v3.0 newly supports execution of some PostGIS function and GiST index search on the GPU side. Along with the GPU cache, that duplicates the table contents often updated very frequently, it enables search / analysis processing based on the real-time locational information. The v5.0 entirely revised the software architecture design, like update of the process model (multi-process to multi-thread), or switch from the CUDA C++ native code to the portable pseudo code. It improves overall performance and stability.","title":"What is PG-Strom?"},{"location":"#license-and-copyright","text":"PG-Strom is an open source software distributed under the PostgreSQL License. See LICENSE for the license details.","title":"License and Copyright"},{"location":"#community","text":"Please post your questions, requests and trouble reports to the Discussion of GitHub\u306e . Please pay attention it is a public board for world wide. So, it is your own responsibility not to disclose confidential information. The primary language of the discussion board is English. On the other hands, we know major portion of PG-Strom users are Japanese because of its development history, so we admit to have a discussion on the list in Japanese language. In this case, please don't forget to attach (JP) prefix on the subject like, for non-Japanese speakers to skip messages.","title":"Community"},{"location":"#bug-or-troubles-report","text":"If you got troubles like incorrect results, system crash / lockup, or something strange behavior, please open a new issue at the PG-Strom Issue Tracker . Please ensure the items below on bug reports. Whether you can reproduce the same problem on the latest revision? Hopefully, we recommend to test on the latest OS, CUDA, PostgreSQL and related software. Whether you can reproduce the same problem if PG-Strom is disabled? GUC option pg_strom.enabled can turn on/off PG-Strom. Is there any known issues on the issue tracker of GitHub? Please don't forget to search closed issues The information below are helpful for bug-reports. Steps to reproduce the problem (Data and Query) Output of EXPLAIN VERBOSE for the queries in trouble. Data structure of the tables involved with \\d+
on psql command. Log messages (verbose messages are more helpful) Status of GUC options you modified from the default configurations. Hardware configuration - GPU model and host RAM size especially. If you are not certain whether the strange behavior on your site is bug or not, please report it to the discussion board prior to the open a new issue ticket. Developers may be able to suggest you next action - like a request for extra information.","title":"Bug or troubles report"},{"location":"#new-features-proposition","text":"If you have any ideas of new features, please open a new issue with feature tag at the PG-Strom Issue Tracker , then have a discussion with other developers. A preferable design proposal will contain the items below. What is your problem to solve / improve? How much serious is it on your workloads / user case? Way to implement your idea? Expected downside, if any. Once we could make a consensus about its necessity, coordinator will attach accepted tag and the issue ticket is used to track rest of the development. Elsewhere, the issue ticket got rejected tag and closed. Once a proposal got rejected, we may have different decision in the future. If comprehensive circumstance would be changed, you don't need to hesitate revised proposition again. On the development stage, please attach patch file on the issue ticket. We don't use pull request.","title":"New features proposition"},{"location":"#support-policy","text":"The PG-Strom development team will support the latest release which are distributed from the HeteroDB Software Distribution Center only. So, people who met troubles needs to ensure the problems can be reproduced with the latest release. Please note that it is volunteer based community support policy, so our support is best effort and no SLA definition. If you need commercial support, contact to HeteroDB,Inc (contact@heterodbcom).","title":"Support Policy"},{"location":"arrow_fdw/","text":"Apache Arrow (Columnar Store) Overview PostgreSQL tables internally consist of 8KB blocks 1 , and block contains tuples which is a data structure of all the attributes and metadata per row. It collocates date of a row closely, so it works effectively for INSERT/UPDATE-major workloads, but not suitable for summarizing or analytics of mass-data. It is not usual to reference all the columns in a table on mass-data processing, and we tend to reference a part of columns in most cases. In this case, the storage I/O bandwidth consumed by unreferenced columns are waste, however, we have no easy way to fetch only particular columns referenced from the row-oriented data structure. In case of column oriented data structure, in an opposite manner, it has extreme disadvantage on INSERT/UPDATE-major workloads, however, it can pull out maximum performance of storage I/O on mass-data processing workloads because it can loads only referenced columns. From the standpoint of processor efficiency also, column-oriented data structure looks like a flat array that pulls out maximum bandwidth of memory subsystem for GPU, by special memory access pattern called Coalesced Memory Access. What is Apache Arrow? Apache Arrow is a data format of structured data to save in columnar-form and to exchange other applications. Some applications for big-data processing support the format, and it is easy for self-developed applications to use Apache Arrow format since they provides libraries for major programming languages like C,C++ or Python. Apache Arrow format file internally contains Schema portion to define data structure, and one or more RecordBatch to save columnar-data based on the schema definition. For data types, it supports integers, strint (variable-length), date/time types and so on. Indivisual columnar data has its internal representation according to the data types. Data representation in Apache Arrow is not identical with the representation in PostgreSQL. For example, epoch of timestamp in Arrow is 1970-01-01 and it supports multiple precision. In contrast, epoch of timestamp in PostgreSQL is 2001-01-01 and it has microseconds accuracy. Arrow_Fdw allows to read Apache Arrow files on PostgreSQL using foreign table mechanism. If an Arrow file contains 8 of record batches that has million items for each column data, for example, we can access 8 million rows on the Arrow files through the foreign table. Operations Creation of foreign tables Usually it takes the 3 steps below to create a foreign table. Define a foreign-data-wrapper using CREATE FOREIGN DATA WRAPPER command Define a foreign server using CREATE SERVER command Define a foreign table using CREATE FOREIGN TABLE command The first 2 steps above are included in the CREATE EXTENSION pg_strom command. All you need to run individually is CREATE FOREIGN TABLE command last. CREATE FOREIGN TABLE flogdata ( ts timestamp, sensor_id int, signal1 smallint, signal2 smallint, signal3 smallint, signal4 smallint, ) SERVER arrow_fdw OPTIONS (file '/path/to/logdata.arrow'); Data type of columns specified by the CREATE FOREIGN TABLE command must be matched to schema definition of the Arrow files to be mapped. Arrow_Fdw also supports a useful manner using IMPORT FOREIGN SCHEMA statement. It automatically generates a foreign table definition using schema definition of the Arrow files. It specifies the foreign table name, schema name to import, and path name of the Arrow files using OPTION-clause. Schema definition of Arrow files contains data types and optional column name for each column. It declares a new foreign table using these information. IMPORT FOREIGN SCHEMA flogdata FROM SERVER arrow_fdw INTO public OPTIONS (file '/path/to/logdata.arrow'); Foreign table options Arrow_Fdw supports the options below. Right now, all the options are for foreign tables. file=PATHNAME It maps an Arrow file specified on the foreign table. files=PATHNAME1[,PATHNAME2...] It maps multiple Arrow files specified by comma (,) separated files list on the foreign table. dir=DIRNAME It maps all the Arrow files in the directory specified on the foreign table. suffix=SUFFIX When dir option is given, it maps only files with the specified suffix, like .arrow` for example. parallel_workers=N_WORKERS It tells the number of workers that should be used to assist a parallel scan of this foreign table; equivalent to parallel_workers storage parameter at normal tables. writable=(true|false) It allows execution of INSERT command on the foreign table. See the section of \"Writable Arrow_Fdw\" Data type mapping Arrow data types are mapped on PostgreSQL data types as follows. Int mapped to either of int1 , int2 , int4 or int8 according to the bitWidth attribute. is_signed attribute shall be ignored. int1 is an enhanced data type by PG-Strom. FloatingPoint mapped to either of float2 , float4 or float8 according to the precision attribute. float2 is an enhanced data type by PG-Strom. Binary mapped to bytea data type Decimal mapped to numeric data type Date mapped to date data type; to be adjusted as if it has unit=Day precision. Time mapped to time data type; to be adjusted as if it has unit=MicroSecond precision. Timestamp mapped to timestamp data type; to be adjusted as if it has unit=MicroSecond precision. Interval mapped to interval data type. List mapped to 1-dimensional array of the element data type. Struct mapped to compatible composite data type; that shall be defined preliminary. FixedSizeBinary mapped to char(n) data type according to the byteWidth attribute. If pg_type=TYPENAME is configured, PG-Strom may assign the configured data type. Right now, inet and macaddr are supported. Union , Map , Duration , LargeBinary , LargeUtf8 , LargeList Right now, PG-Strom cannot map these Arrow data types onto any of PostgreSQL data types. How to read EXPLAIN EXPLAIN command show us information about Arrow files reading. The example below is an output of query execution plan that includes f_lineorder foreign table that mapps an Arrow file of 503GB. =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) -> Custom Scan (GpuPreAgg) on f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..78.95 rows=365 width=4) Filter: (d_year = 1993) (12 rows) According to the EXPLAIN output, we can see Custom Scan (GpuPreAgg) scans f_lineorder foreign table. file0 item shows the filename ( /opt/nvme/lineorder_s999.arrow ) on behalf of the foreign table and its size. If multiple files are mapped, any files are individually shown, like file1 , file2 , ... The referenced item shows the list of referenced columns. We can see this query touches lo_orderdate , lo_quantity , lo_extendedprice and lo_discount columns. In addition, GPU-Direct SQL: enabled (GPU-0) shows us the scan on f_lineorder uses GPU-Direct SQL mechanism. VERBOSE option outputs more detailed information. =# EXPLAIN VERBOSE SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) Output: pgstrom.sum_int((pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint))) -> Custom Scan (GpuPreAgg) on public.f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) Output: (pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint)) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) lo_orderdate: 22.35GB lo_quantity: 22.35GB lo_extendedprice: 22.35GB lo_discount: 22.35GB GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , , , KVecs-Buffer: nbytes: 51200, ndims: 3, items=[kvec0=<0x0000-27ff, type='int4', expr='lo_discount'>, kvec1=<0x2800-4fff, type='int4', expr='lo_quantity'>, kvec2=<0x5000-77ff, type='int4', expr='lo_extendedprice'>, kvec3=<0x7800-9fff, type='int4', expr='lo_orderdate'>, kvec4=<0xa000-c7ff, type='int4', expr='d_datekey'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, , , ]}, items[1]={LoadVars(depth=1): kvars=[]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, , ]}}, items[1]={MoveVars(depth=1): items=[, ]}}} Scan Quals OpCode: {Bool::AND args=[{Func(bool)::int4ge args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='1'}]}, {Func(bool)::int4le args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='3'}]}, {Func(bool)::int4lt args=[{Var(int4): slot=1, expr='lo_quantity'}, {Const(int4): value='25'}]}]} Join Quals OpCode: {Packed items[1]={JoinQuals: {Func(bool)::int4eq args=[{Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}, {Var(int4): slot=5, expr='d_datekey'}]}}} Join HashValue OpCode: {Packed items[1]={HashValue arg={Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}}} Partial Aggregation OpCode: {AggFuncs arg={SaveExpr: arg={Func(int8)::int8 arg={Func(int4)::int4mul args=[{Var(int4): kvec=0x5000-7800, expr='lo_extendedprice'}, {Var(int4): kvec=0x0000-2800, expr='lo_discount'}]}}}} Partial Function BufSz: 16 -> Seq Scan on public.date1 (cost=0.00..78.95 rows=365 width=4) Output: date1.d_datekey Filter: (date1.d_year = 1993) (28 rows) The verbose output additionally displays amount of column-data to be loaded on reference of columns. The load of lo_orderdate , lo_quantity , lo_extendedprice and lo_discount columns needs to read 89.41GB in total. It is 17.8% towards the filesize (502.93GB). How to make Arrow files This section introduces the way to transform dataset already stored in PostgreSQL database system into Apache Arrow file. Using PyArrow+Pandas A pair of PyArrow module, developed by Arrow developers community, and Pandas data frame can dump PostgreSQL database into an Arrow file. The example below reads all the data in table t0 , then write out them into /tmp/t0.arrow . import pyarrow as pa import pandas as pd X = pd.read_sql(sql=\"SELECT * FROM t0\", con=\"postgresql://localhost/postgres\") Y = pa.Table.from_pandas(X) f = pa.RecordBatchFileWriter('/tmp/t0.arrow', Y.schema) f.write_table(Y,1000000) # RecordBatch for each million rows f.close() Please note that the above operation once keeps query result of the SQL on memory, so should pay attention on memory consumption if you want to transfer massive rows at once. Using Pg2Arrow On the other hand, pg2arrow command, developed by PG-Strom Development Team, enables us to write out query result into Arrow file. This tool is designed to write out massive amount of data into storage device like NVME-SSD. It fetch query results from PostgreSQL database system, and write out Record Batches of Arrow format for each data size specified by the -s|--segment-size option. Thus, its memory consumption is relatively reasonable. pg2arrow command is distributed with PG-Strom. It shall be installed on the bin directory of PostgreSQL related utilities. $ pg2arrow --help Usage: pg2arrow [OPTION] [database] [username] General options: -d, --dbname=DBNAME Database name to connect to -c, --command=COMMAND SQL command to run -t, --table=TABLENAME Equivalent to '-c SELECT * FROM TABLENAME' (-c and -t are exclusive, either of them must be given) --inner-join=SUB_COMMAND --outer-join=SUB_COMMAND -o, --output=FILENAME result file in Apache Arrow format --append=FILENAME result Apache Arrow file to be appended (--output and --append are exclusive. If neither of them are given, it creates a temporary file.) -S, --stat[=COLUMNS] embeds min/max statistics for each record batch COLUMNS is a comma-separated list of the target columns if partially enabled. Arrow format options: -s, --segment-size=SIZE size of record batch for each Connection options: -h, --host=HOSTNAME database server host -p, --port=PORT database server port -u, --user=USERNAME database user name -w, --no-password never prompt for password -W, --password force password prompt Other options: --dump=FILENAME dump information of arrow file --progress shows progress of the job --set=NAME:VALUE config option to set before SQL execution --help shows this message Report bugs to . The -h or -U option specifies the connection parameters of PostgreSQL, like psql or pg_dump . The simplest usage of this command is running a SQL command specified by -c|--command option on PostgreSQL server, then write out results into the file specified by -o|--output option in Arrow format. --append option is available, instead of -o|--output option. It means appending data to existing Apache Arrow file. In this case, the target Apache Arrow file must have fully identical schema definition towards the specified SQL command. The example below reads all the data in table t0 , then write out them into the file /tmp/t0.arrow . $ pg2arrow -U kaigai -d postgres -c \"SELECT * FROM t0\" -o /tmp/t0.arrow Although it is an option for developers, --dump prints schema definition and record-batch location and size of Arrow file in human readable form. --progress option enables to show progress of the task. It is useful when a huge table is transformed to Apache Arrow format. Advanced Usage SSDtoGPU Direct SQL In case when all the Arrow files mapped on the Arrow_Fdw foreign table satisfies the terms below, PG-Strom enables SSD-to-GPU Direct SQL to load columnar data. Arrow files are on NVME-SSD volume. NVME-SSD volume is managed by Ext4 filesystem. Total size of Arrow files exceeds the pg_strom.nvme_strom_threshold configuration. Partition configuration Arrow_Fdw foreign tables can be used as a part of partition leafs. Usual PostgreSQL tables can be mixtured with Arrow_Fdw foreign tables. So, pay attention Arrow_Fdw foreign table does not support any writer operations. And, make boundary condition of the partition consistent to the contents of the mapped Arrow file. It is a responsibility of the database administrators. A typical usage scenario is processing of long-standing accumulated log-data. Unlike transactional data, log-data is mostly write-once and will never be updated / deleted. Thus, by migration of the log-data after a lapse of certain period into Arrow_Fdw foreign table that is read-only but rapid processing, we can accelerate summarizing and analytics workloads. In addition, log-data likely have timestamp, so it is quite easy design to add partition leafs periodically, like monthly, weekly or others. The example below defines a partitioned table that mixes a normal PostgreSQL table and Arrow_Fdw foreign tables. The normal PostgreSQL table, is read-writable, is specified as default partition, so DBA can migrate only past log-data into Arrow_Fdw foreign table under the database system operations. CREATE TABLE lineorder ( lo_orderkey numeric, lo_linenumber integer, lo_custkey numeric, lo_partkey integer, lo_suppkey numeric, lo_orderdate integer, lo_orderpriority character(15), lo_shippriority character(1), lo_quantity numeric, lo_extendedprice numeric, lo_ordertotalprice numeric, lo_discount numeric, lo_revenue numeric, lo_supplycost numeric, lo_tax numeric, lo_commit_date character(8), lo_shipmode character(10) ) PARTITION BY RANGE (lo_orderdate); CREATE TABLE lineorder__now PARTITION OF lineorder default; CREATE FOREIGN TABLE lineorder__1993 PARTITION OF lineorder FOR VALUES FROM (19930101) TO (19940101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1993.arrow'); CREATE FOREIGN TABLE lineorder__1994 PARTITION OF lineorder FOR VALUES FROM (19940101) TO (19950101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1994.arrow'); CREATE FOREIGN TABLE lineorder__1995 PARTITION OF lineorder FOR VALUES FROM (19950101) TO (19960101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1995.arrow'); CREATE FOREIGN TABLE lineorder__1996 PARTITION OF lineorder FOR VALUES FROM (19960101) TO (19970101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1996.arrow'); Below is the query execution plan towards the table. By the query condition lo_orderdate between 19950701 and 19960630 that touches boundary condition of the partition, the partition leaf lineorder__1993 and lineorder__1994 are pruned, so it makes a query execution plan to read other (foreign) tables only. =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM lineorder,date1 WHERE lo_orderdate = d_datekey AND lo_orderdate between 19950701 and 19960630 AND lo_discount between 1 and 3 ABD lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=172088.90..172088.91 rows=1 width=32) -> Hash Join (cost=10548.86..172088.51 rows=77 width=64) Hash Cond: (lineorder__1995.lo_orderdate = date1.d_datekey) -> Append (cost=10444.35..171983.80 rows=77 width=67) -> Custom Scan (GpuScan) on lineorder__1995 (cost=10444.35..33671.87 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1995.arrow (size: 892.57MB) -> Custom Scan (GpuScan) on lineorder__1996 (cost=10444.62..33849.21 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1996.arrow (size: 897.87MB) -> Custom Scan (GpuScan) on lineorder__now (cost=11561.33..104462.33 rows=1 width=18) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash (cost=72.56..72.56 rows=2556 width=4) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=4) (16 rows) The operation below extracts the data in 1997 from lineorder__now table, then move to a new Arrow_Fdw foreign table. $ pg2arrow -d sample -o /opt/tmp/lineorder_1997.arrow \\ -c \"SELECT * FROM lineorder WHERE lo_orderdate between 19970101 and 19971231\" pg2arrow command extracts the data in 1997 from the lineorder table into a new Arrow file. BEGIN; -- -- remove rows in 1997 from the read-writable table -- DELETE FROM lineorder WHERE lo_orderdate BETWEEN 19970101 AND 19971231; -- -- define a new partition leaf which maps log-data in 1997 -- CREATE FOREIGN TABLE lineorder__1997 PARTITION OF lineorder FOR VALUES FROM (19970101) TO (19980101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1997.arrow'); COMMIT; A series of operations above delete the data in 1997 from lineorder__new that is a PostgreSQL table, then maps an Arrow file ( /opt/tmp/lineorder_1997.arrow ) which contains an identical contents as a foreign table lineorder__1997 . For correctness, block size is configurable on build from 4KB to 32KB. \u21a9","title":"Apache Arrow"},{"location":"arrow_fdw/#apache-arrow-columnar-store","text":"","title":"Apache Arrow (Columnar Store)"},{"location":"arrow_fdw/#overview","text":"PostgreSQL tables internally consist of 8KB blocks 1 , and block contains tuples which is a data structure of all the attributes and metadata per row. It collocates date of a row closely, so it works effectively for INSERT/UPDATE-major workloads, but not suitable for summarizing or analytics of mass-data. It is not usual to reference all the columns in a table on mass-data processing, and we tend to reference a part of columns in most cases. In this case, the storage I/O bandwidth consumed by unreferenced columns are waste, however, we have no easy way to fetch only particular columns referenced from the row-oriented data structure. In case of column oriented data structure, in an opposite manner, it has extreme disadvantage on INSERT/UPDATE-major workloads, however, it can pull out maximum performance of storage I/O on mass-data processing workloads because it can loads only referenced columns. From the standpoint of processor efficiency also, column-oriented data structure looks like a flat array that pulls out maximum bandwidth of memory subsystem for GPU, by special memory access pattern called Coalesced Memory Access.","title":"Overview"},{"location":"arrow_fdw/#what-is-apache-arrow","text":"Apache Arrow is a data format of structured data to save in columnar-form and to exchange other applications. Some applications for big-data processing support the format, and it is easy for self-developed applications to use Apache Arrow format since they provides libraries for major programming languages like C,C++ or Python. Apache Arrow format file internally contains Schema portion to define data structure, and one or more RecordBatch to save columnar-data based on the schema definition. For data types, it supports integers, strint (variable-length), date/time types and so on. Indivisual columnar data has its internal representation according to the data types. Data representation in Apache Arrow is not identical with the representation in PostgreSQL. For example, epoch of timestamp in Arrow is 1970-01-01 and it supports multiple precision. In contrast, epoch of timestamp in PostgreSQL is 2001-01-01 and it has microseconds accuracy. Arrow_Fdw allows to read Apache Arrow files on PostgreSQL using foreign table mechanism. If an Arrow file contains 8 of record batches that has million items for each column data, for example, we can access 8 million rows on the Arrow files through the foreign table.","title":"What is Apache Arrow?"},{"location":"arrow_fdw/#operations","text":"","title":"Operations"},{"location":"arrow_fdw/#creation-of-foreign-tables","text":"Usually it takes the 3 steps below to create a foreign table. Define a foreign-data-wrapper using CREATE FOREIGN DATA WRAPPER command Define a foreign server using CREATE SERVER command Define a foreign table using CREATE FOREIGN TABLE command The first 2 steps above are included in the CREATE EXTENSION pg_strom command. All you need to run individually is CREATE FOREIGN TABLE command last. CREATE FOREIGN TABLE flogdata ( ts timestamp, sensor_id int, signal1 smallint, signal2 smallint, signal3 smallint, signal4 smallint, ) SERVER arrow_fdw OPTIONS (file '/path/to/logdata.arrow'); Data type of columns specified by the CREATE FOREIGN TABLE command must be matched to schema definition of the Arrow files to be mapped. Arrow_Fdw also supports a useful manner using IMPORT FOREIGN SCHEMA statement. It automatically generates a foreign table definition using schema definition of the Arrow files. It specifies the foreign table name, schema name to import, and path name of the Arrow files using OPTION-clause. Schema definition of Arrow files contains data types and optional column name for each column. It declares a new foreign table using these information. IMPORT FOREIGN SCHEMA flogdata FROM SERVER arrow_fdw INTO public OPTIONS (file '/path/to/logdata.arrow');","title":"Creation of foreign tables"},{"location":"arrow_fdw/#foreign-table-options","text":"Arrow_Fdw supports the options below. Right now, all the options are for foreign tables. file=PATHNAME It maps an Arrow file specified on the foreign table. files=PATHNAME1[,PATHNAME2...] It maps multiple Arrow files specified by comma (,) separated files list on the foreign table. dir=DIRNAME It maps all the Arrow files in the directory specified on the foreign table. suffix=SUFFIX When dir option is given, it maps only files with the specified suffix, like .arrow` for example. parallel_workers=N_WORKERS It tells the number of workers that should be used to assist a parallel scan of this foreign table; equivalent to parallel_workers storage parameter at normal tables. writable=(true|false) It allows execution of INSERT command on the foreign table. See the section of \"Writable Arrow_Fdw\"","title":"Foreign table options"},{"location":"arrow_fdw/#data-type-mapping","text":"Arrow data types are mapped on PostgreSQL data types as follows. Int mapped to either of int1 , int2 , int4 or int8 according to the bitWidth attribute. is_signed attribute shall be ignored. int1 is an enhanced data type by PG-Strom. FloatingPoint mapped to either of float2 , float4 or float8 according to the precision attribute. float2 is an enhanced data type by PG-Strom. Binary mapped to bytea data type Decimal mapped to numeric data type Date mapped to date data type; to be adjusted as if it has unit=Day precision. Time mapped to time data type; to be adjusted as if it has unit=MicroSecond precision. Timestamp mapped to timestamp data type; to be adjusted as if it has unit=MicroSecond precision. Interval mapped to interval data type. List mapped to 1-dimensional array of the element data type. Struct mapped to compatible composite data type; that shall be defined preliminary. FixedSizeBinary mapped to char(n) data type according to the byteWidth attribute. If pg_type=TYPENAME is configured, PG-Strom may assign the configured data type. Right now, inet and macaddr are supported. Union , Map , Duration , LargeBinary , LargeUtf8 , LargeList Right now, PG-Strom cannot map these Arrow data types onto any of PostgreSQL data types.","title":"Data type mapping"},{"location":"arrow_fdw/#how-to-read-explain","text":"EXPLAIN command show us information about Arrow files reading. The example below is an output of query execution plan that includes f_lineorder foreign table that mapps an Arrow file of 503GB. =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) -> Custom Scan (GpuPreAgg) on f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..78.95 rows=365 width=4) Filter: (d_year = 1993) (12 rows) According to the EXPLAIN output, we can see Custom Scan (GpuPreAgg) scans f_lineorder foreign table. file0 item shows the filename ( /opt/nvme/lineorder_s999.arrow ) on behalf of the foreign table and its size. If multiple files are mapped, any files are individually shown, like file1 , file2 , ... The referenced item shows the list of referenced columns. We can see this query touches lo_orderdate , lo_quantity , lo_extendedprice and lo_discount columns. In addition, GPU-Direct SQL: enabled (GPU-0) shows us the scan on f_lineorder uses GPU-Direct SQL mechanism. VERBOSE option outputs more detailed information. =# EXPLAIN VERBOSE SELECT sum(lo_extendedprice*lo_discount) as revenue FROM f_lineorder,date1 WHERE lo_orderdate = d_datekey AND d_year = 1993 AND lo_discount between 1 and 3 AND lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=14535261.08..14535261.09 rows=1 width=8) Output: pgstrom.sum_int((pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint))) -> Custom Scan (GpuPreAgg) on public.f_lineorder (cost=14535261.06..14535261.07 rows=1 width=32) Output: (pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint)) GPU Projection: pgstrom.psum(((f_lineorder.lo_extendedprice * f_lineorder.lo_discount))::bigint) GPU Scan Quals: ((f_lineorder.lo_discount >= 1) AND (f_lineorder.lo_discount <= 3) AND (f_lineorder.lo_quantity < 25)) [rows: 5999990000 -> 9999983] GPU Join Quals [1]: (f_lineorder.lo_orderdate = date1.d_datekey) ... [nrows: 9999983 -> 1428010] GPU Outer Hash [1]: f_lineorder.lo_orderdate GPU Inner Hash [1]: date1.d_datekey referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount file0: /opt/nvme/f_lineorder_s999.arrow (read: 89.41GB, size: 502.92GB) lo_orderdate: 22.35GB lo_quantity: 22.35GB lo_extendedprice: 22.35GB lo_discount: 22.35GB GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , , , KVecs-Buffer: nbytes: 51200, ndims: 3, items=[kvec0=<0x0000-27ff, type='int4', expr='lo_discount'>, kvec1=<0x2800-4fff, type='int4', expr='lo_quantity'>, kvec2=<0x5000-77ff, type='int4', expr='lo_extendedprice'>, kvec3=<0x7800-9fff, type='int4', expr='lo_orderdate'>, kvec4=<0xa000-c7ff, type='int4', expr='d_datekey'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, , , ]}, items[1]={LoadVars(depth=1): kvars=[]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, , ]}}, items[1]={MoveVars(depth=1): items=[, ]}}} Scan Quals OpCode: {Bool::AND args=[{Func(bool)::int4ge args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='1'}]}, {Func(bool)::int4le args=[{Var(int4): slot=0, expr='lo_discount'}, {Const(int4): value='3'}]}, {Func(bool)::int4lt args=[{Var(int4): slot=1, expr='lo_quantity'}, {Const(int4): value='25'}]}]} Join Quals OpCode: {Packed items[1]={JoinQuals: {Func(bool)::int4eq args=[{Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}, {Var(int4): slot=5, expr='d_datekey'}]}}} Join HashValue OpCode: {Packed items[1]={HashValue arg={Var(int4): kvec=0x7800-a000, expr='lo_orderdate'}}} Partial Aggregation OpCode: {AggFuncs arg={SaveExpr: arg={Func(int8)::int8 arg={Func(int4)::int4mul args=[{Var(int4): kvec=0x5000-7800, expr='lo_extendedprice'}, {Var(int4): kvec=0x0000-2800, expr='lo_discount'}]}}}} Partial Function BufSz: 16 -> Seq Scan on public.date1 (cost=0.00..78.95 rows=365 width=4) Output: date1.d_datekey Filter: (date1.d_year = 1993) (28 rows) The verbose output additionally displays amount of column-data to be loaded on reference of columns. The load of lo_orderdate , lo_quantity , lo_extendedprice and lo_discount columns needs to read 89.41GB in total. It is 17.8% towards the filesize (502.93GB).","title":"How to read EXPLAIN"},{"location":"arrow_fdw/#how-to-make-arrow-files","text":"This section introduces the way to transform dataset already stored in PostgreSQL database system into Apache Arrow file.","title":"How to make Arrow files"},{"location":"arrow_fdw/#using-pyarrowpandas","text":"A pair of PyArrow module, developed by Arrow developers community, and Pandas data frame can dump PostgreSQL database into an Arrow file. The example below reads all the data in table t0 , then write out them into /tmp/t0.arrow . import pyarrow as pa import pandas as pd X = pd.read_sql(sql=\"SELECT * FROM t0\", con=\"postgresql://localhost/postgres\") Y = pa.Table.from_pandas(X) f = pa.RecordBatchFileWriter('/tmp/t0.arrow', Y.schema) f.write_table(Y,1000000) # RecordBatch for each million rows f.close() Please note that the above operation once keeps query result of the SQL on memory, so should pay attention on memory consumption if you want to transfer massive rows at once.","title":"Using PyArrow+Pandas"},{"location":"arrow_fdw/#using-pg2arrow","text":"On the other hand, pg2arrow command, developed by PG-Strom Development Team, enables us to write out query result into Arrow file. This tool is designed to write out massive amount of data into storage device like NVME-SSD. It fetch query results from PostgreSQL database system, and write out Record Batches of Arrow format for each data size specified by the -s|--segment-size option. Thus, its memory consumption is relatively reasonable. pg2arrow command is distributed with PG-Strom. It shall be installed on the bin directory of PostgreSQL related utilities. $ pg2arrow --help Usage: pg2arrow [OPTION] [database] [username] General options: -d, --dbname=DBNAME Database name to connect to -c, --command=COMMAND SQL command to run -t, --table=TABLENAME Equivalent to '-c SELECT * FROM TABLENAME' (-c and -t are exclusive, either of them must be given) --inner-join=SUB_COMMAND --outer-join=SUB_COMMAND -o, --output=FILENAME result file in Apache Arrow format --append=FILENAME result Apache Arrow file to be appended (--output and --append are exclusive. If neither of them are given, it creates a temporary file.) -S, --stat[=COLUMNS] embeds min/max statistics for each record batch COLUMNS is a comma-separated list of the target columns if partially enabled. Arrow format options: -s, --segment-size=SIZE size of record batch for each Connection options: -h, --host=HOSTNAME database server host -p, --port=PORT database server port -u, --user=USERNAME database user name -w, --no-password never prompt for password -W, --password force password prompt Other options: --dump=FILENAME dump information of arrow file --progress shows progress of the job --set=NAME:VALUE config option to set before SQL execution --help shows this message Report bugs to . The -h or -U option specifies the connection parameters of PostgreSQL, like psql or pg_dump . The simplest usage of this command is running a SQL command specified by -c|--command option on PostgreSQL server, then write out results into the file specified by -o|--output option in Arrow format. --append option is available, instead of -o|--output option. It means appending data to existing Apache Arrow file. In this case, the target Apache Arrow file must have fully identical schema definition towards the specified SQL command. The example below reads all the data in table t0 , then write out them into the file /tmp/t0.arrow . $ pg2arrow -U kaigai -d postgres -c \"SELECT * FROM t0\" -o /tmp/t0.arrow Although it is an option for developers, --dump prints schema definition and record-batch location and size of Arrow file in human readable form. --progress option enables to show progress of the task. It is useful when a huge table is transformed to Apache Arrow format.","title":"Using Pg2Arrow"},{"location":"arrow_fdw/#advanced-usage","text":"","title":"Advanced Usage"},{"location":"arrow_fdw/#ssdtogpu-direct-sql","text":"In case when all the Arrow files mapped on the Arrow_Fdw foreign table satisfies the terms below, PG-Strom enables SSD-to-GPU Direct SQL to load columnar data. Arrow files are on NVME-SSD volume. NVME-SSD volume is managed by Ext4 filesystem. Total size of Arrow files exceeds the pg_strom.nvme_strom_threshold configuration.","title":"SSDtoGPU Direct SQL"},{"location":"arrow_fdw/#partition-configuration","text":"Arrow_Fdw foreign tables can be used as a part of partition leafs. Usual PostgreSQL tables can be mixtured with Arrow_Fdw foreign tables. So, pay attention Arrow_Fdw foreign table does not support any writer operations. And, make boundary condition of the partition consistent to the contents of the mapped Arrow file. It is a responsibility of the database administrators. A typical usage scenario is processing of long-standing accumulated log-data. Unlike transactional data, log-data is mostly write-once and will never be updated / deleted. Thus, by migration of the log-data after a lapse of certain period into Arrow_Fdw foreign table that is read-only but rapid processing, we can accelerate summarizing and analytics workloads. In addition, log-data likely have timestamp, so it is quite easy design to add partition leafs periodically, like monthly, weekly or others. The example below defines a partitioned table that mixes a normal PostgreSQL table and Arrow_Fdw foreign tables. The normal PostgreSQL table, is read-writable, is specified as default partition, so DBA can migrate only past log-data into Arrow_Fdw foreign table under the database system operations. CREATE TABLE lineorder ( lo_orderkey numeric, lo_linenumber integer, lo_custkey numeric, lo_partkey integer, lo_suppkey numeric, lo_orderdate integer, lo_orderpriority character(15), lo_shippriority character(1), lo_quantity numeric, lo_extendedprice numeric, lo_ordertotalprice numeric, lo_discount numeric, lo_revenue numeric, lo_supplycost numeric, lo_tax numeric, lo_commit_date character(8), lo_shipmode character(10) ) PARTITION BY RANGE (lo_orderdate); CREATE TABLE lineorder__now PARTITION OF lineorder default; CREATE FOREIGN TABLE lineorder__1993 PARTITION OF lineorder FOR VALUES FROM (19930101) TO (19940101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1993.arrow'); CREATE FOREIGN TABLE lineorder__1994 PARTITION OF lineorder FOR VALUES FROM (19940101) TO (19950101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1994.arrow'); CREATE FOREIGN TABLE lineorder__1995 PARTITION OF lineorder FOR VALUES FROM (19950101) TO (19960101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1995.arrow'); CREATE FOREIGN TABLE lineorder__1996 PARTITION OF lineorder FOR VALUES FROM (19960101) TO (19970101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1996.arrow'); Below is the query execution plan towards the table. By the query condition lo_orderdate between 19950701 and 19960630 that touches boundary condition of the partition, the partition leaf lineorder__1993 and lineorder__1994 are pruned, so it makes a query execution plan to read other (foreign) tables only. =# EXPLAIN SELECT sum(lo_extendedprice*lo_discount) as revenue FROM lineorder,date1 WHERE lo_orderdate = d_datekey AND lo_orderdate between 19950701 and 19960630 AND lo_discount between 1 and 3 ABD lo_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------- Aggregate (cost=172088.90..172088.91 rows=1 width=32) -> Hash Join (cost=10548.86..172088.51 rows=77 width=64) Hash Cond: (lineorder__1995.lo_orderdate = date1.d_datekey) -> Append (cost=10444.35..171983.80 rows=77 width=67) -> Custom Scan (GpuScan) on lineorder__1995 (cost=10444.35..33671.87 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1995.arrow (size: 892.57MB) -> Custom Scan (GpuScan) on lineorder__1996 (cost=10444.62..33849.21 rows=38 width=68) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) referenced: lo_orderdate, lo_quantity, lo_extendedprice, lo_discount files0: /opt/tmp/lineorder_1996.arrow (size: 897.87MB) -> Custom Scan (GpuScan) on lineorder__now (cost=11561.33..104462.33 rows=1 width=18) GPU Filter: ((lo_orderdate >= 19950701) AND (lo_orderdate <= 19960630) AND (lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash (cost=72.56..72.56 rows=2556 width=4) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=4) (16 rows) The operation below extracts the data in 1997 from lineorder__now table, then move to a new Arrow_Fdw foreign table. $ pg2arrow -d sample -o /opt/tmp/lineorder_1997.arrow \\ -c \"SELECT * FROM lineorder WHERE lo_orderdate between 19970101 and 19971231\" pg2arrow command extracts the data in 1997 from the lineorder table into a new Arrow file. BEGIN; -- -- remove rows in 1997 from the read-writable table -- DELETE FROM lineorder WHERE lo_orderdate BETWEEN 19970101 AND 19971231; -- -- define a new partition leaf which maps log-data in 1997 -- CREATE FOREIGN TABLE lineorder__1997 PARTITION OF lineorder FOR VALUES FROM (19970101) TO (19980101) SERVER arrow_fdw OPTIONS (file '/opt/tmp/lineorder_1997.arrow'); COMMIT; A series of operations above delete the data in 1997 from lineorder__new that is a PostgreSQL table, then maps an Arrow file ( /opt/tmp/lineorder_1997.arrow ) which contains an identical contents as a foreign table lineorder__1997 . For correctness, block size is configurable on build from 4KB to 32KB. \u21a9","title":"Partition configuration"},{"location":"brin/","text":"Index Support Overview PostgreSQL supports several index strategies. The default is B-tree that can rapidly fetch records with a particular value. Elsewhere, it also supports Hash, BRIN, GiST, GIN and others that have own characteristics for each. PG-Strom supports only BRIN-index right now. BRIN-index works efficiently on the dataset we can expect physically neighbor records have similar key values, like timestamp values of time-series data. It allows to skip blocks-range if any records in the range obviously don't match to the scan qualifiers, then, also enables to reduce the amount of I/O due to full table scan. PG-Strom also utilizes the feature of BRIN-index, to skip obviously unnecessary blocks from the ones to be loaded to GPU. Configuration No special configurations are needed to use BRIN-index. PG-Strom automatically applies BRIN-index based scan if BRIN-index is configured on the referenced columns and scan qualifiers are suitable to the index. Also see the PostgreSQL Documentation for the BRIN-index feature. By the GUC parameters below, PG-Strom enables/disables usage of BRIN-index. It usually don't need to change from the default configuration, except for debugging or trouble shooting. Parameter Type Default Description pg_strom.enable_brin bool on enables/disables usage of BRIN-index Operations By EXPLAIN , we can check whether BRIN-index is in use. postgres=# EXPLAIN ANALYZE SELECT * FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' AND cat LIKE '%aaa%'; QUERY PLAN -------------------------------------------------------------------------------- Custom Scan (GpuScan) on dt (cost=94810.93..176275.00 rows=169992 width=44) (actual time=1777.819..1901.537 rows=175277 loops=1) GPU Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date) AND (cat ~~ '%aaa%'::text)) Rows Removed by GPU Filter: 4385491 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 0.529 ms Execution time: 2323.063 ms (7 rows) In the example above, BRIN-index is configured on the ymd column. BRIN cond shows the qualifier of BRIN-index for concentration. BRIN skipped shows the number of skipped blocks actually. In this case, 424704 blocks are skipped, then, it filters out 4385491 rows in the loaded blocks by the scan qualifiers. GpuJoin and GpuPreAgg often pulls up its underlying table scan and runs the scan by itself, to reduce inefficient data transfer. In this case, it also uses the BRIN-index to concentrate the scan. The example below shows a usage of BRIN-index in a query which includes GROUP BY. postgres=# EXPLAIN ANALYZE SELECT cat,count(*) FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=6149.78..6151.86 rows=26 width=12) (actual time=427.482..427.499 rows=26 loops=1) Group Key: cat -> Sort (cost=6149.78..6150.24 rows=182 width=12) (actual time=427.465..427.467 rows=26 loops=1) Sort Key: cat Sort Method: quicksort Memory: 26kB -> Custom Scan (GpuPreAgg) on dt (cost=6140.68..6142.95 rows=182 width=12) (actual time=427.331..427.339 rows=26 loops=1) Reduction: Local Outer Scan: dt (cost=4000.00..4011.99 rows=4541187 width=4) (actual time=78.573..415.961 rows=4560768 loops=1) Outer Scan Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) Rows Removed by Outer Scan Filter: 15564 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 30.992 ms Execution time: 818.994 ms (14 rows)","title":"BRIN Index"},{"location":"brin/#index-support","text":"","title":"Index Support"},{"location":"brin/#overview","text":"PostgreSQL supports several index strategies. The default is B-tree that can rapidly fetch records with a particular value. Elsewhere, it also supports Hash, BRIN, GiST, GIN and others that have own characteristics for each. PG-Strom supports only BRIN-index right now. BRIN-index works efficiently on the dataset we can expect physically neighbor records have similar key values, like timestamp values of time-series data. It allows to skip blocks-range if any records in the range obviously don't match to the scan qualifiers, then, also enables to reduce the amount of I/O due to full table scan. PG-Strom also utilizes the feature of BRIN-index, to skip obviously unnecessary blocks from the ones to be loaded to GPU.","title":"Overview"},{"location":"brin/#configuration","text":"No special configurations are needed to use BRIN-index. PG-Strom automatically applies BRIN-index based scan if BRIN-index is configured on the referenced columns and scan qualifiers are suitable to the index. Also see the PostgreSQL Documentation for the BRIN-index feature. By the GUC parameters below, PG-Strom enables/disables usage of BRIN-index. It usually don't need to change from the default configuration, except for debugging or trouble shooting. Parameter Type Default Description pg_strom.enable_brin bool on enables/disables usage of BRIN-index","title":"Configuration"},{"location":"brin/#operations","text":"By EXPLAIN , we can check whether BRIN-index is in use. postgres=# EXPLAIN ANALYZE SELECT * FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' AND cat LIKE '%aaa%'; QUERY PLAN -------------------------------------------------------------------------------- Custom Scan (GpuScan) on dt (cost=94810.93..176275.00 rows=169992 width=44) (actual time=1777.819..1901.537 rows=175277 loops=1) GPU Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date) AND (cat ~~ '%aaa%'::text)) Rows Removed by GPU Filter: 4385491 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 0.529 ms Execution time: 2323.063 ms (7 rows) In the example above, BRIN-index is configured on the ymd column. BRIN cond shows the qualifier of BRIN-index for concentration. BRIN skipped shows the number of skipped blocks actually. In this case, 424704 blocks are skipped, then, it filters out 4385491 rows in the loaded blocks by the scan qualifiers. GpuJoin and GpuPreAgg often pulls up its underlying table scan and runs the scan by itself, to reduce inefficient data transfer. In this case, it also uses the BRIN-index to concentrate the scan. The example below shows a usage of BRIN-index in a query which includes GROUP BY. postgres=# EXPLAIN ANALYZE SELECT cat,count(*) FROM dt WHERE ymd BETWEEN '2018-01-01' AND '2018-12-31' GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=6149.78..6151.86 rows=26 width=12) (actual time=427.482..427.499 rows=26 loops=1) Group Key: cat -> Sort (cost=6149.78..6150.24 rows=182 width=12) (actual time=427.465..427.467 rows=26 loops=1) Sort Key: cat Sort Method: quicksort Memory: 26kB -> Custom Scan (GpuPreAgg) on dt (cost=6140.68..6142.95 rows=182 width=12) (actual time=427.331..427.339 rows=26 loops=1) Reduction: Local Outer Scan: dt (cost=4000.00..4011.99 rows=4541187 width=4) (actual time=78.573..415.961 rows=4560768 loops=1) Outer Scan Filter: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) Rows Removed by Outer Scan Filter: 15564 BRIN cond: ((ymd >= '2018-01-01'::date) AND (ymd <= '2018-12-31'::date)) BRIN skipped: 424704 Planning time: 30.992 ms Execution time: 818.994 ms (14 rows)","title":"Operations"},{"location":"fluentd/","text":"connect with Fluentd This chapter introduces the cooperation with Fluentd via Apache Arrow data format for the efficient importing of IoT/M2M log data. Overview In the technological domain known as IoT/M2M, various software has been developed to store and analyze the large amount of log data generated by devices such as cell phones, automobiles, and various sensors, as well as PCs and servers. This is because the data generated by a large number of devices from time-by-time tend to grow up huge, and special architecture/technology is required to process it in a practical amount of time. PG-Strom's features are designed and implemented for high-speed processing of log data of such a scale. On the other hand, it tends to be a time-consuming job to transfer and import these data into a database in order to make it searchable/summarizable on such a scale. Therefore, PG-Strom includes a fluent-plugin-arrow-file module for Fluentd that outputs the data in Apache Arrow format, and tries to deal with the problem. Fluentd is a log collection tool developed by Sadayuki Furuhashi. It is the de facto standard for collecting and storing a wide variety of log data, ranging from server logs like Syslog to device logs of IoT/M2M devices. Fluentd allows customization of the input/output and processing of log data by adding plugins written in Ruby. As of 2022, more than 800 plugins have been introduced on the official website. PG-Strom can handle two types of data formats: PostgreSQL Heap format (transactional row data) and Apache Arrow format (structured column data). The Apache Arrow format is suitable for workloads like those in the IoT/M2M, where huge amounts of data are generated time-by-time. arrow-file plugin This chapter describes the approach to write out the log data collected by Fluentd in Apache Arrow format, and to refere it with PG-Strom. We assume td-agent here, that is a stable version of Fluentd provided by Treasure Data. PG-Strom includes the fluent-plugin-arrow-file module. This allows Fluentd to write out the log data it collects as an Apache Arrow format file with a specified schema structure. Using PG-Strom's Arrow_Fdw, this Apache Arrow format file can be accessed as an foreign table. In addition, GPU-Direct SQL allows to load these files extremely fast, if the storage system is appropriately configured. This has the following advantages: There is no need to import data into the DB because PG-Strom directly accesses the files output by Fluentd. The data readout (I/O load) for the searching and summarizing process can be kept to a minimum because of the columnar data format. You can archive outdated log data only by moving files on the OS. On the other hand, in cases that it takes a long time to store a certain size of log (for example, log generation is rare), another method such as outputting to a PostgreSQL table is suitable for more real-time log analysis. This is because the size of the Record Batch needs to be reasonably large to acquire the performance benefits of the Apache Arrow format. Internals There are several types of plugins for Fluentd: Input plugins to receive logs from outside, Parser plugins to shape the logs, Buffer plugins to temporarily store the received logs, and Output plugins to output the logs. The arrow-file plugin is categorized as Output plugin. It writes out a \"chunk\" of log data passed from the Buffer plugin in Apache Arrow format with the schema structure specified in the configuration. The Input/Parser plugin is responsible for converting the received logs into a common format so that the Buffer and Output plugins can handle the input data without being aware of its format. The common format is a pair of tag , an identifier that can be used to sort the logs, a log timestamp time , and record , an associative array formed from the raw logs. The arrow-file plugin writes to an Apache Arrow format file with the tag and time fields and each element of the record associative array as a column (some may be omitted). Therefore, the output destination file name and schema definition information (mapping of associative array elements to columns/types) are mandatory configuration parameters. Installation Install the td-agent package for Linux distribution you are using. The rake-compiler module is required to install the arrow-file plugin, so please install it before. $ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent4.sh | sh $ sudo /opt/td-agent/bin/fluent-gem install rake-compiler Next, download the source code for PG-Strom and build arrow-file plugin in the fluentd directory. $ git clone https://github.com/heterodb/pg-strom.git $ cd pg-strom/fluentd $ make TD_AGENT=1 gem $ sudo make TD_AGENT=1 install To confirm that the Fluentd plugin is installed, run the following command. $ /opt/td-agent/bin/fluent-gem list | grep arrow fluent-plugin-arrow-file (0.2) Configuration As mentioned above, the arrow-file plugin requires the output path of the file and the schema definition at least. In addition to this, in order to acquire the best performance for searching and aggregation processing, the single chunk of data inside the Apache Arrow file, called the Record Batch, needs to be reasonably large in size. The arrow-file plugin creates a Record Batch for each chunk passed from the Buffer plugin. Therefore, the buffer size of the Buffer plugin should be set with the size of the Record Batch in mind. By the default, the Buffer plugin is set to take a buffer size of 256MB. The configuration parameters for the arrow-file plugin are as follows: path [type: String ] (Required) Specify the file path of the destination. This is a required parameter, and you can use placeholders shown below. Placeholders Description %Y The current year expressed as a four-digit number. %y The current year expressed as a number in the last two digits of the year. %m A two-digit number representing the current month, 01-12. %d A two-digit number representing the current day from 01 to 31. %H A two-digit number representing the hour of the current time 00-23. %M A two-digit number representing the minute of the current time, 00-59. %S A two-digit number representing the second of the current time, 00-59. %p The PID of the current Fluentd process. The placeholder is replaced when the chunk is written out. If an Apache Arrow format file of the same name exists, the Record Batch will be appended to it. If it does not exist, a new Apache Arrow format file is created and the first Record Batch is written out. However, if the size of the existing Apache Arrow file exceeds the filesize_threshold setting described below, rename the existing file and then create a new one. (Example) path /tmp/arrow_logs/my_logs_%y%m%d.%p.log The output Apache Arrow file updates the footer area to point to all Record Batches each time a chunk is written out. Therefore, the generated Apache Arrow file can be read immediately. However, to avoid access conflicts, exclusive handling is required using lockf(3) . schema_defs [type: String ] (Required) Specify the schema definition of the Apache Arrow format file output by fluent-plugin-arrow-file . This is a required parameter, and define the schema structure using strings in the following format. schema_defs := column_def1[,column_def2 ...] column_def := =[;] is the name of the column, which must match the key value of the associative array passed from Fluentd to arrow-file plugin. is the data type of the column. See the following table. is an additional attribute for columns. At this time, only the following attributes are supported. stat_enabled ... The statistics for the configured columns will be collected and the maximum/minimum values for each Record Batch will be set as custom metadata in the form of max_values=... and min_values=... . (Example) schema_defs \"ts=Timestamp;stat_enabled,dev_id=Uint32,temperature=Float32,humidity=Float32\" Data types supported by the arrow-file plugin Data types Description Int8 Int16 Int32 Int64 Signed integer with the specified bit width. Uint8 Uint16 Uint32 Uint64 Unsigned integer with the specified bit width Float16 Float32 Float64 Floating point number with half-precision(16bit), single-precision(32bit) and double-precision(64bit). Decimal Decimal128 128-bit fixed decimal; 256-bit fixed decimal is currently not supported. Timestamp Timestamp[sec] Timestamp[ms] Timestamp[us] Timestamp[ns] Timestamp type with the specified precision. If the precision is omitted, it is treated the same as [us] . Time Time[sec] Time[ms] Time[us] Time[ns] Time type with the specified precision. If the precision is omitted, it is treated the same as [sec] . Date Date[Day] Date[ms] Date type with the specified precision. If the precision is omitted, it is treated the same as [day] . Utf8 String type. Ipaddr4 IP address(IPv4) type. This is represented as a FixedSizeBinary type with byteWidth=4 and custom metadata pg_type=pg_catalog.inet . Ipaddr6 IP address(IPv6) type. This is represented as a FixedSizeBinary type with byteWidth=16 and custom metadata pg_type=pg_catalog.inet . ts_column [type: String / default: unspecified] Specify a column name to set the timestamp value of the log passed from Fluentd (not from record ). This parameter is usually a date-time type such as Timestamp , and the stat_enabled attribute should also be specified to achieve fast search. tag_column [type: String / default: unspecified] Specify a column name to set the tag value of the log passed from Fluentd (not from record ). This parameter is usually a string type such as utf8 . filesize_threshold [type: Integer / default: 10000] Specify the threshold for switching the output destination file in MB. By default, the output destination is switched when the file size exceeds about 10GB. Example As a simple example, this chapter shows a configuration for monitoring the log of a local Apache Httpd server, parsing it field by field, and writing it to an Apache Arrow format file. By setting , /var/log/httpd/access_log will be the data source. Then, the apache2 Parse plugin will cut out the fields: host, user, time, method, path, code, size, referer, agent. The fields are then passed to the arrow-file plugin as an associative array. In schema_defs in , the column definitions of the Apache Arrow file corresponding to the fields are set. For simplicity of explanation, the chunk size is set to a maximum of 4MB / 200 lines in the tag, and it is set to pass to the Output plugin in 10 seconds at most. Example configuration of /etc/td-agent/td-agent.conf @type tail path /var/log/httpd/access_log pos_file /var/log/td-agent/httpd_access.pos tag httpd format apache2 @type apache2 expression /^(?[^ ]*) [^ ]* (?[^ ]*) \\[(? @type arrow_file path /tmp/mytest%Y%m%d.%p.arrow schema_defs \"ts=Timestamp[sec],host=Utf8,method=Utf8,path=Utf8,code=Int32,size=Int32,referer=Utf8,agent=Utf8\" ts_column \"ts\" flush_interval 10s chunk_limit_size 4MB chunk_limit_records 200 Start the td-agent service. $ sudo systemctl start td-agent See the following output. The placeholder for /tmp/mytest%Y%m%d.%p.arrow set in path is replaced and the Apache Httpd log is written to /tmp/mytest20220124.3206341.arrow . $ arrow2csv /tmp/mytest20220124.3206341.arrow --head --offset 300 --limit 10 \"ts\",\"host\",\"method\",\"path\",\"code\",\"size\",\"referer\",\"agent\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme_extra.js\",200,195,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme.js\",200,4401,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/fluentd_overview.png\",200,121459,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/main.js\",200,3027,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-regular.woff2\",200,182708,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/fontawesome-webfont.woff2?v=4.7.0\",200,77160,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/RobotoSlab/roboto-slab-v7-bold.woff2\",200,67312,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-bold.woff2\",200,184912,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/worker.js\",200,3724,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/favicon.ico\",200,1150,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" Let's map the output file to PostgreSQL using PG-Strom's Arrow_Fdw. postgres=# IMPORT FOREIGN SCHEMA mytest FROM SERVER arrow_fdw INTO public OPTIONS (file '/tmp/mytest20220124.3206341.arrow'); IMPORT FOREIGN SCHEMA postgres=# SELECT ts, host, path FROM mytest WHERE code = 404; ts | host | path ---------------------+---------------+---------------------- 2022-01-24 12:02:06 | 192.168.77.73 | /~kaigai/ja/fluentd/ (1 row) postgres=# EXPLAIN SELECT ts, host, path FROM mytest WHERE code = 404; QUERY PLAN ------------------------------------------------------------------------------ Custom Scan (GpuScan) on mytest (cost=4026.12..4026.12 rows=3 width=72) GPU Filter: (code = 404) referenced: ts, host, path, code files0: /tmp/mytest20220124.3206341.arrow (read: 128.00KB, size: 133.94KB) (4 rows) The example above shows how the generated Apache Arrow file can be mapped as an external table and accessed with SQL. Search conditions can be given to search each field of the log formed on the Fluentd side. In the example above, the log with HTTP status code 404 is searched and one record is found.","title":"connect with Fluentd"},{"location":"fluentd/#connect-with-fluentd","text":"This chapter introduces the cooperation with Fluentd via Apache Arrow data format for the efficient importing of IoT/M2M log data.","title":"connect with Fluentd"},{"location":"fluentd/#overview","text":"In the technological domain known as IoT/M2M, various software has been developed to store and analyze the large amount of log data generated by devices such as cell phones, automobiles, and various sensors, as well as PCs and servers. This is because the data generated by a large number of devices from time-by-time tend to grow up huge, and special architecture/technology is required to process it in a practical amount of time. PG-Strom's features are designed and implemented for high-speed processing of log data of such a scale. On the other hand, it tends to be a time-consuming job to transfer and import these data into a database in order to make it searchable/summarizable on such a scale. Therefore, PG-Strom includes a fluent-plugin-arrow-file module for Fluentd that outputs the data in Apache Arrow format, and tries to deal with the problem. Fluentd is a log collection tool developed by Sadayuki Furuhashi. It is the de facto standard for collecting and storing a wide variety of log data, ranging from server logs like Syslog to device logs of IoT/M2M devices. Fluentd allows customization of the input/output and processing of log data by adding plugins written in Ruby. As of 2022, more than 800 plugins have been introduced on the official website. PG-Strom can handle two types of data formats: PostgreSQL Heap format (transactional row data) and Apache Arrow format (structured column data). The Apache Arrow format is suitable for workloads like those in the IoT/M2M, where huge amounts of data are generated time-by-time.","title":"Overview"},{"location":"fluentd/#arrow-file-plugin","text":"This chapter describes the approach to write out the log data collected by Fluentd in Apache Arrow format, and to refere it with PG-Strom. We assume td-agent here, that is a stable version of Fluentd provided by Treasure Data. PG-Strom includes the fluent-plugin-arrow-file module. This allows Fluentd to write out the log data it collects as an Apache Arrow format file with a specified schema structure. Using PG-Strom's Arrow_Fdw, this Apache Arrow format file can be accessed as an foreign table. In addition, GPU-Direct SQL allows to load these files extremely fast, if the storage system is appropriately configured. This has the following advantages: There is no need to import data into the DB because PG-Strom directly accesses the files output by Fluentd. The data readout (I/O load) for the searching and summarizing process can be kept to a minimum because of the columnar data format. You can archive outdated log data only by moving files on the OS. On the other hand, in cases that it takes a long time to store a certain size of log (for example, log generation is rare), another method such as outputting to a PostgreSQL table is suitable for more real-time log analysis. This is because the size of the Record Batch needs to be reasonably large to acquire the performance benefits of the Apache Arrow format.","title":"arrow-file plugin"},{"location":"fluentd/#internals","text":"There are several types of plugins for Fluentd: Input plugins to receive logs from outside, Parser plugins to shape the logs, Buffer plugins to temporarily store the received logs, and Output plugins to output the logs. The arrow-file plugin is categorized as Output plugin. It writes out a \"chunk\" of log data passed from the Buffer plugin in Apache Arrow format with the schema structure specified in the configuration. The Input/Parser plugin is responsible for converting the received logs into a common format so that the Buffer and Output plugins can handle the input data without being aware of its format. The common format is a pair of tag , an identifier that can be used to sort the logs, a log timestamp time , and record , an associative array formed from the raw logs. The arrow-file plugin writes to an Apache Arrow format file with the tag and time fields and each element of the record associative array as a column (some may be omitted). Therefore, the output destination file name and schema definition information (mapping of associative array elements to columns/types) are mandatory configuration parameters.","title":"Internals"},{"location":"fluentd/#installation","text":"Install the td-agent package for Linux distribution you are using. The rake-compiler module is required to install the arrow-file plugin, so please install it before. $ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent4.sh | sh $ sudo /opt/td-agent/bin/fluent-gem install rake-compiler Next, download the source code for PG-Strom and build arrow-file plugin in the fluentd directory. $ git clone https://github.com/heterodb/pg-strom.git $ cd pg-strom/fluentd $ make TD_AGENT=1 gem $ sudo make TD_AGENT=1 install To confirm that the Fluentd plugin is installed, run the following command. $ /opt/td-agent/bin/fluent-gem list | grep arrow fluent-plugin-arrow-file (0.2)","title":"Installation"},{"location":"fluentd/#configuration","text":"As mentioned above, the arrow-file plugin requires the output path of the file and the schema definition at least. In addition to this, in order to acquire the best performance for searching and aggregation processing, the single chunk of data inside the Apache Arrow file, called the Record Batch, needs to be reasonably large in size. The arrow-file plugin creates a Record Batch for each chunk passed from the Buffer plugin. Therefore, the buffer size of the Buffer plugin should be set with the size of the Record Batch in mind. By the default, the Buffer plugin is set to take a buffer size of 256MB. The configuration parameters for the arrow-file plugin are as follows: path [type: String ] (Required) Specify the file path of the destination. This is a required parameter, and you can use placeholders shown below. Placeholders Description %Y The current year expressed as a four-digit number. %y The current year expressed as a number in the last two digits of the year. %m A two-digit number representing the current month, 01-12. %d A two-digit number representing the current day from 01 to 31. %H A two-digit number representing the hour of the current time 00-23. %M A two-digit number representing the minute of the current time, 00-59. %S A two-digit number representing the second of the current time, 00-59. %p The PID of the current Fluentd process. The placeholder is replaced when the chunk is written out. If an Apache Arrow format file of the same name exists, the Record Batch will be appended to it. If it does not exist, a new Apache Arrow format file is created and the first Record Batch is written out. However, if the size of the existing Apache Arrow file exceeds the filesize_threshold setting described below, rename the existing file and then create a new one. (Example) path /tmp/arrow_logs/my_logs_%y%m%d.%p.log The output Apache Arrow file updates the footer area to point to all Record Batches each time a chunk is written out. Therefore, the generated Apache Arrow file can be read immediately. However, to avoid access conflicts, exclusive handling is required using lockf(3) . schema_defs [type: String ] (Required) Specify the schema definition of the Apache Arrow format file output by fluent-plugin-arrow-file . This is a required parameter, and define the schema structure using strings in the following format. schema_defs := column_def1[,column_def2 ...] column_def := =[;] is the name of the column, which must match the key value of the associative array passed from Fluentd to arrow-file plugin. is the data type of the column. See the following table. is an additional attribute for columns. At this time, only the following attributes are supported. stat_enabled ... The statistics for the configured columns will be collected and the maximum/minimum values for each Record Batch will be set as custom metadata in the form of max_values=... and min_values=... . (Example) schema_defs \"ts=Timestamp;stat_enabled,dev_id=Uint32,temperature=Float32,humidity=Float32\" Data types supported by the arrow-file plugin Data types Description Int8 Int16 Int32 Int64 Signed integer with the specified bit width. Uint8 Uint16 Uint32 Uint64 Unsigned integer with the specified bit width Float16 Float32 Float64 Floating point number with half-precision(16bit), single-precision(32bit) and double-precision(64bit). Decimal Decimal128 128-bit fixed decimal; 256-bit fixed decimal is currently not supported. Timestamp Timestamp[sec] Timestamp[ms] Timestamp[us] Timestamp[ns] Timestamp type with the specified precision. If the precision is omitted, it is treated the same as [us] . Time Time[sec] Time[ms] Time[us] Time[ns] Time type with the specified precision. If the precision is omitted, it is treated the same as [sec] . Date Date[Day] Date[ms] Date type with the specified precision. If the precision is omitted, it is treated the same as [day] . Utf8 String type. Ipaddr4 IP address(IPv4) type. This is represented as a FixedSizeBinary type with byteWidth=4 and custom metadata pg_type=pg_catalog.inet . Ipaddr6 IP address(IPv6) type. This is represented as a FixedSizeBinary type with byteWidth=16 and custom metadata pg_type=pg_catalog.inet . ts_column [type: String / default: unspecified] Specify a column name to set the timestamp value of the log passed from Fluentd (not from record ). This parameter is usually a date-time type such as Timestamp , and the stat_enabled attribute should also be specified to achieve fast search. tag_column [type: String / default: unspecified] Specify a column name to set the tag value of the log passed from Fluentd (not from record ). This parameter is usually a string type such as utf8 . filesize_threshold [type: Integer / default: 10000] Specify the threshold for switching the output destination file in MB. By default, the output destination is switched when the file size exceeds about 10GB.","title":"Configuration"},{"location":"fluentd/#example","text":"As a simple example, this chapter shows a configuration for monitoring the log of a local Apache Httpd server, parsing it field by field, and writing it to an Apache Arrow format file. By setting , /var/log/httpd/access_log will be the data source. Then, the apache2 Parse plugin will cut out the fields: host, user, time, method, path, code, size, referer, agent. The fields are then passed to the arrow-file plugin as an associative array. In schema_defs in , the column definitions of the Apache Arrow file corresponding to the fields are set. For simplicity of explanation, the chunk size is set to a maximum of 4MB / 200 lines in the tag, and it is set to pass to the Output plugin in 10 seconds at most. Example configuration of /etc/td-agent/td-agent.conf @type tail path /var/log/httpd/access_log pos_file /var/log/td-agent/httpd_access.pos tag httpd format apache2 @type apache2 expression /^(?[^ ]*) [^ ]* (?[^ ]*) \\[(? @type arrow_file path /tmp/mytest%Y%m%d.%p.arrow schema_defs \"ts=Timestamp[sec],host=Utf8,method=Utf8,path=Utf8,code=Int32,size=Int32,referer=Utf8,agent=Utf8\" ts_column \"ts\" flush_interval 10s chunk_limit_size 4MB chunk_limit_records 200 Start the td-agent service. $ sudo systemctl start td-agent See the following output. The placeholder for /tmp/mytest%Y%m%d.%p.arrow set in path is replaced and the Apache Httpd log is written to /tmp/mytest20220124.3206341.arrow . $ arrow2csv /tmp/mytest20220124.3206341.arrow --head --offset 300 --limit 10 \"ts\",\"host\",\"method\",\"path\",\"code\",\"size\",\"referer\",\"agent\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme_extra.js\",200,195,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/js/theme.js\",200,4401,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/fluentd_overview.png\",200,121459,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/main.js\",200,3027,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-regular.woff2\",200,182708,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/fontawesome-webfont.woff2?v=4.7.0\",200,77160,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/RobotoSlab/roboto-slab-v7-bold.woff2\",200,67312,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:42\",\"192.168.77.95\",\"GET\",\"/docs/ja/fonts/Lato/lato-bold.woff2\",200,184912,\"http://buri/docs/ja/css/theme.css\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/search/worker.js\",200,3724,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" \"2022-01-24 06:13:43\",\"192.168.77.95\",\"GET\",\"/docs/ja/img/favicon.ico\",200,1150,\"http://buri/docs/ja/fluentd/\",\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\" Let's map the output file to PostgreSQL using PG-Strom's Arrow_Fdw. postgres=# IMPORT FOREIGN SCHEMA mytest FROM SERVER arrow_fdw INTO public OPTIONS (file '/tmp/mytest20220124.3206341.arrow'); IMPORT FOREIGN SCHEMA postgres=# SELECT ts, host, path FROM mytest WHERE code = 404; ts | host | path ---------------------+---------------+---------------------- 2022-01-24 12:02:06 | 192.168.77.73 | /~kaigai/ja/fluentd/ (1 row) postgres=# EXPLAIN SELECT ts, host, path FROM mytest WHERE code = 404; QUERY PLAN ------------------------------------------------------------------------------ Custom Scan (GpuScan) on mytest (cost=4026.12..4026.12 rows=3 width=72) GPU Filter: (code = 404) referenced: ts, host, path, code files0: /tmp/mytest20220124.3206341.arrow (read: 128.00KB, size: 133.94KB) (4 rows) The example above shows how the generated Apache Arrow file can be mapped as an external table and accessed with SQL. Search conditions can be given to search each field of the log formed on the Fluentd side. In the example above, the log with HTTP status code 404 is searched and one record is found.","title":"Example"},{"location":"gpucache/","text":"GPU Cache Overview GPU has a device memory that is independent of the RAM in the host system, and in order to calculate on the GPU, data must be transferred from the host system or storage device to the GPU device memory once through the PCI-E bus. The same is true when PG-Strom processes SQL queries on the GPU. Internally, the records read from the PostgreSQL table are transferred to the GPU, and then various SQL operations are executed on the GPU. However, these processes take time to read the tables and transfer the data. (In many cases, much longer than the processing on the GPU!) GPU Cache is a function that reserves an area on the GPU device memory in advance and keeps a copy of the PostgreSQL table there. This can be used to execute search/analysis SQL in real time for data that is relatively small(~10GB) and is frequently updated. The log-based synchronization mechanism described below allows GPU Cache to be kept up-to-date without interfering with highly parallel and transactional workloads. Nevertheless, you can process search/analytical SQL workloads on data already loaded on GPU Cache without reading the records from the table again or transferring the data over the PCI-E bus. A typical use case of GPU Cache is to join location data, such as the current position of a mobile device like a car or a cell phone, collected in real time with other data using GPU-PostGIS . The workload of updating location information sent out by many devices is extremely heavy. However, it also needs to be applied on the GPU side without delay in order to perform search/analysis queries based on the latest location information. Although the size is limited, GPU Cache is one option to achieve both high frequency updates and high-performance search/analysis query execution. Architecture GPU Caches needs to satisfy two requirements: highly parallel update-based workloads and search/analytical queries on constantly up-to-date data. In many systems, the CPU and GPU are connected via the PCI-E bus, and there is a reasonable delay in their communication. Therefore, synchronizing GPU Cache every time a row is updated in the target table will significantly degrade the transaction performance. Using GPU Cache allocates a \"REDO Log Buffer\" on the shared memory on the host side in addition to the area on the memory of the GPU. When a SQL command (INSERT, UPDATE, DELETE) is executed to update a table, the updated contents are copied to the REDO Log Buffer by the AFTER ROW trigger. Since this process can be completed by CPU and RAM alone without any GPU call, it has little impact on transaction performance. When a certain amount of unapplied REDO Log Entries accumulate in the REDO Log Buffer, or a certain amount of time has passed since the last write, it is loaded by a background worker process (GPU memory keeper) and applied to GPU Cache. At this time, REDO Log Entries are transferred to the GPU in batches and processed in parallel by thousands of processor cores on the GPU, so delays caused by this process are rarely a problem. Search/analysis queries against the target table in GPU Cache do not load the table data, but use the data mapped from GPU Cache pre-allocated on the GPU device memory. If there are any unapplied REDO Logs at the start of the search/analysis query, they will all be applied to GPU Cache. This means that the results of a search/analysis query scanning the target GPU Cache will return the same results as if it were referring to the table directly, and the query will always be consistent. Configuration To enable GPU Cache, configure a trigger that executes pgstrom.gpucache_sync_trigger() function on AFTER INSERT OR UPDATE OR DELETE for each row. If GPU Cache is used on the replication slave, the invocation mode of this trigger must be ALWAYS . Below is an example to configure GPU Cache on the dpoints table. =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; Note Additional configuration at PostgreSQL v12 or prior. In case when GPU Cache is used at PostgreSQL v12 or prior, you need to configure an additional BEFORE TRUNCATE statement trigger that executes pgstrom.gpucache_sync_trigger() function. If you want to use the GPU Cache on the replication slave, If you use GPU Cache at the PostgreSQL v12 or prior, in a similar way, invocation mode of this trigger must have ALWAYS . PostgreSQL v13 enhanced its object-access-hook mechanism, so allows extension modules to capture execution of TRUNCATE without triggers configuration. On the other hand, the prior version still needs the BEFORE TRUNCATE statement trigger to keep consistency of GPU Cache by capture of TRUNCATE. Below is an example to configure GPU Cache on the dpoints table at PostgreSQL v12 or prior. =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# create trigger stmt_sync before truncate on dpoints_even for statement execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; =# alter table dpoints_even enable always trigger stmt_sync; GPU Cache Customize You can customize GPU Cache by specifying an optional string in the form of KEY=VALUE as an argument to GPU Cache line trigger. Please note that where you should specify is not to the syntax trigger. The following SQL statement is an example of creating a GPU Cache whose maximum row count is 2.5 million rows and the size of the REDO Log Buffer is 100MB. =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger('max_num_rows=2500000,redo_buffer_size=100m'); The options that can be given to the argument of the line trigger are shown below. gpu_device_id=GPU_ID (default: 0) Specify the target GPU device ID to allocate GPU Cache. max_num_rows=NROWS (default: 10485760) Specify the number of rows that can be allocated on GPU Cache. Just as with PostgreSQL tables, GPU Cache needs to retain updated rows prior to commit for visibility control, so max_num_rows should be specified with some margin. Note that the old version of the updated/deleted row will be released after the transaction is committed. redo_buffer_size=SIZE (default: 160m) Specify the size of REDO Log Buffer. You can use k, m and g as the unit. gpu_sync_interval=SECONDS (default: 5) If the specified time has passed since the last write to the REDO Log Buffer, REDO Log will be applied to the GPU, regardless of the number of rows updated. gpu_sync_threshold=SIZE (default: 25% of redo_buffer_size ) When the unapplied REDO Log in the REDO Log Buffer reaches SIZE bytes, it is applied to the GPU side. You can use k, m and g as the unit. GPU Cache Options Below are GPU Cache related PostgreSQL configuration parameters. pg_strom.enable_gpucache (default: on) This option controls whether search/analytical queries will use GPU Cache or not. If this value is off, the data will be read from the table each time, ignoring GPU Cache even if it is available. Note that this setting has no effect on REDO Log Buffer appending by triggers. pg_strom.gpucache_auto_preload (default: NULL) When PostgreSQL is started/restarted, GPU Cache for the table specified by this parameter will be built in advance. The value should be in the format: DATABASE_NAME.SCHEMA_NAME.TABLE_NAME . To specify multiple tables, separate them by commas. If GPU Cache is not built, the PostgreSQL backend process that first attempts to access GPU Cache will scan the entire target table and transfer it to the GPU. This process usually takes a considerable amount of time. However, by specifying the tables that should be loaded in this option, you can avoid waiting too long the first time you run a search/analysis query. If this parameter is set to '*', it will attempt to load the contents of all tables with GPU Cache into the GPU in order. At this time, the background worker will access all the databases in order, and will return exit code 1 to prompt the postmaster to restart. The server startup log will show that the \"GPUCache Startup Preloader\" exited with exit code 1 as follows, but this is not abnormal. LOG: database system is ready to accept connections LOG: background worker \"GPUCache Startup Preloader\" (PID 856418) exited with exit code 1 LOG: background worker \"GPUCache Startup Preloader\" (PID 856427) exited with exit code 1 LOG: create GpuCacheSharedState dpoints:164c95f71 LOG: gpucache: AllocMemory dpoints:164c95f71 (main_sz=772505600, extra_sz=0) LOG: gpucache: auto preload 'public.dpoints' (DB: postgres) LOG: create GpuCacheSharedState mytest:1773a589b LOG: gpucache: auto preload 'public.mytest' (DB: postgres) LOG: gpucache: AllocMemory mytest:1773a589b (main_sz=675028992, extra_sz=0) Operations Confirm GPU Cache usage GPU Cache is referred to transparently. The user does not need to be aware of the presence or absence of GPU Cache, and PG-Strom will automatically determine and switch the process. The following is the query plan for a query that refers to the table \"dpoints\" which has GPU Cache set. The 3rd row from the bottom, in the \"GPU Cache\" field, shows the basic information about GPU Cache of this table. We can see that the query is executed with referring to GPU Cache and not the \"dpoints\" table. Note that the meaning of each item is as follows: max_num_rows indicates the maximum number of rows that GPU Cache can hold; main indicates the size of the area in GPU Cache for fixed-length fields; extra indicates the size of the area for variable-length data. =# explain select pref, city, count(*) from giscity g, dpoints d where pref = 'Tokyo' and st_contains(g.geom,st_makepoint(d.x, d.y)) group by pref, city; QUERY PLAN -------------------------------------------------------------------------------------------------------- HashAggregate (cost=5638809.75..5638859.99 rows=5024 width=29) Group Key: g.pref, g.city -> Custom Scan (GpuPreAgg) (cost=5638696.71..5638759.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=631923.57..5606933.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) GPU Cache: NVIDIA Tesla V100-PCIE-16GB [max_num_rows: 12000000, main: 772.51M, extra: 0] -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (16 rows) Check status of GPU Cache Use the pgstrom.gpucache_info view to check the current state of GPU Cache. =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | refcnt | corrupted | gpu_main_sz | gpu_extra_sz | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------+------------+--------+-----------+-------------+--------------+----------------------------+-------------------+----------------+------------------+---------------+---------------+------------------------------------------------------------------------------------------------------------------------ 12728 | postgres | 25244 | mytest | 6295279771 | 3 | f | 675028992 | 0 | 2021-05-14 03:00:18.623503 | 500000 | 36000000 | 500000 | 36000000 | 36000000 | gpu_device_id=0,max_num_rows=10485760,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 12728 | postgres | 25262 | dpoints | 5985886065 | 3 | f | 772505600 | 0 | 2021-05-14 03:00:18.524627 | 8000000 | 576000192 | 8000000 | 576000192 | 576000192 | gpu_device_id=0,max_num_rows=12000000,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 (2 rows) Note that pgstrom.gpucache_info will only show the status of GPU Caches that have been initially loaded and have space allocated on the GPU device memory at that time. In other words, if the trigger function is set but not yet initially loaded (no one has accessed it yet), the potentially allocated GPU Cache will not be shown yet. The meaning of each field is as follows: database_oid The OID of the database to which the table with GPU Cache enabled exists. database_name The name of the database to which the table with GPU Cache enabled exists. table_oid The OID of the table with GPU Cache enabled. Note that the database this table exists in is not necessarily the database you are connected to. table_name The name of the table with GPU Cache enabled. Note that the database this table exists in is not necessarily the database you are connected to. signature A hash value indicating the uniqueness of GPU Cache. This value may change, for example, before and after executing ALTER TABLE . refcnt Reference counter of the GPU Cache. It does not always reflect the latest value. corrupted Shows whether the GPU Cache is corrupted. gpu_main_sz The size of the area reserved in GPU Cache for fixed-length data. gpu_extra_sz The size of the area reserved in GPU Cache for variable-length data. redo_write_ts The time when the REDO Log Buffer was last updated. redo_write_nitems The total number of REDO Logs in the REDO Log Buffer. redo_write_pos The total size (in bytes) of the REDO Logs in the REDO Log Buffer. redo_read_nitems The total number of REDO Logs read from the REDO Log Buffer and applied to the GPU. redo_read_pos The total size (in bytes) of REDO Logs read from the REDO Log Buffer and applied to the GPU. redo_sync_pos The position of the REDO Log which is scheduled to be applied to GPU Cache by the background worker on the REDO Log Buffer. This is used internally to avoid a situation where many sessions generate asynchronous requests at the same time when the remaining REDO Log Buffer is running out. config_options The optional string to customize GPU Cache. GPU Cache corruption and recovery If and when REDO logs could not be applied on the GPU cache by some reasons, like insertion of more rows than the max_num_rows configuration, or too much consumption of variable-length data buffer, GPU cache moves to the \"corrupted\" state. Once GPU cache gets corrupted, search/analysis SQL does not reference the GPU cache, and table updates stops writing REDO log. (If GPU cache gets corrupted after beginning of a search/analysis SQL unfortunately, this query may raise an error.) The pgstrom.gpucache_recovery(regclass) function recovers the GPU cache from the corrupted state. If you run this function after removal of the cause where REDO logs could not be applied, it runs initial-loading of the GPU cache again, then tries to recover the GPU cache. For example, if GPU cache gets corrupted because you tried to insert more rows than the max_num_rows , you reconfigure the trigger with expanded max_num_rows configuration or you delete a part of rows from the table, then runs pgstrom.gpucache_recovery() function.","title":"GPU Cache"},{"location":"gpucache/#gpu-cache","text":"","title":"GPU Cache"},{"location":"gpucache/#overview","text":"GPU has a device memory that is independent of the RAM in the host system, and in order to calculate on the GPU, data must be transferred from the host system or storage device to the GPU device memory once through the PCI-E bus. The same is true when PG-Strom processes SQL queries on the GPU. Internally, the records read from the PostgreSQL table are transferred to the GPU, and then various SQL operations are executed on the GPU. However, these processes take time to read the tables and transfer the data. (In many cases, much longer than the processing on the GPU!) GPU Cache is a function that reserves an area on the GPU device memory in advance and keeps a copy of the PostgreSQL table there. This can be used to execute search/analysis SQL in real time for data that is relatively small(~10GB) and is frequently updated. The log-based synchronization mechanism described below allows GPU Cache to be kept up-to-date without interfering with highly parallel and transactional workloads. Nevertheless, you can process search/analytical SQL workloads on data already loaded on GPU Cache without reading the records from the table again or transferring the data over the PCI-E bus. A typical use case of GPU Cache is to join location data, such as the current position of a mobile device like a car or a cell phone, collected in real time with other data using GPU-PostGIS . The workload of updating location information sent out by many devices is extremely heavy. However, it also needs to be applied on the GPU side without delay in order to perform search/analysis queries based on the latest location information. Although the size is limited, GPU Cache is one option to achieve both high frequency updates and high-performance search/analysis query execution.","title":"Overview"},{"location":"gpucache/#architecture","text":"GPU Caches needs to satisfy two requirements: highly parallel update-based workloads and search/analytical queries on constantly up-to-date data. In many systems, the CPU and GPU are connected via the PCI-E bus, and there is a reasonable delay in their communication. Therefore, synchronizing GPU Cache every time a row is updated in the target table will significantly degrade the transaction performance. Using GPU Cache allocates a \"REDO Log Buffer\" on the shared memory on the host side in addition to the area on the memory of the GPU. When a SQL command (INSERT, UPDATE, DELETE) is executed to update a table, the updated contents are copied to the REDO Log Buffer by the AFTER ROW trigger. Since this process can be completed by CPU and RAM alone without any GPU call, it has little impact on transaction performance. When a certain amount of unapplied REDO Log Entries accumulate in the REDO Log Buffer, or a certain amount of time has passed since the last write, it is loaded by a background worker process (GPU memory keeper) and applied to GPU Cache. At this time, REDO Log Entries are transferred to the GPU in batches and processed in parallel by thousands of processor cores on the GPU, so delays caused by this process are rarely a problem. Search/analysis queries against the target table in GPU Cache do not load the table data, but use the data mapped from GPU Cache pre-allocated on the GPU device memory. If there are any unapplied REDO Logs at the start of the search/analysis query, they will all be applied to GPU Cache. This means that the results of a search/analysis query scanning the target GPU Cache will return the same results as if it were referring to the table directly, and the query will always be consistent.","title":"Architecture"},{"location":"gpucache/#configuration","text":"To enable GPU Cache, configure a trigger that executes pgstrom.gpucache_sync_trigger() function on AFTER INSERT OR UPDATE OR DELETE for each row. If GPU Cache is used on the replication slave, the invocation mode of this trigger must be ALWAYS . Below is an example to configure GPU Cache on the dpoints table. =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; Note Additional configuration at PostgreSQL v12 or prior. In case when GPU Cache is used at PostgreSQL v12 or prior, you need to configure an additional BEFORE TRUNCATE statement trigger that executes pgstrom.gpucache_sync_trigger() function. If you want to use the GPU Cache on the replication slave, If you use GPU Cache at the PostgreSQL v12 or prior, in a similar way, invocation mode of this trigger must have ALWAYS . PostgreSQL v13 enhanced its object-access-hook mechanism, so allows extension modules to capture execution of TRUNCATE without triggers configuration. On the other hand, the prior version still needs the BEFORE TRUNCATE statement trigger to keep consistency of GPU Cache by capture of TRUNCATE. Below is an example to configure GPU Cache on the dpoints table at PostgreSQL v12 or prior. =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger(); =# create trigger stmt_sync before truncate on dpoints_even for statement execute function pgstrom.gpucache_sync_trigger(); =# alter table dpoints_even enable always trigger row_sync; =# alter table dpoints_even enable always trigger stmt_sync;","title":"Configuration"},{"location":"gpucache/#gpu-cache-customize","text":"You can customize GPU Cache by specifying an optional string in the form of KEY=VALUE as an argument to GPU Cache line trigger. Please note that where you should specify is not to the syntax trigger. The following SQL statement is an example of creating a GPU Cache whose maximum row count is 2.5 million rows and the size of the REDO Log Buffer is 100MB. =# create trigger row_sync after insert or update or delete on dpoints_even for row execute function pgstrom.gpucache_sync_trigger('max_num_rows=2500000,redo_buffer_size=100m'); The options that can be given to the argument of the line trigger are shown below. gpu_device_id=GPU_ID (default: 0) Specify the target GPU device ID to allocate GPU Cache. max_num_rows=NROWS (default: 10485760) Specify the number of rows that can be allocated on GPU Cache. Just as with PostgreSQL tables, GPU Cache needs to retain updated rows prior to commit for visibility control, so max_num_rows should be specified with some margin. Note that the old version of the updated/deleted row will be released after the transaction is committed. redo_buffer_size=SIZE (default: 160m) Specify the size of REDO Log Buffer. You can use k, m and g as the unit. gpu_sync_interval=SECONDS (default: 5) If the specified time has passed since the last write to the REDO Log Buffer, REDO Log will be applied to the GPU, regardless of the number of rows updated. gpu_sync_threshold=SIZE (default: 25% of redo_buffer_size ) When the unapplied REDO Log in the REDO Log Buffer reaches SIZE bytes, it is applied to the GPU side. You can use k, m and g as the unit.","title":"GPU Cache Customize"},{"location":"gpucache/#gpu-cache-options","text":"Below are GPU Cache related PostgreSQL configuration parameters. pg_strom.enable_gpucache (default: on) This option controls whether search/analytical queries will use GPU Cache or not. If this value is off, the data will be read from the table each time, ignoring GPU Cache even if it is available. Note that this setting has no effect on REDO Log Buffer appending by triggers. pg_strom.gpucache_auto_preload (default: NULL) When PostgreSQL is started/restarted, GPU Cache for the table specified by this parameter will be built in advance. The value should be in the format: DATABASE_NAME.SCHEMA_NAME.TABLE_NAME . To specify multiple tables, separate them by commas. If GPU Cache is not built, the PostgreSQL backend process that first attempts to access GPU Cache will scan the entire target table and transfer it to the GPU. This process usually takes a considerable amount of time. However, by specifying the tables that should be loaded in this option, you can avoid waiting too long the first time you run a search/analysis query. If this parameter is set to '*', it will attempt to load the contents of all tables with GPU Cache into the GPU in order. At this time, the background worker will access all the databases in order, and will return exit code 1 to prompt the postmaster to restart. The server startup log will show that the \"GPUCache Startup Preloader\" exited with exit code 1 as follows, but this is not abnormal. LOG: database system is ready to accept connections LOG: background worker \"GPUCache Startup Preloader\" (PID 856418) exited with exit code 1 LOG: background worker \"GPUCache Startup Preloader\" (PID 856427) exited with exit code 1 LOG: create GpuCacheSharedState dpoints:164c95f71 LOG: gpucache: AllocMemory dpoints:164c95f71 (main_sz=772505600, extra_sz=0) LOG: gpucache: auto preload 'public.dpoints' (DB: postgres) LOG: create GpuCacheSharedState mytest:1773a589b LOG: gpucache: auto preload 'public.mytest' (DB: postgres) LOG: gpucache: AllocMemory mytest:1773a589b (main_sz=675028992, extra_sz=0)","title":"GPU Cache Options"},{"location":"gpucache/#operations","text":"","title":"Operations"},{"location":"gpucache/#confirm-gpu-cache-usage","text":"GPU Cache is referred to transparently. The user does not need to be aware of the presence or absence of GPU Cache, and PG-Strom will automatically determine and switch the process. The following is the query plan for a query that refers to the table \"dpoints\" which has GPU Cache set. The 3rd row from the bottom, in the \"GPU Cache\" field, shows the basic information about GPU Cache of this table. We can see that the query is executed with referring to GPU Cache and not the \"dpoints\" table. Note that the meaning of each item is as follows: max_num_rows indicates the maximum number of rows that GPU Cache can hold; main indicates the size of the area in GPU Cache for fixed-length fields; extra indicates the size of the area for variable-length data. =# explain select pref, city, count(*) from giscity g, dpoints d where pref = 'Tokyo' and st_contains(g.geom,st_makepoint(d.x, d.y)) group by pref, city; QUERY PLAN -------------------------------------------------------------------------------------------------------- HashAggregate (cost=5638809.75..5638859.99 rows=5024 width=29) Group Key: g.pref, g.city -> Custom Scan (GpuPreAgg) (cost=5638696.71..5638759.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=631923.57..5606933.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) GPU Cache: NVIDIA Tesla V100-PCIE-16GB [max_num_rows: 12000000, main: 772.51M, extra: 0] -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (16 rows)","title":"Confirm GPU Cache usage"},{"location":"gpucache/#check-status-of-gpu-cache","text":"Use the pgstrom.gpucache_info view to check the current state of GPU Cache. =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | refcnt | corrupted | gpu_main_sz | gpu_extra_sz | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------+------------+--------+-----------+-------------+--------------+----------------------------+-------------------+----------------+------------------+---------------+---------------+------------------------------------------------------------------------------------------------------------------------ 12728 | postgres | 25244 | mytest | 6295279771 | 3 | f | 675028992 | 0 | 2021-05-14 03:00:18.623503 | 500000 | 36000000 | 500000 | 36000000 | 36000000 | gpu_device_id=0,max_num_rows=10485760,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 12728 | postgres | 25262 | dpoints | 5985886065 | 3 | f | 772505600 | 0 | 2021-05-14 03:00:18.524627 | 8000000 | 576000192 | 8000000 | 576000192 | 576000192 | gpu_device_id=0,max_num_rows=12000000,redo_buffer_size=167772160,gpu_sync_interval=5000000,gpu_sync_threshold=41943040 (2 rows) Note that pgstrom.gpucache_info will only show the status of GPU Caches that have been initially loaded and have space allocated on the GPU device memory at that time. In other words, if the trigger function is set but not yet initially loaded (no one has accessed it yet), the potentially allocated GPU Cache will not be shown yet. The meaning of each field is as follows: database_oid The OID of the database to which the table with GPU Cache enabled exists. database_name The name of the database to which the table with GPU Cache enabled exists. table_oid The OID of the table with GPU Cache enabled. Note that the database this table exists in is not necessarily the database you are connected to. table_name The name of the table with GPU Cache enabled. Note that the database this table exists in is not necessarily the database you are connected to. signature A hash value indicating the uniqueness of GPU Cache. This value may change, for example, before and after executing ALTER TABLE . refcnt Reference counter of the GPU Cache. It does not always reflect the latest value. corrupted Shows whether the GPU Cache is corrupted. gpu_main_sz The size of the area reserved in GPU Cache for fixed-length data. gpu_extra_sz The size of the area reserved in GPU Cache for variable-length data. redo_write_ts The time when the REDO Log Buffer was last updated. redo_write_nitems The total number of REDO Logs in the REDO Log Buffer. redo_write_pos The total size (in bytes) of the REDO Logs in the REDO Log Buffer. redo_read_nitems The total number of REDO Logs read from the REDO Log Buffer and applied to the GPU. redo_read_pos The total size (in bytes) of REDO Logs read from the REDO Log Buffer and applied to the GPU. redo_sync_pos The position of the REDO Log which is scheduled to be applied to GPU Cache by the background worker on the REDO Log Buffer. This is used internally to avoid a situation where many sessions generate asynchronous requests at the same time when the remaining REDO Log Buffer is running out. config_options The optional string to customize GPU Cache.","title":"Check status of GPU Cache"},{"location":"gpucache/#gpu-cache-corruption-and-recovery","text":"If and when REDO logs could not be applied on the GPU cache by some reasons, like insertion of more rows than the max_num_rows configuration, or too much consumption of variable-length data buffer, GPU cache moves to the \"corrupted\" state. Once GPU cache gets corrupted, search/analysis SQL does not reference the GPU cache, and table updates stops writing REDO log. (If GPU cache gets corrupted after beginning of a search/analysis SQL unfortunately, this query may raise an error.) The pgstrom.gpucache_recovery(regclass) function recovers the GPU cache from the corrupted state. If you run this function after removal of the cause where REDO logs could not be applied, it runs initial-loading of the GPU cache again, then tries to recover the GPU cache. For example, if GPU cache gets corrupted because you tried to insert more rows than the max_num_rows , you reconfigure the trigger with expanded max_num_rows configuration or you delete a part of rows from the table, then runs pgstrom.gpucache_recovery() function.","title":"GPU Cache corruption and recovery"},{"location":"install/","text":"Installation This chapter introduces the steps to install PG-Strom. Checklist Server Hardware It requires generic x86_64 hardware that can run Linux operating system supported by CUDA Toolkit. We have no special requirement for CPU, storage and network devices. note002:HW Validation List may help you to choose the hardware. GPU Direct SQL Execution needs NVME-SSD devices, or fast network card with RoCE support, and to be installed under the same PCIe Root Complex where GPU is located on. GPU Device PG-Strom requires at least one GPU device on the system, which is supported by CUDA Toolkit, has computing capability 6.0 (Pascal generation) or later; Please check at 002: HW Validation List - List of supported GPU models for GPU selection. Operating System PG-Strom requires Linux operating system for x86_64 architecture, and its distribution supported by CUDA Toolkit. Our recommendation is Red Hat Enterprise Linux or Rocky Linux version 8.x series. GPU Direct SQL (with cuFile driver) needs the nvidia-fs driver distributed with CUDA Toolkit, and Mellanox OFED (OpenFabrics Enterprise Distribution) driver. PostgreSQL PG-Strom v5.0 requires PostgreSQL v15 or later. Some of PostgreSQL APIs used by PG-Strom internally are not included in the former versions. CUDA Toolkit PG-Strom requires CUDA Toolkit version 12.2update2 or later. Some of CUDA Driver APIs used by PG-Strom internally are not included in the former versions. Steps to Install The overall steps to install are below: Hardware Configuration OS Installation MOFED Driver installation CUDA Toolkit installation HeteroDB Extra Module installation PostgreSQL installation PG-Strom installation PostgreSQL Extensions installation PostGIS contrib/cube OS Installation Choose a Linux distribution which is supported by CUDA Toolkit, then install the system according to the installation process of the distribution. NVIDIA DEVELOPER ZONE introduces the list of Linux distributions which are supported by CUDA Toolkit. In case of Red Hat Enterprise Linux 8.x series (including Rocky Linux 8.x series), choose \"Minimal installation\" as base environment, and also check the \"Development Tools\" add-ons for the software selection Next to the OS installation on the server, go on the package repository configuration to install the third-party packages. If you didn't check the \"Development Tools\" at the installer, we can additionally install the software using the command below after the operating system installation. # dnf groupinstall 'Development Tools' Tip If GPU devices installed on the server are too new, it may cause system crash during system boot. In this case, you may avoid the problem by adding nouveau.modeset=0 onto the kernel boot option, to disable the inbox graphic driver. Disables nouveau driver When the nouveau driver, that is an open source compatible driver for NVIDIA GPUs, is loaded, it prevent to load the nvidia driver. In this case, reboot the operating system after a configuration to disable the nouveau driver. To disable the nouveau driver, put the following configuration onto /etc/modprobe.d/disable-nouveau.conf , and run dracut command to apply them on the boot image of Linux kernel. Then, restart the system once. # cat > /etc/modprobe.d/disable-nouveau.conf </extra/mlnx-nvme/host/nvme-rdma.ko that is additionally installed, instead of the INBOX nvme-rdma ( /lib/modules//kernel/drivers/nvme/host/nvme-rdma.ko.xz ). $ modinfo nvme-rdma filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/mlnx-nvme/host/nvme-rdma.ko license: GPL v2 rhelversion: 9.4 srcversion: 16C0049F26768D6EA12771B depends: nvme-core,rdma_cm,ib_core,nvme-fabrics,mlx_compat retpoline: Y name: nvme_rdma vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions parm: register_always:Use memory registration even for contiguous memory regions (bool) Then, shutdown the system and restart, to replace the kernel modules already loaded (like nvme ). Please don't forget to run dracut -f after completion of the mlnxofedinstall script. Tips Linux kernel version up and MOFED driver MODED drivers do not use DKMS (Dynamic Kernel Module Support) in RHEL series distributions. Therefore, when the Linux kernel is upgraded, you will need to perform the above steps again to reinstall the MOFED driver that is compatible with the new Linux kernel. The Linux kernel may be updated together when another package is updated, such as when installing the CUDA Toolkit described below, but the same applies in that case. heterodb-swdc Installation PG-Strom and related packages are distributed from HeteroDB Software Distribution Center . You need to add a repository definition of HeteroDB-SWDC for you system to obtain these software. heterodb-swdc package provides the repository definition of HeteroDB-SWDC. Access to the HeteroDB Software Distribution Center using Web browser, download the heterodb-swdc-1.3-1.el9.noarch.rpm on top of the file list, then install this package. (Use heterodb-swdc-1.3-1.el8.noarch.rpm for RHEL8) Once heterodb-swdc package gets installed, yum system configuration is updated to get software from the HeteroDB-SWDC repository. Install the heterodb-swdc package as follows. # dnf install https://heterodb.github.io/swdc/yum/rhel8-noarch/heterodb-swdc-1.2-1.el8.noarch.rpm CUDA Toolkit Installation This section introduces the installation of CUDA Toolkit. If you already installed the latest CUDA Toolkit, you can check whether your installation is identical with the configuration described in this section. NVIDIA offers two approach to install CUDA Toolkit; one is by self-extracting archive (runfile), and the other is by RPM packages. We recommend the RPM installation for PG-Strom setup. You can download the installation package for CUDA Toolkit from NVIDIA DEVELOPER ZONE. Choose your OS, architecture, distribution and version, then choose \"rpm(network)\" edition. Once you choose the \"rpm(network)\" option, it shows a few step-by-step shell commands to register the CUDA repository and install the packages. Run the installation according to the guidance. # dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo # dnf clean all # dnf install cuda-toolkit-12-5 Next to the installation of the CUDA Toolkit, two types of commands are introduced to install the nvidia driver. Please use the open source version of nvidia-driver here. Only the open source version supports the GPUDirect Storage feature, and PG-Strom's GPU-Direct SQL utilizes this feature. Tips Use of Volta or former GPUs The open source edition of the nvidia driver does not support Volta generation GPUs or former. Therefore, if you want to use PG-Strom with Volta or Pascal generation GPUs, you need to use CUDA 12.2 Update 1, whose proprietary driver supports GPUDirect Storage. The CUDA 12.2 Update 1 package can be obtained here . Next, install the driver module nvidia-gds for the GPU-Direct Storage (GDS). Please specify the same version name as the CUDA Toolkit version after the package name. # dnf module install nvidia-driver:open-dkms # dnf install nvidia-gds-12-5 Once installation completed successfully, CUDA Toolkit is deployed at /usr/local/cuda . $ ls /usr/local/cuda/ bin/ gds/ nsightee_plugins/ targets/ compute-sanitizer/ include@ nvml/ tools/ CUDA_Toolkit_Release_Notes.txt lib64@ nvvm/ version.json DOCS libnvvp/ README EULA.txt LICENSE share/ extras/ man/ src/ Once installation gets completed, ensure the system recognizes the GPU devices correctly. nvidia-smi command shows GPU information installed on your system, as follows. $ nvidia-smi Mon Jun 3 09:56:41 2024 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 555.42.02 Driver Version: 555.42.02 CUDA Version: 12.5 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA A100-PCIE-40GB Off | 00000000:41:00.0 Off | 0 | | N/A 58C P0 66W / 250W | 1MiB / 40960MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+ Check GPUDirect Storage status After the installation of CUDA Toolkit according to the steps above, your system will become ready for the GPUDirect Storage. Run gdscheck tool to confirm the configuration for each storage devices, as follows. (Thie example loads not only nvme , but nvme-rdma and rpcrdma kernel modules also, therefore, it reports the related features as Supported ) # /usr/local/cuda/gds/tools/gdscheck -p GDS release version: 1.10.0.4 nvidia_fs version: 2.20 libcufile version: 2.12 Platform: x86_64 ============ ENVIRONMENT: ============ ===================== DRIVER CONFIGURATION: ===================== NVMe : Supported NVMeOF : Supported SCSI : Unsupported ScaleFlux CSD : Unsupported NVMesh : Unsupported DDN EXAScaler : Unsupported IBM Spectrum Scale : Unsupported NFS : Supported BeeGFS : Unsupported WekaFS : Unsupported Userspace RDMA : Unsupported --Mellanox PeerDirect : Disabled --rdma library : Not Loaded (libcufile_rdma.so) --rdma devices : Not configured --rdma_device_status : Up: 0 Down: 0 ===================== CUFILE CONFIGURATION: ===================== properties.use_compat_mode : true properties.force_compat_mode : false properties.gds_rdma_write_support : true properties.use_poll_mode : false properties.poll_mode_max_size_kb : 4 properties.max_batch_io_size : 128 properties.max_batch_io_timeout_msecs : 5 properties.max_direct_io_size_kb : 16384 properties.max_device_cache_size_kb : 131072 properties.max_device_pinned_mem_size_kb : 33554432 properties.posix_pool_slab_size_kb : 4 1024 16384 properties.posix_pool_slab_count : 128 64 32 properties.rdma_peer_affinity_policy : RoundRobin properties.rdma_dynamic_routing : 0 fs.generic.posix_unaligned_writes : false fs.lustre.posix_gds_min_kb: 0 fs.beegfs.posix_gds_min_kb: 0 fs.weka.rdma_write_support: false fs.gpfs.gds_write_support: false profile.nvtx : false profile.cufile_stats : 0 miscellaneous.api_check_aggressive : false execution.max_io_threads : 4 execution.max_io_queue_depth : 128 execution.parallel_io : true execution.min_io_threshold_size_kb : 8192 execution.max_request_parallelism : 4 properties.force_odirect_mode : false properties.prefer_iouring : false ========= GPU INFO: ========= GPU index 0 NVIDIA A100-PCIE-40GB bar:1 bar size (MiB):65536 supports GDS, IOMMU State: Disabled ============== PLATFORM INFO: ============== IOMMU: disabled Nvidia Driver Info Status: Supported(Nvidia Open Driver Installed) Cuda Driver Version Installed: 12050 Platform: AS -2014CS-TR, Arch: x86_64(Linux 5.14.0-427.18.1.el9_4.x86_64) Platform verification succeeded Tips Additional configuration for RAID volume For data reading from software RAID (md-raid0) volumes by GPUDirect Storage, the following line must be added to the /lib/udev/rules.d/63-md-raid-arrays.rules configuration file. IMPORT{\u200bprogram}=\"/usr/sbin/mdadm --detail --export $devnode\" Then reboot the system to ensure the new configuration. See NVIDIA GPUDirect Storage Installation and Troubleshooting Guide for the details. PCI Bar1 Memory Configuration GPU-Direct SQL maps GPU device memory to the PCI BAR1 region (physical address space) on the host system, and sends P2P-RDMA requests to NVME devices with that as the destination for the shortest data transfer. To perform P2P-RDMA with sufficient multiplicity, the GPU must have enough PCI BAR1 space to map the device buffer. The size of the PCI BAR1 area is fixed for most GPUs, and PG-Strom recommends products whose size exceeds the GPU device memory size. However, some GPU products allow to change the size of the PCI BAR1 area by switching the operation mode. If your GPU is either of the following, refer to the NVIDIA Display Mode Selector Tool and switch to the mode that maximizes the PCI BAR1 area size. NVIDIA L40S NVIDIA L40 NVIDIA A40 NVIDIA RTX 6000 Ada NVIDIA RTX A6000 NVIDIA RTX A5500 NVIDIA RTX A5000 To check the GPU memory size and PCI BAR1 size installed in the system, use the nvidia-smi -q command. Memory-related status is displayed as shown below. $ nvidia-smi -q : FB Memory Usage Total : 46068 MiB Reserved : 685 MiB Used : 4 MiB Free : 45377 MiB BAR1 Memory Usage Total : 65536 MiB Used : 1 MiB Free : 65535 MiB : HeteroDB extra modules heterodb-extra module enhances PG-Strom the following features. multi-GPUs support GPUDirect SQL GiST index support on GPU License management If you don't use the above features, only open source modules, you don't need to install the heterodb-extra module here. Please skip this section. Install the heterodb-extra package, downloaded from the SWDC, as follows. # dnf install heterodb-extra License activation License activation is needed to use all the features of heterodb-extra , provided by HeteroDB,Inc. You can operate the system without license, but features below are restricted. Multiple GPUs support Striping of NVME-SSD drives (md-raid0) on GPUDirect SQL Support of NVME-oF device on GPUDirect SQL Support of GiST index on GPU-version of PostGIS workloads You can obtain a license file, like as a plain text below, from HeteroDB,Inc. IAgIVdKxhe+BSer3Y67jQW0+uTzYh00K6WOSH7xQ26Qcw8aeUNYqJB9YcKJTJb+QQhjmUeQpUnboNxVwLCd3HFuLXeBWMKp11/BgG0FSrkUWu/ZCtDtw0F1hEIUY7m767zAGV8y+i7BuNXGJFvRlAkxdVO3/K47ocIgoVkuzBfLvN/h9LffOydUnHPzrFHfLc0r3nNNgtyTrfvoZiXegkGM9GBTAKyq8uWu/OGonh9ybzVKOgofhDLk0rVbLohOXDhMlwDl2oMGIr83tIpCWG+BGE+TDwsJ4n71Sv6n4bi/ZBXBS498qShNHDGrbz6cNcDVBa+EuZc6HzZoF6UrljEcl= ---- VERSION:2 SERIAL_NR:HDB-TRIAL ISSUED_AT:2019-05-09 EXPIRED_AT:2019-06-08 GPU_UUID:GPU-a137b1df-53c9-197f-2801-f2dccaf9d42f Copy the license file to /etc/heterodb.license , then restart PostgreSQL. The startup log messages of PostgreSQL dumps the license information, and it tells us the license activation is successfully done. : LOG: HeteroDB Extra module loaded [api_version=20231105,cufile=on,nvme_strom=off,githash=9ca2fe4d2fbb795ad2d741dcfcb9f2fe499a5bdf] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2022-11-19\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} LOG: PG-Strom version 5.0.1 built for PostgreSQL 15 (githash: 972441dbafed6679af86af40bc8613be2d73c4fd) : PostgreSQL Installation This section introduces PostgreSQL installation with RPM. We don't introduce the installation steps from the source because there are many documents for this approach, and there are also various options for the ./configure script. PostgreSQL is also distributed in the packages of Linux distributions, however, it is not the latest one, and often older than the version which supports PG-Strom. For example, Red Hat Enterprise Linux 7.x distributes PostgreSQL v9.2.x series. This version had been EOL by the PostgreSQL community. PostgreSQL Global Development Group provides yum repository to distribute the latest PostgreSQL and related packages. Like the configuration of EPEL, you can install a small package to set up yum repository, then install PostgreSQL and related software. Here is the list of yum repository definition: http://yum.postgresql.org/repopackages.php . Repository definitions are per PostgreSQL major version and Linux distribution. You need to choose the one for your Linux distribution, and for PostgreSQL v15 or later. You can install PostgreSQL as following steps: Installation of yum repository definition. Disables the distribution's default PostgreSQL module Installation of PostgreSQL packages. # dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm # dnf -y module disable postgresql # dnf install -y postgresql16-devel postgresql16-server Note On the Red Hat Enterprise Linux, the package name postgresql conflicts to the default one at the distribution, thus, unable to install the packages from PGDG. So, disable the postgresql module by the distribution, using dnf -y module disable postgresql . PG-Strom Installation RPM Installation PG-Strom and related packages are distributed from HeteroDB Software Distribution Center . If you repository definition has been added, not many tasks are needed. We provide individual RPM packages of PG-Strom for each PostgreSQL major version. pg_strom-PG15 package is built for PostgreSQL v15, and pg_strom-PG16 is also built for PostgreSQL v16. It is a restriction due to binary compatibility of extension modules for PostgreSQL. # dnf install -y pg_strom-PG16 That's all for package installation. Installation from the source For developers, we also introduces the steps to build and install PG-Strom from the source code. Getting the source code Like RPM packages, you can download tarball of the source code from HeteroDB Software Distribution Center . On the other hands, here is a certain time-lags to release the tarball, it may be preferable to checkout the master branch of PG-Strom on GitHub to use the latest development branch. $ git clone https://github.com/heterodb/pg-strom.git Cloning into 'pg-strom'... remote: Counting objects: 13797, done. remote: Compressing objects: 100% (215/215), done. remote: Total 13797 (delta 208), reused 339 (delta 167), pack-reused 13400 Receiving objects: 100% (13797/13797), 11.81 MiB | 1.76 MiB/s, done. Resolving deltas: 100% (10504/10504), done. Building the PG-Strom Configuration to build PG-Strom must match to the target PostgreSQL strictly. For example, if a particular strcut has inconsistent layout by the configuration at build, it may lead problematic bugs; not easy to find out. Thus, not to have inconsistency, PG-Strom does not have own configure script, but references the build configuration of PostgreSQL using pg_config command. If PATH environment variable is set to the pg_config command of the target PostgreSQL, run make and make install . Elsewhere, give PG_CONFIG=... parameter on make command to tell the full path of the pg_config command. $ cd pg-strom/src $ make PG_CONFIG=/usr/pgsql-16/bin/pg_config $ sudo make install PG_CONFIG=/usr/pgsql-16/bin/pg_config Post Installation Setup Creation of database cluster Database cluster is not constructed yet, run initdb command to set up initial database of PostgreSQL. The default path of the database cluster on RPM installation is /var/lib/pgsql//data . If you install postgresql-alternatives package, this default path can be referenced by /var/lib/pgdata regardless of the PostgreSQL version. # su - postgres $ /usr/pgsql-16/bin/initdb -D /var/lib/pgdata/ The files belonging to this database system will be owned by user \"postgres\". This user must also own the server process. The database cluster will be initialized with locale \"en_US.UTF-8\". The default database encoding has accordingly been set to \"UTF8\". The default text search configuration will be set to \"english\". Data page checksums are disabled. fixing permissions on existing directory /var/lib/pgdata ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Tokyo creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling \"trust\" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D /var/lib/pgdata/ -l logfile start Setup postgresql.conf Next, edit postgresql.conf which is a configuration file of PostgreSQL. The parameters below should be edited at least to work PG-Strom. Investigate other parameters according to usage of the system and expected workloads. shared_preload_libraries PG-Strom module must be loaded on startup of the postmaster process by the shared_preload_libraries . Unable to load it on demand. Therefore, you must add the configuration below. shared_preload_libraries = '$libdir/pg_strom' max_worker_processes PG-Strom internally uses several background workers, so the default configuration (= 8) is too small for other usage. So, we recommand to expand the variable for a certain margin. max_worker_processes = 100 shared_buffers Although it depends on the workloads, the initial configuration of shared_buffers is too small for the data size where PG-Strom tries to work, thus storage workloads restricts the entire performance, and may be unable to work GPU efficiently. So, we recommend to expand the variable for a certain margin. shared_buffers = 10GB Please consider to apply SSD-to-GPU Direct SQL Execution to process larger than system's physical RAM size. work_mem Although it depends on the workloads, the initial configuration of work_mem is too small to choose the optimal query execution plan on analytic queries. An typical example is, disk-based merge sort may be chosen instead of the in-memory quick-sorting. So, we recommend to expand the variable for a certain margin. work_mem = 1GB Expand OS resource limits GPU Direct SQL especially tries to open many files simultaneously, so resource limit for number of file descriptors per process should be expanded. Also, we recommend not to limit core file size to generate core dump of PostgreSQL certainly on system crash. If PostgreSQL service is launched by systemd, you can put the configurations of resource limit at /etc/systemd/system/postgresql-XX.service.d/pg_strom.conf . RPM installation setups the configuration below by the default. It comments out configuration to the environment variable CUDA_ENABLE_COREDUMP_ON_EXCEPTION . This is a developer option that enables to generate GPU's core dump on any CUDA/GPU level errors, if enabled. See CUDA-GDB:GPU core dump support for more details. [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1 Start PostgreSQL Start PostgreSQL service. If PG-Strom is set up appropriately, it writes out log message which shows PG-Strom recognized GPU devices. The example below recognized two NVIDIA A100 (PCIE; 40GB), and displays the closest GPU identifier foe each NVME-SSD drive. # systemctl start postgresql-16 # journalctl -u postgresql-16 Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB Extra module loaded [api_version=20240418,cufile=off,nvme_strom=off,githash=3ffc65428c07bb3c9d0e5c75a2973389f91dfcd4] Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2024-06-02\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: PG-Strom version 5.12.el9 built for PostgreSQL 16 (githash: ) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom binary built for CUDA 12.4 (CUDA runtime 12.5) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] WARNING: The CUDA version where this PG-Strom module binary was built for (12.4) is newer than the CUDA runtime version on this platform (12.5). It may lead unexpected behavior, and upgrade of CUDA toolkit is recommended. Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78979c134606) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:81:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:82:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c2:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c6:00:0] nvme4 (Corsair MP600 CORE) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c3:00:0] nvme5 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c1:00:0] nvme0 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c4:00:0] nvme2 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] LOG: redirecting log output to logging collector process Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] HINT: Future log output will appear in directory \"log\". Jun 02 17:28:48 buri.heterodb.com systemd[1]: Started PostgreSQL 16 database server. Creation of PG-Strom Extension At the last, create database objects related to PG-Strom, like SQL functions. This steps are packaged using EXTENSION feature of PostgreSQL. So, all you needs to run is CREATE EXTENSION on the SQL command line. Please note that this step is needed for each new database. If you want PG-Strom is pre-configured on new database creation, you can create PG-Strom extension on the template1 database, its configuration will be copied to the new database on CREATE DATABASE command. $ psql -U postgres psql (16.3) Type \"help\" for help. postgres=# CREATE EXTENSION pg_strom ; CREATE EXTENSION That's all for the installation. PostGIS Installation PG-Strom supports execution of a part of PostGIS functions on GPU devices. This section introduces the steps to install PostGIS module. Skip it on your demand. PostGIS module can be installed from the yum repository by PostgreSQL Global Development Group, like PostgreSQL itself. The example below shows the command to install PostGIS v3.4 built for PostgreSQL v16. # dnf install postgis34_16 Start PostgreSQL server after the initial setup of database cluster, then run CREATE EXTENSION command from SQL client to define geometry data type and SQL functions for geoanalytics. postgres=# CREATE EXTENSION postgis; CREATE EXTENSION","title":"Install"},{"location":"install/#installation","text":"This chapter introduces the steps to install PG-Strom.","title":"Installation"},{"location":"install/#checklist","text":"Server Hardware It requires generic x86_64 hardware that can run Linux operating system supported by CUDA Toolkit. We have no special requirement for CPU, storage and network devices. note002:HW Validation List may help you to choose the hardware. GPU Direct SQL Execution needs NVME-SSD devices, or fast network card with RoCE support, and to be installed under the same PCIe Root Complex where GPU is located on. GPU Device PG-Strom requires at least one GPU device on the system, which is supported by CUDA Toolkit, has computing capability 6.0 (Pascal generation) or later; Please check at 002: HW Validation List - List of supported GPU models for GPU selection. Operating System PG-Strom requires Linux operating system for x86_64 architecture, and its distribution supported by CUDA Toolkit. Our recommendation is Red Hat Enterprise Linux or Rocky Linux version 8.x series. GPU Direct SQL (with cuFile driver) needs the nvidia-fs driver distributed with CUDA Toolkit, and Mellanox OFED (OpenFabrics Enterprise Distribution) driver. PostgreSQL PG-Strom v5.0 requires PostgreSQL v15 or later. Some of PostgreSQL APIs used by PG-Strom internally are not included in the former versions. CUDA Toolkit PG-Strom requires CUDA Toolkit version 12.2update2 or later. Some of CUDA Driver APIs used by PG-Strom internally are not included in the former versions.","title":"Checklist"},{"location":"install/#steps-to-install","text":"The overall steps to install are below: Hardware Configuration OS Installation MOFED Driver installation CUDA Toolkit installation HeteroDB Extra Module installation PostgreSQL installation PG-Strom installation PostgreSQL Extensions installation PostGIS contrib/cube","title":"Steps to Install"},{"location":"install/#os-installation","text":"Choose a Linux distribution which is supported by CUDA Toolkit, then install the system according to the installation process of the distribution. NVIDIA DEVELOPER ZONE introduces the list of Linux distributions which are supported by CUDA Toolkit. In case of Red Hat Enterprise Linux 8.x series (including Rocky Linux 8.x series), choose \"Minimal installation\" as base environment, and also check the \"Development Tools\" add-ons for the software selection Next to the OS installation on the server, go on the package repository configuration to install the third-party packages. If you didn't check the \"Development Tools\" at the installer, we can additionally install the software using the command below after the operating system installation. # dnf groupinstall 'Development Tools' Tip If GPU devices installed on the server are too new, it may cause system crash during system boot. In this case, you may avoid the problem by adding nouveau.modeset=0 onto the kernel boot option, to disable the inbox graphic driver.","title":"OS Installation"},{"location":"install/#disables-nouveau-driver","text":"When the nouveau driver, that is an open source compatible driver for NVIDIA GPUs, is loaded, it prevent to load the nvidia driver. In this case, reboot the operating system after a configuration to disable the nouveau driver. To disable the nouveau driver, put the following configuration onto /etc/modprobe.d/disable-nouveau.conf , and run dracut command to apply them on the boot image of Linux kernel. Then, restart the system once. # cat > /etc/modprobe.d/disable-nouveau.conf </extra/mlnx-nvme/host/nvme-rdma.ko that is additionally installed, instead of the INBOX nvme-rdma ( /lib/modules//kernel/drivers/nvme/host/nvme-rdma.ko.xz ). $ modinfo nvme-rdma filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/mlnx-nvme/host/nvme-rdma.ko license: GPL v2 rhelversion: 9.4 srcversion: 16C0049F26768D6EA12771B depends: nvme-core,rdma_cm,ib_core,nvme-fabrics,mlx_compat retpoline: Y name: nvme_rdma vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions parm: register_always:Use memory registration even for contiguous memory regions (bool) Then, shutdown the system and restart, to replace the kernel modules already loaded (like nvme ). Please don't forget to run dracut -f after completion of the mlnxofedinstall script. Tips Linux kernel version up and MOFED driver MODED drivers do not use DKMS (Dynamic Kernel Module Support) in RHEL series distributions. Therefore, when the Linux kernel is upgraded, you will need to perform the above steps again to reinstall the MOFED driver that is compatible with the new Linux kernel. The Linux kernel may be updated together when another package is updated, such as when installing the CUDA Toolkit described below, but the same applies in that case.","title":"MOFED Driver Installation"},{"location":"install/#heterodb-swdc-installation","text":"PG-Strom and related packages are distributed from HeteroDB Software Distribution Center . You need to add a repository definition of HeteroDB-SWDC for you system to obtain these software. heterodb-swdc package provides the repository definition of HeteroDB-SWDC. Access to the HeteroDB Software Distribution Center using Web browser, download the heterodb-swdc-1.3-1.el9.noarch.rpm on top of the file list, then install this package. (Use heterodb-swdc-1.3-1.el8.noarch.rpm for RHEL8) Once heterodb-swdc package gets installed, yum system configuration is updated to get software from the HeteroDB-SWDC repository. Install the heterodb-swdc package as follows. # dnf install https://heterodb.github.io/swdc/yum/rhel8-noarch/heterodb-swdc-1.2-1.el8.noarch.rpm","title":"heterodb-swdc Installation"},{"location":"install/#cuda-toolkit-installation","text":"This section introduces the installation of CUDA Toolkit. If you already installed the latest CUDA Toolkit, you can check whether your installation is identical with the configuration described in this section. NVIDIA offers two approach to install CUDA Toolkit; one is by self-extracting archive (runfile), and the other is by RPM packages. We recommend the RPM installation for PG-Strom setup. You can download the installation package for CUDA Toolkit from NVIDIA DEVELOPER ZONE. Choose your OS, architecture, distribution and version, then choose \"rpm(network)\" edition. Once you choose the \"rpm(network)\" option, it shows a few step-by-step shell commands to register the CUDA repository and install the packages. Run the installation according to the guidance. # dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo # dnf clean all # dnf install cuda-toolkit-12-5 Next to the installation of the CUDA Toolkit, two types of commands are introduced to install the nvidia driver. Please use the open source version of nvidia-driver here. Only the open source version supports the GPUDirect Storage feature, and PG-Strom's GPU-Direct SQL utilizes this feature. Tips Use of Volta or former GPUs The open source edition of the nvidia driver does not support Volta generation GPUs or former. Therefore, if you want to use PG-Strom with Volta or Pascal generation GPUs, you need to use CUDA 12.2 Update 1, whose proprietary driver supports GPUDirect Storage. The CUDA 12.2 Update 1 package can be obtained here . Next, install the driver module nvidia-gds for the GPU-Direct Storage (GDS). Please specify the same version name as the CUDA Toolkit version after the package name. # dnf module install nvidia-driver:open-dkms # dnf install nvidia-gds-12-5 Once installation completed successfully, CUDA Toolkit is deployed at /usr/local/cuda . $ ls /usr/local/cuda/ bin/ gds/ nsightee_plugins/ targets/ compute-sanitizer/ include@ nvml/ tools/ CUDA_Toolkit_Release_Notes.txt lib64@ nvvm/ version.json DOCS libnvvp/ README EULA.txt LICENSE share/ extras/ man/ src/ Once installation gets completed, ensure the system recognizes the GPU devices correctly. nvidia-smi command shows GPU information installed on your system, as follows. $ nvidia-smi Mon Jun 3 09:56:41 2024 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 555.42.02 Driver Version: 555.42.02 CUDA Version: 12.5 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA A100-PCIE-40GB Off | 00000000:41:00.0 Off | 0 | | N/A 58C P0 66W / 250W | 1MiB / 40960MiB | 0% Default | | | | Disabled | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+","title":"CUDA Toolkit Installation"},{"location":"install/#check-gpudirect-storage-status","text":"After the installation of CUDA Toolkit according to the steps above, your system will become ready for the GPUDirect Storage. Run gdscheck tool to confirm the configuration for each storage devices, as follows. (Thie example loads not only nvme , but nvme-rdma and rpcrdma kernel modules also, therefore, it reports the related features as Supported ) # /usr/local/cuda/gds/tools/gdscheck -p GDS release version: 1.10.0.4 nvidia_fs version: 2.20 libcufile version: 2.12 Platform: x86_64 ============ ENVIRONMENT: ============ ===================== DRIVER CONFIGURATION: ===================== NVMe : Supported NVMeOF : Supported SCSI : Unsupported ScaleFlux CSD : Unsupported NVMesh : Unsupported DDN EXAScaler : Unsupported IBM Spectrum Scale : Unsupported NFS : Supported BeeGFS : Unsupported WekaFS : Unsupported Userspace RDMA : Unsupported --Mellanox PeerDirect : Disabled --rdma library : Not Loaded (libcufile_rdma.so) --rdma devices : Not configured --rdma_device_status : Up: 0 Down: 0 ===================== CUFILE CONFIGURATION: ===================== properties.use_compat_mode : true properties.force_compat_mode : false properties.gds_rdma_write_support : true properties.use_poll_mode : false properties.poll_mode_max_size_kb : 4 properties.max_batch_io_size : 128 properties.max_batch_io_timeout_msecs : 5 properties.max_direct_io_size_kb : 16384 properties.max_device_cache_size_kb : 131072 properties.max_device_pinned_mem_size_kb : 33554432 properties.posix_pool_slab_size_kb : 4 1024 16384 properties.posix_pool_slab_count : 128 64 32 properties.rdma_peer_affinity_policy : RoundRobin properties.rdma_dynamic_routing : 0 fs.generic.posix_unaligned_writes : false fs.lustre.posix_gds_min_kb: 0 fs.beegfs.posix_gds_min_kb: 0 fs.weka.rdma_write_support: false fs.gpfs.gds_write_support: false profile.nvtx : false profile.cufile_stats : 0 miscellaneous.api_check_aggressive : false execution.max_io_threads : 4 execution.max_io_queue_depth : 128 execution.parallel_io : true execution.min_io_threshold_size_kb : 8192 execution.max_request_parallelism : 4 properties.force_odirect_mode : false properties.prefer_iouring : false ========= GPU INFO: ========= GPU index 0 NVIDIA A100-PCIE-40GB bar:1 bar size (MiB):65536 supports GDS, IOMMU State: Disabled ============== PLATFORM INFO: ============== IOMMU: disabled Nvidia Driver Info Status: Supported(Nvidia Open Driver Installed) Cuda Driver Version Installed: 12050 Platform: AS -2014CS-TR, Arch: x86_64(Linux 5.14.0-427.18.1.el9_4.x86_64) Platform verification succeeded Tips Additional configuration for RAID volume For data reading from software RAID (md-raid0) volumes by GPUDirect Storage, the following line must be added to the /lib/udev/rules.d/63-md-raid-arrays.rules configuration file. IMPORT{\u200bprogram}=\"/usr/sbin/mdadm --detail --export $devnode\" Then reboot the system to ensure the new configuration. See NVIDIA GPUDirect Storage Installation and Troubleshooting Guide for the details.","title":"Check GPUDirect Storage status"},{"location":"install/#pci-bar1-memory-configuration","text":"GPU-Direct SQL maps GPU device memory to the PCI BAR1 region (physical address space) on the host system, and sends P2P-RDMA requests to NVME devices with that as the destination for the shortest data transfer. To perform P2P-RDMA with sufficient multiplicity, the GPU must have enough PCI BAR1 space to map the device buffer. The size of the PCI BAR1 area is fixed for most GPUs, and PG-Strom recommends products whose size exceeds the GPU device memory size. However, some GPU products allow to change the size of the PCI BAR1 area by switching the operation mode. If your GPU is either of the following, refer to the NVIDIA Display Mode Selector Tool and switch to the mode that maximizes the PCI BAR1 area size. NVIDIA L40S NVIDIA L40 NVIDIA A40 NVIDIA RTX 6000 Ada NVIDIA RTX A6000 NVIDIA RTX A5500 NVIDIA RTX A5000 To check the GPU memory size and PCI BAR1 size installed in the system, use the nvidia-smi -q command. Memory-related status is displayed as shown below. $ nvidia-smi -q : FB Memory Usage Total : 46068 MiB Reserved : 685 MiB Used : 4 MiB Free : 45377 MiB BAR1 Memory Usage Total : 65536 MiB Used : 1 MiB Free : 65535 MiB :","title":"PCI Bar1 Memory Configuration"},{"location":"install/#heterodb-extra-modules","text":"heterodb-extra module enhances PG-Strom the following features. multi-GPUs support GPUDirect SQL GiST index support on GPU License management If you don't use the above features, only open source modules, you don't need to install the heterodb-extra module here. Please skip this section. Install the heterodb-extra package, downloaded from the SWDC, as follows. # dnf install heterodb-extra","title":"HeteroDB extra modules"},{"location":"install/#license-activation","text":"License activation is needed to use all the features of heterodb-extra , provided by HeteroDB,Inc. You can operate the system without license, but features below are restricted. Multiple GPUs support Striping of NVME-SSD drives (md-raid0) on GPUDirect SQL Support of NVME-oF device on GPUDirect SQL Support of GiST index on GPU-version of PostGIS workloads You can obtain a license file, like as a plain text below, from HeteroDB,Inc. IAgIVdKxhe+BSer3Y67jQW0+uTzYh00K6WOSH7xQ26Qcw8aeUNYqJB9YcKJTJb+QQhjmUeQpUnboNxVwLCd3HFuLXeBWMKp11/BgG0FSrkUWu/ZCtDtw0F1hEIUY7m767zAGV8y+i7BuNXGJFvRlAkxdVO3/K47ocIgoVkuzBfLvN/h9LffOydUnHPzrFHfLc0r3nNNgtyTrfvoZiXegkGM9GBTAKyq8uWu/OGonh9ybzVKOgofhDLk0rVbLohOXDhMlwDl2oMGIr83tIpCWG+BGE+TDwsJ4n71Sv6n4bi/ZBXBS498qShNHDGrbz6cNcDVBa+EuZc6HzZoF6UrljEcl= ---- VERSION:2 SERIAL_NR:HDB-TRIAL ISSUED_AT:2019-05-09 EXPIRED_AT:2019-06-08 GPU_UUID:GPU-a137b1df-53c9-197f-2801-f2dccaf9d42f Copy the license file to /etc/heterodb.license , then restart PostgreSQL. The startup log messages of PostgreSQL dumps the license information, and it tells us the license activation is successfully done. : LOG: HeteroDB Extra module loaded [api_version=20231105,cufile=on,nvme_strom=off,githash=9ca2fe4d2fbb795ad2d741dcfcb9f2fe499a5bdf] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2022-11-19\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} LOG: PG-Strom version 5.0.1 built for PostgreSQL 15 (githash: 972441dbafed6679af86af40bc8613be2d73c4fd) :","title":"License activation"},{"location":"install/#postgresql-installation","text":"This section introduces PostgreSQL installation with RPM. We don't introduce the installation steps from the source because there are many documents for this approach, and there are also various options for the ./configure script. PostgreSQL is also distributed in the packages of Linux distributions, however, it is not the latest one, and often older than the version which supports PG-Strom. For example, Red Hat Enterprise Linux 7.x distributes PostgreSQL v9.2.x series. This version had been EOL by the PostgreSQL community. PostgreSQL Global Development Group provides yum repository to distribute the latest PostgreSQL and related packages. Like the configuration of EPEL, you can install a small package to set up yum repository, then install PostgreSQL and related software. Here is the list of yum repository definition: http://yum.postgresql.org/repopackages.php . Repository definitions are per PostgreSQL major version and Linux distribution. You need to choose the one for your Linux distribution, and for PostgreSQL v15 or later. You can install PostgreSQL as following steps: Installation of yum repository definition. Disables the distribution's default PostgreSQL module Installation of PostgreSQL packages. # dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm # dnf -y module disable postgresql # dnf install -y postgresql16-devel postgresql16-server Note On the Red Hat Enterprise Linux, the package name postgresql conflicts to the default one at the distribution, thus, unable to install the packages from PGDG. So, disable the postgresql module by the distribution, using dnf -y module disable postgresql .","title":"PostgreSQL Installation"},{"location":"install/#pg-strom-installation","text":"","title":"PG-Strom Installation"},{"location":"install/#rpm-installation","text":"PG-Strom and related packages are distributed from HeteroDB Software Distribution Center . If you repository definition has been added, not many tasks are needed. We provide individual RPM packages of PG-Strom for each PostgreSQL major version. pg_strom-PG15 package is built for PostgreSQL v15, and pg_strom-PG16 is also built for PostgreSQL v16. It is a restriction due to binary compatibility of extension modules for PostgreSQL. # dnf install -y pg_strom-PG16 That's all for package installation.","title":"RPM Installation"},{"location":"install/#installation-from-the-source","text":"For developers, we also introduces the steps to build and install PG-Strom from the source code.","title":"Installation from the source"},{"location":"install/#getting-the-source-code","text":"Like RPM packages, you can download tarball of the source code from HeteroDB Software Distribution Center . On the other hands, here is a certain time-lags to release the tarball, it may be preferable to checkout the master branch of PG-Strom on GitHub to use the latest development branch. $ git clone https://github.com/heterodb/pg-strom.git Cloning into 'pg-strom'... remote: Counting objects: 13797, done. remote: Compressing objects: 100% (215/215), done. remote: Total 13797 (delta 208), reused 339 (delta 167), pack-reused 13400 Receiving objects: 100% (13797/13797), 11.81 MiB | 1.76 MiB/s, done. Resolving deltas: 100% (10504/10504), done.","title":"Getting the source code"},{"location":"install/#building-the-pg-strom","text":"Configuration to build PG-Strom must match to the target PostgreSQL strictly. For example, if a particular strcut has inconsistent layout by the configuration at build, it may lead problematic bugs; not easy to find out. Thus, not to have inconsistency, PG-Strom does not have own configure script, but references the build configuration of PostgreSQL using pg_config command. If PATH environment variable is set to the pg_config command of the target PostgreSQL, run make and make install . Elsewhere, give PG_CONFIG=... parameter on make command to tell the full path of the pg_config command. $ cd pg-strom/src $ make PG_CONFIG=/usr/pgsql-16/bin/pg_config $ sudo make install PG_CONFIG=/usr/pgsql-16/bin/pg_config","title":"Building the PG-Strom"},{"location":"install/#post-installation-setup","text":"","title":"Post Installation Setup"},{"location":"install/#creation-of-database-cluster","text":"Database cluster is not constructed yet, run initdb command to set up initial database of PostgreSQL. The default path of the database cluster on RPM installation is /var/lib/pgsql//data . If you install postgresql-alternatives package, this default path can be referenced by /var/lib/pgdata regardless of the PostgreSQL version. # su - postgres $ /usr/pgsql-16/bin/initdb -D /var/lib/pgdata/ The files belonging to this database system will be owned by user \"postgres\". This user must also own the server process. The database cluster will be initialized with locale \"en_US.UTF-8\". The default database encoding has accordingly been set to \"UTF8\". The default text search configuration will be set to \"english\". Data page checksums are disabled. fixing permissions on existing directory /var/lib/pgdata ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Tokyo creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling \"trust\" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D /var/lib/pgdata/ -l logfile start","title":"Creation of database cluster"},{"location":"install/#setup-postgresqlconf","text":"Next, edit postgresql.conf which is a configuration file of PostgreSQL. The parameters below should be edited at least to work PG-Strom. Investigate other parameters according to usage of the system and expected workloads. shared_preload_libraries PG-Strom module must be loaded on startup of the postmaster process by the shared_preload_libraries . Unable to load it on demand. Therefore, you must add the configuration below. shared_preload_libraries = '$libdir/pg_strom' max_worker_processes PG-Strom internally uses several background workers, so the default configuration (= 8) is too small for other usage. So, we recommand to expand the variable for a certain margin. max_worker_processes = 100 shared_buffers Although it depends on the workloads, the initial configuration of shared_buffers is too small for the data size where PG-Strom tries to work, thus storage workloads restricts the entire performance, and may be unable to work GPU efficiently. So, we recommend to expand the variable for a certain margin. shared_buffers = 10GB Please consider to apply SSD-to-GPU Direct SQL Execution to process larger than system's physical RAM size. work_mem Although it depends on the workloads, the initial configuration of work_mem is too small to choose the optimal query execution plan on analytic queries. An typical example is, disk-based merge sort may be chosen instead of the in-memory quick-sorting. So, we recommend to expand the variable for a certain margin. work_mem = 1GB","title":"Setup postgresql.conf"},{"location":"install/#expand-os-resource-limits","text":"GPU Direct SQL especially tries to open many files simultaneously, so resource limit for number of file descriptors per process should be expanded. Also, we recommend not to limit core file size to generate core dump of PostgreSQL certainly on system crash. If PostgreSQL service is launched by systemd, you can put the configurations of resource limit at /etc/systemd/system/postgresql-XX.service.d/pg_strom.conf . RPM installation setups the configuration below by the default. It comments out configuration to the environment variable CUDA_ENABLE_COREDUMP_ON_EXCEPTION . This is a developer option that enables to generate GPU's core dump on any CUDA/GPU level errors, if enabled. See CUDA-GDB:GPU core dump support for more details. [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1","title":"Expand OS resource limits"},{"location":"install/#start-postgresql","text":"Start PostgreSQL service. If PG-Strom is set up appropriately, it writes out log message which shows PG-Strom recognized GPU devices. The example below recognized two NVIDIA A100 (PCIE; 40GB), and displays the closest GPU identifier foe each NVME-SSD drive. # systemctl start postgresql-16 # journalctl -u postgresql-16 Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB Extra module loaded [api_version=20240418,cufile=off,nvme_strom=off,githash=3ffc65428c07bb3c9d0e5c75a2973389f91dfcd4] Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: HeteroDB License: { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2024-06-02\", \"expired_at\" : \"2099-12-31\", \"nr_gpus\" : 1, \"gpus\" : [ { \"uuid\" : \"GPU-13943bfd-5b30-38f5-0473-78979c134606\" } ]} Jun 02 17:28:45 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:45.989 JST [20242] LOG: PG-Strom version 5.12.el9 built for PostgreSQL 16 (githash: ) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom binary built for CUDA 12.4 (CUDA runtime 12.5) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] WARNING: The CUDA version where this PG-Strom module binary was built for (12.4) is newer than the CUDA runtime version on this platform (12.5). It may lead unexpected behavior, and upgrade of CUDA toolkit is recommended. Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.114 JST [20242] LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78979c134606) Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:81:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:82:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c2:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c6:00:0] nvme4 (Corsair MP600 CORE) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c3:00:0] nvme5 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c1:00:0] nvme0 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.117 JST [20242] LOG: [0000:c4:00:0] nvme2 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] LOG: redirecting log output to logging collector process Jun 02 17:28:48 buri.heterodb.com postgres[20242]: 2024-06-02 17:28:48.217 JST [20242] HINT: Future log output will appear in directory \"log\". Jun 02 17:28:48 buri.heterodb.com systemd[1]: Started PostgreSQL 16 database server.","title":"Start PostgreSQL"},{"location":"install/#creation-of-pg-strom-extension","text":"At the last, create database objects related to PG-Strom, like SQL functions. This steps are packaged using EXTENSION feature of PostgreSQL. So, all you needs to run is CREATE EXTENSION on the SQL command line. Please note that this step is needed for each new database. If you want PG-Strom is pre-configured on new database creation, you can create PG-Strom extension on the template1 database, its configuration will be copied to the new database on CREATE DATABASE command. $ psql -U postgres psql (16.3) Type \"help\" for help. postgres=# CREATE EXTENSION pg_strom ; CREATE EXTENSION That's all for the installation.","title":"Creation of PG-Strom Extension"},{"location":"install/#postgis-installation","text":"PG-Strom supports execution of a part of PostGIS functions on GPU devices. This section introduces the steps to install PostGIS module. Skip it on your demand. PostGIS module can be installed from the yum repository by PostgreSQL Global Development Group, like PostgreSQL itself. The example below shows the command to install PostGIS v3.4 built for PostgreSQL v16. # dnf install postgis34_16 Start PostgreSQL server after the initial setup of database cluster, then run CREATE EXTENSION command from SQL client to define geometry data type and SQL functions for geoanalytics. postgres=# CREATE EXTENSION postgis; CREATE EXTENSION","title":"PostGIS Installation"},{"location":"operations/","text":"Basic operations Confirmation of GPU off-loading You can use EXPLAIN command to check whether query is executed on GPU device or not. A query is internally split into multiple elements and executed, and PG-Strom is capable to run SCAN, JOIN and GROUP BY in parallel on GPU device. If you can find out GpuScan, GpuJoin or GpuPreAgg was displayed instead of the standard operations by PostgreSQL, it means the query is partially executed on GPU device. Below is an example of EXPLAIN command output. postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 NATURAL JOIN t2 GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=989186.82..989190.94 rows=27 width=20) Group Key: t0.cat -> Sort (cost=989186.82..989187.29 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=989175.89..989179.67 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=14744.40..875804.46 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1833360.36 rows=99996736 width=12) Depth 1: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) Depth 2: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.bid JoinQuals: (t0.bid = t2.bid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) -> Seq Scan on t2 (cost=0.00..1935.00 rows=100000 width=4) (21 rows) You can notice some unusual query execution plans. GpuJoin and GpuPreAgg are implemented on the CustomScan mechanism. In this example, GpuJoin runs JOIN operation on t0 , t1 and t1 , then GpuPreAgg which receives the result of GpuJoin runs GROUP BY operation by the cat column on GPU device. PG-Strom interacts with the query optimizer during PostgreSQL is building a query execution plan, and it offers alternative query execution plan with estimated cost for PostgreSQL's optimizer, if any of SCAN, JOIN, or GROUP BY are executable on GPU device. This estimated cost is better than other query execution plans that run on CPU, it chooses the alternative execution plan that shall run on GPU device. For GPU execution, it requires operators, functions and data types in use must be supported by PG-Strom. It supports numeric types like int or float , date and time types like date or timestamp , variable length string like text and so on. It also supports arithmetic operations, comparison operators and many built-in operators. See References for the detailed list. CPU+GPU Hybrid Parallel PG-Strom also supports PostgreSQL's CPU parallel execution. In the CPU parallel execution mode, Gather node launches several background worker processes, then it gathers the result of \"partial\" execution by individual background workers. CustomScan execution plan provided by PG-Strom, like GpuJoin or GpuPreAgg, support execution at the background workers. They process their partial task using GPU individually. A CPU core usually needs much more time to set up buffer to supply data for GPU than execution of SQL workloads on GPU, so hybrid usage of CPU and GPU parallel can expect higher performance. On the other hands, each process creates CUDA context that is required to communicate GPU and consumes a certain amount of GPU resources, so higher parallelism on CPU-side is not always better. Look at the query execution plan below. Execution plan tree under the Gather is executable on background worker process. It scans t0 table which has 100million rows using four background worker processes and the coordinator process, in other words, 20million rows are handled per process by GpuJoin and GpuPreAgg, then its results are merged at Gather node. # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 GROUP by cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=955705.47..955720.93 rows=27 width=20) Group Key: t0.cat -> Sort (cost=955705.47..955707.36 rows=756 width=44) Sort Key: t0.cat -> Gather (cost=955589.95..955669.33 rows=756 width=44) Workers Planned: 4 -> Parallel Custom Scan (GpuPreAgg) (cost=954589.95..954593.73 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on t0 (cost=27682.82..841218.52 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1083384.84 rows=24999184 width=8) Depth 1: GpuHashJoin (nrows 24999184...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows) Pullup underlying plans (*) This section does not follow the latest version, and need to rewrite according to the latest implementation. PG-Strom can run SCAN, JOIN and GROUP BY workloads on GPU, however, it does not work with best performance if these custom execution plan simply replace the standard operations at PostgreSQL. An example of problematic scenario is that SCAN once writes back its result data set to the host buffer then send the same data into GPU again to execute JOIN. Once again, JOIN results are written back and send to GPU to execute GROUP BY. It causes data ping-pong between CPU and GPU. To avoid such inefficient jobs, PG-Strom has a special mode which pulls up its sub-plan to execute a bunch of jobs in a single GPU kernel invocation. Combination of the operations blow can cause pull-up of sub-plans. SCAN + JOIN SCAN + GROUP BY SCAN + JOIN + GROUP BY The execution plan example below never pulls up the sub-plans. GpuJoin receives the result of GpuScan, then its results are passed to GpuPreAgg to generate the final results. # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=1239991.03..1239995.15 rows=27 width=20) Group Key: t0.cat -> Sort (cost=1239991.03..1239991.50 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=1239980.10..1239983.88 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) -> Custom Scan (GpuJoin) (cost=50776.43..1199522.96 rows=33332245 width=12) GPU Projection: t0.cat, t1.ax Depth 1: GpuHashJoin (nrows 33332245...33332245) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Custom Scan (GpuScan) on t0 (cost=12634.49..1187710.85 rows=33332245 width=8) GPU Projection: cat, aid GPU Filter: (aid < bid) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows) This example causes data ping-pong between GPU and host buffers for each execution stage, so not efficient and less performance. On the other hands, the query execution plan below pulls up sub-plans. # EXPLAIN ANALYZE SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=903669.50..903673.62 rows=27 width=20) (actual time=7761.630..7761.644 rows=27 loops=1) Group Key: t0.cat -> Sort (cost=903669.50..903669.97 rows=189 width=44) (actual time=7761.621..7761.626 rows=27 loops=1) Sort Key: t0.cat Sort Method: quicksort Memory: 28kB -> Custom Scan (GpuPreAgg) (cost=903658.57..903662.35 rows=189 width=44) (actual time=7761.531..7761.540 rows=27 loops=1) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=12483.41..863201.43 rows=33332245 width=12) (never executed) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=12634.49..1187710.85 rows=33332245 width=8) (actual time=59.623..5557.052 rows=100000000 loops=1) Outer Scan Filter: (aid < bid) Rows Removed by Outer Scan Filter: 50002874 Depth 1: GpuHashJoin (plan nrows: 33332245...33332245, actual nrows: 49997126...49997126) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size plan: 10.39MB, exec: 64.00MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (actual time=0.013..15.303 rows=100000 loops=1) Planning time: 0.506 ms Execution time: 8495.391 ms (21 rows) You may notice that SCAN on the table t0 is embedded into GpuJoin, and GpuScan gets vanished. It means GpuJoin pulls up the underlying GpuScan, then combined GPU kernel function is also responsible for evaluation of the supplied WHERE-clause. In addition, here is a strange output in EXPLAIN ANALYZE result - it displays (never executed) for GpuJoin. It means GpuJoin is never executed during the query execution, and it is right. GpuPreAgg pulls up the underlying GpuJoin, then its combined GPU kernel function runs JOIN and GROUP BY. The pg_strom.pullup_outer_scan parameter controls whether SCAN is pulled up, and the pg_strom.pullup_outer_join parameter also controls whether JOIN is pulled up. Both parameters are configured to on . Usually, no need to disable them, however, you can use the parameters to identify the problems on system troubles. Inner Pinned Buffer of GpuJoin Look at the EXPLAIN output below. When PG-Strom joins tables, it usually reads the largest table ( lineorder in this case; called the OUTER table) asynchronously, while performing join processing and aggregation processing with other tables. Let's proceed. Due to the constraints of the JOIN algorithm, it is necessary to read other tables ( date1 , part , supplier in this case; called the INNER tables) into memory in advance, and also calculate the hash value of the JOIN key. Although these tables are not as large as the OUTER table, preparing an INNER buffer that exceeds several GB is a heavy process. GpuJoin usually reads the INNER table through the PostgreSQL API row-by-row, calculates its hash value, and writes them to the INNER buffer on the host shared memory. The GPU-Service process transfers this INNER buffer onto the GPU device memory, then we can start reading the OUTER table and processing the JOIN with inner tables. If the INNER table is relatively large and contains search conditions that are executable on the GPU, GpuScan may exists under GpuJoin, as in the EXPLAIN output below. In this case, the INNER table is once processed on the GPU by GpuScan, the execution results are returned to the CPU, and then written to the INNER buffer before it is loaded onto the GPU again. It looks like there is quite a bit of wasted data flow. =# explain select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_brand1 between 'MFGR#2221' and 'MFGR#2228' and s_region = 'ASIA' group by d_year, p_brand1; QUERY PLAN --------------------------------------------------------------------------------------------------------------- GroupAggregate (cost=31007186.70..31023043.21 rows=6482 width=46) Group Key: date1.d_year, part.p_brand1 -> Sort (cost=31007186.70..31011130.57 rows=1577548 width=20) Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuJoin) on lineorder (cost=275086.19..30844784.03 rows=1577548 width=20) GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue GPU Join Quals [1]: (part.p_partkey = lineorder.lo_partkey) ... [nrows: 5994236000 -> 7804495] GPU Outer Hash [1]: lineorder.lo_partkey GPU Inner Hash [1]: part.p_partkey GPU Join Quals [2]: (supplier.s_suppkey = lineorder.lo_suppkey) ... [nrows: 7804495 -> 1577548] GPU Outer Hash [2]: lineorder.lo_suppkey GPU Inner Hash [2]: supplier.s_suppkey GPU Join Quals [3]: (date1.d_datekey = lineorder.lo_orderdate) ... [nrows: 1577548 -> 1577548] GPU Outer Hash [3]: lineorder.lo_orderdate GPU Inner Hash [3]: date1.d_datekey GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on part (cost=0.00..59258.00 rows=2604 width=14) Filter: ((p_brand1 >= 'MFGR#2221'::bpchar) AND (p_brand1 <= 'MFGR#2228'::bpchar)) -> Custom Scan (GpuScan) on supplier (cost=100.00..190348.83 rows=2019384 width=6) GPU Projection: s_suppkey GPU Pinned Buffer: enabled GPU Scan Quals: (s_region = 'ASIA'::bpchar) [rows: 9990357 -> 2019384] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=8) (24 rows) In this way, if data ping-pong occurs between the CPU and GPU when reading the INNER table or building the INNER buffer, you can configure GPUJoin to use Pinned Inner Buffer . It is possible to shorten the execution start lead time and reduce memory usage. In the above EXPLAIN output, reading of the supplier table will be performed by GpuScan, and according to the statistical information, it is estimated that about 2 million rows will be read from the table. Meanwhile, notice the output of GPU Pinned Buffer: enabled . This is a function that if the estimated size of the INNER table exceeds the configuration value of pg_strom.pinned_inner_buffer_threshold , the processing result of GpuScan is retained in the GPU memory and used as part of the INNER buffer at the next GpuJoin. (If necessary, hash value calculation is also performed on the GPU). Therefore, after the contents of the supplier table are read from storage to the GPU using GPU-Direct SQL, they can be used in the next GPUJoin without being returned to the CPU or loaded to the GPU again. It will be. However, there are some tradeoffs to using Pinned Inner Buffer, so it is disabled by default. When using this feature, you must explicitly set the pg_strom.pinned_inner_buffer_threshold parameter. The CPU side does not completely retain the contents of the INNER buffer when Pinned Inner Buffer is in use. Therefore, CPU fallback processing cannot be performed and an error will be raised. Also, RIGHT/FULL OUTER JOIN, which is implemented using CPU Fallback, cannot coexist with Pinned Inner Buffer for the same reason. Knowledge base We publish several articles, just called \"notes\", on the project wiki-site of PG-Strom. https://github.com/heterodb/pg-strom/wiki","title":"Basic Operations"},{"location":"operations/#basic-operations","text":"","title":"Basic operations"},{"location":"operations/#confirmation-of-gpu-off-loading","text":"You can use EXPLAIN command to check whether query is executed on GPU device or not. A query is internally split into multiple elements and executed, and PG-Strom is capable to run SCAN, JOIN and GROUP BY in parallel on GPU device. If you can find out GpuScan, GpuJoin or GpuPreAgg was displayed instead of the standard operations by PostgreSQL, it means the query is partially executed on GPU device. Below is an example of EXPLAIN command output. postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 NATURAL JOIN t2 GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=989186.82..989190.94 rows=27 width=20) Group Key: t0.cat -> Sort (cost=989186.82..989187.29 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=989175.89..989179.67 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=14744.40..875804.46 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1833360.36 rows=99996736 width=12) Depth 1: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) Depth 2: GpuHashJoin (nrows 99996736...99996736) HashKeys: t0.bid JoinQuals: (t0.bid = t2.bid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) -> Seq Scan on t2 (cost=0.00..1935.00 rows=100000 width=4) (21 rows) You can notice some unusual query execution plans. GpuJoin and GpuPreAgg are implemented on the CustomScan mechanism. In this example, GpuJoin runs JOIN operation on t0 , t1 and t1 , then GpuPreAgg which receives the result of GpuJoin runs GROUP BY operation by the cat column on GPU device. PG-Strom interacts with the query optimizer during PostgreSQL is building a query execution plan, and it offers alternative query execution plan with estimated cost for PostgreSQL's optimizer, if any of SCAN, JOIN, or GROUP BY are executable on GPU device. This estimated cost is better than other query execution plans that run on CPU, it chooses the alternative execution plan that shall run on GPU device. For GPU execution, it requires operators, functions and data types in use must be supported by PG-Strom. It supports numeric types like int or float , date and time types like date or timestamp , variable length string like text and so on. It also supports arithmetic operations, comparison operators and many built-in operators. See References for the detailed list.","title":"Confirmation of GPU off-loading"},{"location":"operations/#cpugpu-hybrid-parallel","text":"PG-Strom also supports PostgreSQL's CPU parallel execution. In the CPU parallel execution mode, Gather node launches several background worker processes, then it gathers the result of \"partial\" execution by individual background workers. CustomScan execution plan provided by PG-Strom, like GpuJoin or GpuPreAgg, support execution at the background workers. They process their partial task using GPU individually. A CPU core usually needs much more time to set up buffer to supply data for GPU than execution of SQL workloads on GPU, so hybrid usage of CPU and GPU parallel can expect higher performance. On the other hands, each process creates CUDA context that is required to communicate GPU and consumes a certain amount of GPU resources, so higher parallelism on CPU-side is not always better. Look at the query execution plan below. Execution plan tree under the Gather is executable on background worker process. It scans t0 table which has 100million rows using four background worker processes and the coordinator process, in other words, 20million rows are handled per process by GpuJoin and GpuPreAgg, then its results are merged at Gather node. # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 GROUP by cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=955705.47..955720.93 rows=27 width=20) Group Key: t0.cat -> Sort (cost=955705.47..955707.36 rows=756 width=44) Sort Key: t0.cat -> Gather (cost=955589.95..955669.33 rows=756 width=44) Workers Planned: 4 -> Parallel Custom Scan (GpuPreAgg) (cost=954589.95..954593.73 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on t0 (cost=27682.82..841218.52 rows=99996736 width=12) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=0.00..1083384.84 rows=24999184 width=8) Depth 1: GpuHashJoin (nrows 24999184...99996736) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows)","title":"CPU+GPU Hybrid Parallel"},{"location":"operations/#pullup-underlying-plans","text":"(*) This section does not follow the latest version, and need to rewrite according to the latest implementation. PG-Strom can run SCAN, JOIN and GROUP BY workloads on GPU, however, it does not work with best performance if these custom execution plan simply replace the standard operations at PostgreSQL. An example of problematic scenario is that SCAN once writes back its result data set to the host buffer then send the same data into GPU again to execute JOIN. Once again, JOIN results are written back and send to GPU to execute GROUP BY. It causes data ping-pong between CPU and GPU. To avoid such inefficient jobs, PG-Strom has a special mode which pulls up its sub-plan to execute a bunch of jobs in a single GPU kernel invocation. Combination of the operations blow can cause pull-up of sub-plans. SCAN + JOIN SCAN + GROUP BY SCAN + JOIN + GROUP BY The execution plan example below never pulls up the sub-plans. GpuJoin receives the result of GpuScan, then its results are passed to GpuPreAgg to generate the final results. # EXPLAIN SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=1239991.03..1239995.15 rows=27 width=20) Group Key: t0.cat -> Sort (cost=1239991.03..1239991.50 rows=189 width=44) Sort Key: t0.cat -> Custom Scan (GpuPreAgg) (cost=1239980.10..1239983.88 rows=189 width=44) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) -> Custom Scan (GpuJoin) (cost=50776.43..1199522.96 rows=33332245 width=12) GPU Projection: t0.cat, t1.ax Depth 1: GpuHashJoin (nrows 33332245...33332245) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size: 10.39MB) -> Custom Scan (GpuScan) on t0 (cost=12634.49..1187710.85 rows=33332245 width=8) GPU Projection: cat, aid GPU Filter: (aid < bid) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (18 rows) This example causes data ping-pong between GPU and host buffers for each execution stage, so not efficient and less performance. On the other hands, the query execution plan below pulls up sub-plans. # EXPLAIN ANALYZE SELECT cat,count(*),avg(ax) FROM t0 NATURAL JOIN t1 WHERE aid < bid GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- GroupAggregate (cost=903669.50..903673.62 rows=27 width=20) (actual time=7761.630..7761.644 rows=27 loops=1) Group Key: t0.cat -> Sort (cost=903669.50..903669.97 rows=189 width=44) (actual time=7761.621..7761.626 rows=27 loops=1) Sort Key: t0.cat Sort Method: quicksort Memory: 28kB -> Custom Scan (GpuPreAgg) (cost=903658.57..903662.35 rows=189 width=44) (actual time=7761.531..7761.540 rows=27 loops=1) Reduction: Local GPU Projection: cat, pgstrom.nrows(), pgstrom.nrows((ax IS NOT NULL)), pgstrom.psum(ax) Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on t0 (cost=12483.41..863201.43 rows=33332245 width=12) (never executed) GPU Projection: t0.cat, t1.ax Outer Scan: t0 (cost=12634.49..1187710.85 rows=33332245 width=8) (actual time=59.623..5557.052 rows=100000000 loops=1) Outer Scan Filter: (aid < bid) Rows Removed by Outer Scan Filter: 50002874 Depth 1: GpuHashJoin (plan nrows: 33332245...33332245, actual nrows: 49997126...49997126) HashKeys: t0.aid JoinQuals: (t0.aid = t1.aid) KDS-Hash (size plan: 10.39MB, exec: 64.00MB) -> Seq Scan on t1 (cost=0.00..1972.85 rows=103785 width=12) (actual time=0.013..15.303 rows=100000 loops=1) Planning time: 0.506 ms Execution time: 8495.391 ms (21 rows) You may notice that SCAN on the table t0 is embedded into GpuJoin, and GpuScan gets vanished. It means GpuJoin pulls up the underlying GpuScan, then combined GPU kernel function is also responsible for evaluation of the supplied WHERE-clause. In addition, here is a strange output in EXPLAIN ANALYZE result - it displays (never executed) for GpuJoin. It means GpuJoin is never executed during the query execution, and it is right. GpuPreAgg pulls up the underlying GpuJoin, then its combined GPU kernel function runs JOIN and GROUP BY. The pg_strom.pullup_outer_scan parameter controls whether SCAN is pulled up, and the pg_strom.pullup_outer_join parameter also controls whether JOIN is pulled up. Both parameters are configured to on . Usually, no need to disable them, however, you can use the parameters to identify the problems on system troubles.","title":"Pullup underlying plans"},{"location":"operations/#inner-pinned-buffer-of-gpujoin","text":"Look at the EXPLAIN output below. When PG-Strom joins tables, it usually reads the largest table ( lineorder in this case; called the OUTER table) asynchronously, while performing join processing and aggregation processing with other tables. Let's proceed. Due to the constraints of the JOIN algorithm, it is necessary to read other tables ( date1 , part , supplier in this case; called the INNER tables) into memory in advance, and also calculate the hash value of the JOIN key. Although these tables are not as large as the OUTER table, preparing an INNER buffer that exceeds several GB is a heavy process. GpuJoin usually reads the INNER table through the PostgreSQL API row-by-row, calculates its hash value, and writes them to the INNER buffer on the host shared memory. The GPU-Service process transfers this INNER buffer onto the GPU device memory, then we can start reading the OUTER table and processing the JOIN with inner tables. If the INNER table is relatively large and contains search conditions that are executable on the GPU, GpuScan may exists under GpuJoin, as in the EXPLAIN output below. In this case, the INNER table is once processed on the GPU by GpuScan, the execution results are returned to the CPU, and then written to the INNER buffer before it is loaded onto the GPU again. It looks like there is quite a bit of wasted data flow. =# explain select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_brand1 between 'MFGR#2221' and 'MFGR#2228' and s_region = 'ASIA' group by d_year, p_brand1; QUERY PLAN --------------------------------------------------------------------------------------------------------------- GroupAggregate (cost=31007186.70..31023043.21 rows=6482 width=46) Group Key: date1.d_year, part.p_brand1 -> Sort (cost=31007186.70..31011130.57 rows=1577548 width=20) Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuJoin) on lineorder (cost=275086.19..30844784.03 rows=1577548 width=20) GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue GPU Join Quals [1]: (part.p_partkey = lineorder.lo_partkey) ... [nrows: 5994236000 -> 7804495] GPU Outer Hash [1]: lineorder.lo_partkey GPU Inner Hash [1]: part.p_partkey GPU Join Quals [2]: (supplier.s_suppkey = lineorder.lo_suppkey) ... [nrows: 7804495 -> 1577548] GPU Outer Hash [2]: lineorder.lo_suppkey GPU Inner Hash [2]: supplier.s_suppkey GPU Join Quals [3]: (date1.d_datekey = lineorder.lo_orderdate) ... [nrows: 1577548 -> 1577548] GPU Outer Hash [3]: lineorder.lo_orderdate GPU Inner Hash [3]: date1.d_datekey GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on part (cost=0.00..59258.00 rows=2604 width=14) Filter: ((p_brand1 >= 'MFGR#2221'::bpchar) AND (p_brand1 <= 'MFGR#2228'::bpchar)) -> Custom Scan (GpuScan) on supplier (cost=100.00..190348.83 rows=2019384 width=6) GPU Projection: s_suppkey GPU Pinned Buffer: enabled GPU Scan Quals: (s_region = 'ASIA'::bpchar) [rows: 9990357 -> 2019384] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 (cost=0.00..72.56 rows=2556 width=8) (24 rows) In this way, if data ping-pong occurs between the CPU and GPU when reading the INNER table or building the INNER buffer, you can configure GPUJoin to use Pinned Inner Buffer . It is possible to shorten the execution start lead time and reduce memory usage. In the above EXPLAIN output, reading of the supplier table will be performed by GpuScan, and according to the statistical information, it is estimated that about 2 million rows will be read from the table. Meanwhile, notice the output of GPU Pinned Buffer: enabled . This is a function that if the estimated size of the INNER table exceeds the configuration value of pg_strom.pinned_inner_buffer_threshold , the processing result of GpuScan is retained in the GPU memory and used as part of the INNER buffer at the next GpuJoin. (If necessary, hash value calculation is also performed on the GPU). Therefore, after the contents of the supplier table are read from storage to the GPU using GPU-Direct SQL, they can be used in the next GPUJoin without being returned to the CPU or loaded to the GPU again. It will be. However, there are some tradeoffs to using Pinned Inner Buffer, so it is disabled by default. When using this feature, you must explicitly set the pg_strom.pinned_inner_buffer_threshold parameter. The CPU side does not completely retain the contents of the INNER buffer when Pinned Inner Buffer is in use. Therefore, CPU fallback processing cannot be performed and an error will be raised. Also, RIGHT/FULL OUTER JOIN, which is implemented using CPU Fallback, cannot coexist with Pinned Inner Buffer for the same reason.","title":"Inner Pinned Buffer of GpuJoin"},{"location":"operations/#knowledge-base","text":"We publish several articles, just called \"notes\", on the project wiki-site of PG-Strom. https://github.com/heterodb/pg-strom/wiki","title":"Knowledge base"},{"location":"partition/","text":"Partitioning This chapter introduces the way to use PG-Strom and the partitioning feature of PostgreSQL. Note that this chapter is only valid when PG-Strom works on PostgreSQL v11 or later . Also see PostgreSQL Document: Table Partitioning for more details of the partitioning feature of PostgreSQL. Overview PostgreSQL v10 newly support table partitioning. This mechanism splits one logically large table into physically small pieces. It is valuable because it can skip partitioned child tables which is obviously unnecessary to scan from the search qualification, and it can offer broader I/O bandwidth by physically distributed storage and so on. PostgreSQL v10 supports two kinds of them: range-partitioning and list-partitioning. Then, PostgreSQL v11 newly supports hash-partitioning and partition-wise JOINs. The diagram below shows a range-partitioning configuration with date -type key values. A record which has 2018-05-30 as key is distributed to the partition child table tbl_2018 , in the same way, a record which has 2014-03-21 is distributed to the partition child table tbl_2014 , and so on. In case when scan qualifier WHERE ymd > '2016-07-01'::date is added on scan of the partitioned table for example, it is obvious that tbl_2014 and tbl_2015 contains no records to match, therefore, PostgreSQL' optimizer constructs query execution plan which runs on only tbl_2016 , tbl_2017 and tbl_2018 then merges their results by Append node. It shall perform as if records are read from one logical table. When PG-Strom is used with table partitioning of PostgreSQL together, its optimizer may choose GpuScan to scan the individual partition child tables to be scanned, in the result of cost estimation. In this case, Append node merges the results of GpuScan . On the other hands, if query runs JOIN or GROUP BY, which can be accelerated by PG-Strom, next to the scan on partitioned table, it needs consideration from the standpoint of performance optimization. For example, in case when query scans non-partitioned table then runs JOIN with other tables and GROUP BY, under some conditions, it can handle step-step data exchange on GPU device memory. It is an optimal workload for PG-Strom due to minimized data exchange between GPU and CPU. In case when query runs corresponding workload on the partitioned table, it is problematic that Append node is injected into between the child tables scan and JOIN/GROUP BY. Under the query execution plan, the result of GpuScan must be written back to the host system, then Append merges them and send back the data to GPU to run the following GpuJoin and GpuPreAgg. It is never efficient query execution. The example below shows a query execution plan to the query which includes JOIN and GROUP BY towards the partitioned table pt by the key field ymd of date type; per year distribution. Due to the scan qualification, it omits scan on the partition child tables for 2016 or prior, in addition, a combined JOIN and GROUP BY on the pt_2017 , pt_2018 and pt_2019 shall be executed prior to the Append . # EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- HashAggregate (cost=196410.07..196412.57 rows=200 width=48) Group Key: pt_2017.cat -> Gather (cost=66085.69..196389.07 rows=1200 width=72) Workers Planned: 2 -> Parallel Append (cost=65085.69..195269.07 rows=600 width=72) -> Parallel Custom Scan (GpuPreAgg) (cost=65085.69..65089.69 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2017 (cost=32296.64..74474.20 rows=1050772 width=40) Outer Scan: pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050772...2521854) HashKeys: pt_2017.aid JoinQuals: (pt_2017.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65078.35..65082.35 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2018 (cost=32296.65..74465.75 rows=1050649 width=40) Outer Scan: pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050649...2521557) HashKeys: pt_2018.aid JoinQuals: (pt_2018.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65093.03..65097.03 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2019 (cost=32296.65..74482.64 rows=1050896 width=40) Outer Scan: pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050896...2522151) HashKeys: pt_2019.aid JoinQuals: (pt_2019.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (38 rows) Configuration and Operation By the GUC parameters below, PG-Strom enables/disables the push-down of JOIN/GROUP BY under the partition child tables. Parameter Type Default Description pg_strom.enable_partitionwise_gpujoin bool on Enables/disables whether GpuJoin is pushed down to the partition children. Available only PostgreSQL v10 or later. pg_strom.enable_partitionwise_gpupreagg bool on Enables/disables whether GpuPreAgg is pushed down to the partition children. Available only PostgreSQL v10 or later. Default of the parameters are on . Once set to off , push-down is disabled. The query execution plan is changed as follows, by EXPLAIN command for the query above section. It uses GpuScan to scan the partition child tables, however, their results are once written back to the host system, then merged by Append and moved to GPU again to process GpuJoin . postgres=# set pg_strom.enable_partitionwise_gpujoin = off; SET postgres=# set pg_strom.enable_partitionwise_gpupreagg = off; SET postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date group by cat; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate (cost=341392.92..341399.42 rows=200 width=48) Group Key: pt.cat -> Sort (cost=341392.92..341393.92 rows=400 width=72) Sort Key: pt.cat -> Gather (cost=341333.63..341375.63 rows=400 width=72) Workers Planned: 2 -> Partial HashAggregate (cost=340333.63..340335.63 rows=200 width=72) Group Key: pt.cat -> Parallel Custom Scan (GpuJoin) (cost=283591.92..283591.92 rows=7565562 width=40) Depth 1: GpuHashJoin (nrows 3152318...7565562) HashKeys: pt.aid JoinQuals: (pt.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Append (cost=28540.80..200673.34 rows=3152318 width=36) -> Parallel Custom Scan (GpuScan) on pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (21 rows) Consideration for SSD/GPU location Limitations Experimental Feature It is an experimental feature to push down GpuJoin and GpuPreAgg to the partitioned child tables, so it may lead unexpected behavior or system crash. In such case, disable the feature using pg_strom.enable_partitionwise_gpujoin or pg_strom.enable_partitionwise_gpupreagg . And report your case to PG-Strom Issues .","title":"Partitioning"},{"location":"partition/#partitioning","text":"This chapter introduces the way to use PG-Strom and the partitioning feature of PostgreSQL. Note that this chapter is only valid when PG-Strom works on PostgreSQL v11 or later . Also see PostgreSQL Document: Table Partitioning for more details of the partitioning feature of PostgreSQL.","title":"Partitioning"},{"location":"partition/#overview","text":"PostgreSQL v10 newly support table partitioning. This mechanism splits one logically large table into physically small pieces. It is valuable because it can skip partitioned child tables which is obviously unnecessary to scan from the search qualification, and it can offer broader I/O bandwidth by physically distributed storage and so on. PostgreSQL v10 supports two kinds of them: range-partitioning and list-partitioning. Then, PostgreSQL v11 newly supports hash-partitioning and partition-wise JOINs. The diagram below shows a range-partitioning configuration with date -type key values. A record which has 2018-05-30 as key is distributed to the partition child table tbl_2018 , in the same way, a record which has 2014-03-21 is distributed to the partition child table tbl_2014 , and so on. In case when scan qualifier WHERE ymd > '2016-07-01'::date is added on scan of the partitioned table for example, it is obvious that tbl_2014 and tbl_2015 contains no records to match, therefore, PostgreSQL' optimizer constructs query execution plan which runs on only tbl_2016 , tbl_2017 and tbl_2018 then merges their results by Append node. It shall perform as if records are read from one logical table. When PG-Strom is used with table partitioning of PostgreSQL together, its optimizer may choose GpuScan to scan the individual partition child tables to be scanned, in the result of cost estimation. In this case, Append node merges the results of GpuScan . On the other hands, if query runs JOIN or GROUP BY, which can be accelerated by PG-Strom, next to the scan on partitioned table, it needs consideration from the standpoint of performance optimization. For example, in case when query scans non-partitioned table then runs JOIN with other tables and GROUP BY, under some conditions, it can handle step-step data exchange on GPU device memory. It is an optimal workload for PG-Strom due to minimized data exchange between GPU and CPU. In case when query runs corresponding workload on the partitioned table, it is problematic that Append node is injected into between the child tables scan and JOIN/GROUP BY. Under the query execution plan, the result of GpuScan must be written back to the host system, then Append merges them and send back the data to GPU to run the following GpuJoin and GpuPreAgg. It is never efficient query execution. The example below shows a query execution plan to the query which includes JOIN and GROUP BY towards the partitioned table pt by the key field ymd of date type; per year distribution. Due to the scan qualification, it omits scan on the partition child tables for 2016 or prior, in addition, a combined JOIN and GROUP BY on the pt_2017 , pt_2018 and pt_2019 shall be executed prior to the Append . # EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date GROUP BY cat; QUERY PLAN -------------------------------------------------------------------------------- HashAggregate (cost=196410.07..196412.57 rows=200 width=48) Group Key: pt_2017.cat -> Gather (cost=66085.69..196389.07 rows=1200 width=72) Workers Planned: 2 -> Parallel Append (cost=65085.69..195269.07 rows=600 width=72) -> Parallel Custom Scan (GpuPreAgg) (cost=65085.69..65089.69 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2017 (cost=32296.64..74474.20 rows=1050772 width=40) Outer Scan: pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050772...2521854) HashKeys: pt_2017.aid JoinQuals: (pt_2017.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65078.35..65082.35 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2018 (cost=32296.65..74465.75 rows=1050649 width=40) Outer Scan: pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050649...2521557) HashKeys: pt_2018.aid JoinQuals: (pt_2018.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) -> Parallel Custom Scan (GpuPreAgg) (cost=65093.03..65097.03 rows=200 width=72) Reduction: Local Combined GpuJoin: enabled -> Parallel Custom Scan (GpuJoin) on pt_2019 (cost=32296.65..74482.64 rows=1050896 width=40) Outer Scan: pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) Outer Scan Filter: (ymd > '2017-01-01'::date) Depth 1: GpuHashJoin (nrows 1050896...2522151) HashKeys: pt_2019.aid JoinQuals: (pt_2019.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (38 rows)","title":"Overview"},{"location":"partition/#configuration-and-operation","text":"By the GUC parameters below, PG-Strom enables/disables the push-down of JOIN/GROUP BY under the partition child tables. Parameter Type Default Description pg_strom.enable_partitionwise_gpujoin bool on Enables/disables whether GpuJoin is pushed down to the partition children. Available only PostgreSQL v10 or later. pg_strom.enable_partitionwise_gpupreagg bool on Enables/disables whether GpuPreAgg is pushed down to the partition children. Available only PostgreSQL v10 or later. Default of the parameters are on . Once set to off , push-down is disabled. The query execution plan is changed as follows, by EXPLAIN command for the query above section. It uses GpuScan to scan the partition child tables, however, their results are once written back to the host system, then merged by Append and moved to GPU again to process GpuJoin . postgres=# set pg_strom.enable_partitionwise_gpujoin = off; SET postgres=# set pg_strom.enable_partitionwise_gpupreagg = off; SET postgres=# EXPLAIN SELECT cat,count(*),avg(ax) FROM pt NATURAL JOIN t1 WHERE ymd > '2017-01-01'::date group by cat; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate (cost=341392.92..341399.42 rows=200 width=48) Group Key: pt.cat -> Sort (cost=341392.92..341393.92 rows=400 width=72) Sort Key: pt.cat -> Gather (cost=341333.63..341375.63 rows=400 width=72) Workers Planned: 2 -> Partial HashAggregate (cost=340333.63..340335.63 rows=200 width=72) Group Key: pt.cat -> Parallel Custom Scan (GpuJoin) (cost=283591.92..283591.92 rows=7565562 width=40) Depth 1: GpuHashJoin (nrows 3152318...7565562) HashKeys: pt.aid JoinQuals: (pt.aid = t1.aid) KDS-Hash (size: 10.78MB) -> Append (cost=28540.80..200673.34 rows=3152318 width=36) -> Parallel Custom Scan (GpuScan) on pt_2017 (cost=28540.80..66891.11 rows=1050772 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2018 (cost=28540.81..66883.43 rows=1050649 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Parallel Custom Scan (GpuScan) on pt_2019 (cost=28540.80..66898.79 rows=1050896 width=36) GPU Filter: (ymd > '2017-01-01'::date) -> Seq Scan on t1 (cost=0.00..1935.00 rows=100000 width=12) (21 rows)","title":"Configuration and Operation"},{"location":"partition/#consideration-for-ssdgpu-location","text":"","title":"Consideration for SSD/GPU location"},{"location":"partition/#limitations","text":"Experimental Feature It is an experimental feature to push down GpuJoin and GpuPreAgg to the partitioned child tables, so it may lead unexpected behavior or system crash. In such case, disable the feature using pg_strom.enable_partitionwise_gpujoin or pg_strom.enable_partitionwise_gpupreagg . And report your case to PG-Strom Issues .","title":"Limitations"},{"location":"postgis/","text":"GPU-PostGIS This chapter describes GPU-PostGIS Overview PostGIS is an extension to PostgreSQL to utilize geographic information. PostGIS provides data type ( Geometry ) for handling geographic data such as points, lines, and polygons, as well as a large number of functions and operators for evaluating geographic data elements, such as distance calculation, inclusion, and intersection determination. In addition, some of the operators can search faster by the R-Tree using GiST(Generalized Search Tree) mechanism included in PostgreSQL. Since the first version was released in 2001, it has been enhanced and maintained by the developer community for over 20 years. These functions and operators provided by PostGIS are very large, over 500 in total. For this reason, PG-Strom has ported only a few relatively frequently used PostGIS functions to the GPU. For example: geometry st_point(float8 lon,float8 lat) returns a point with the given longitude and latitude as a Point of Geometry type. bool st_contains(geometry a,geometry b) determines if the geometry a contains the geometry b or not. bool st_crosses(geometry,geometry) determines if the geometries intersect each other. text st_relate(geometry,geometry) returns the relationship between geometries as a matrix representation of DE-9IM(Dimensionally Extended 9-Intersection Model) . PostGIS Usage You can use GPU-PostGIS without any configurations. PG-Strom will automatically determine if the PostGIS functions used in the query are executable on the GPU when PostGIS is installed from the package or the source code and the geometry data types and PostGIS functions are defined using the CREATE EXTENSION syntax. Please refer to the PostGIS documentaion for installation. For example, the following query uses the GPU-executable PostGIS funtion st_contains() and st_makepoint() to determine if a two-dimensional point read from the table is contained within the range of the geometry type constant 'polygon ((10 10,30 10,30 20,10 20,10 10))' . As you can see from the fact that these functions are listed as part of the \"GPU Filter:\", PG-Strom will automatically detect supported PostGIS functions and attempt to run them on the GPU as much as possible. =# explain select * from dpoints where st_contains('polygon ((10 10,30 10,30 20,10 20,10 10))', st_makepoint(x,y)); QUERY PLAN ------------------------------------------------------------------------------------------ Custom Scan (GpuScan) on dpoints (cost=1397205.10..12627630.76 rows=800 width=28) GPU Filter: st_contains('01030000000100000005000000000000000000244000000000000024400000000000003E4000000000000024400000000000003E4000000000000034400000000000002440000000000000344000000000000024400000000000002440'::geometry, st_makepoint(x, y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) (3 rows) GiST Index Some of the PostGIS functions that evaluate relationships between geometries, such as st_contains() and st_crosses() , support the GiST index (R-Tree), which enables fast refinement of the search using only the CPU. GpuJoin in PG-Strom sometimes transfers not only the contents of the table but also GiST index (R-Tree) to filter the rows to be joined fast when the join condition between tables can be accelerated. This process is usually executed at a much higher parallelism level than the CPU, so a significant speedup can be expected. On the other hand, GpuScan does not use GiST index to scan a single table. This is because IndexScan filtering by CPU is often faster. The following is an example of a SQL statement to create a GiST index on city boundary data (\"geom\" column of \"giscity\" table). =# CREATE INDEX on giscity USING gist (geom); CREATE INDEX The following is an execution plan of SQL that joins municipal boundary data (\"giscity\" table) and latitude and longitude data (\"dpoints\" table) and outputs the number of latitude and longitude data (points) contained in the area expressed as polygons for each municipality. The optimizer selects GpuJoin, and GpuGiSTJoin to join \"giscity\" table with \"dpoints\" table. The \"IndexFilter:\" line shows that the filtering condition on the GiST index is (g.geom ~ st_makepoint(d.x, d.y)) and the index giscity_geom_idx will be used. The execution of PostGIS functions is a relatively \"heavy\" process even for GPU. By using GiST index, we can eliminate combinations that obviously do not match the condition and speed up the search process significantly. =# EXPLAIN SELECT pref, city, count(*) FROM giscity g, dpoints d WHERE pref = 'Tokyo' AND st_contains(g.geom,st_makepoint(d.x, d.y)) GROUP BY pref, city; QUERY PLAN ----------------------------------------------------------------------------------------------------------- GroupAggregate (cost=5700646.35..5700759.39 rows=5024 width=29) Group Key: g.n03_001, g.n03_004 -> Sort (cost=5700646.35..5700658.91 rows=5024 width=29) Sort Key: g.n03_004 -> Custom Scan (GpuPreAgg) (cost=5700274.71..5700337.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=638671.58..5668511.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (17 rows)","title":"PostGIS"},{"location":"postgis/#gpu-postgis","text":"This chapter describes GPU-PostGIS","title":"GPU-PostGIS"},{"location":"postgis/#overview","text":"PostGIS is an extension to PostgreSQL to utilize geographic information. PostGIS provides data type ( Geometry ) for handling geographic data such as points, lines, and polygons, as well as a large number of functions and operators for evaluating geographic data elements, such as distance calculation, inclusion, and intersection determination. In addition, some of the operators can search faster by the R-Tree using GiST(Generalized Search Tree) mechanism included in PostgreSQL. Since the first version was released in 2001, it has been enhanced and maintained by the developer community for over 20 years. These functions and operators provided by PostGIS are very large, over 500 in total. For this reason, PG-Strom has ported only a few relatively frequently used PostGIS functions to the GPU. For example: geometry st_point(float8 lon,float8 lat) returns a point with the given longitude and latitude as a Point of Geometry type. bool st_contains(geometry a,geometry b) determines if the geometry a contains the geometry b or not. bool st_crosses(geometry,geometry) determines if the geometries intersect each other. text st_relate(geometry,geometry) returns the relationship between geometries as a matrix representation of DE-9IM(Dimensionally Extended 9-Intersection Model) .","title":"Overview"},{"location":"postgis/#postgis-usage","text":"You can use GPU-PostGIS without any configurations. PG-Strom will automatically determine if the PostGIS functions used in the query are executable on the GPU when PostGIS is installed from the package or the source code and the geometry data types and PostGIS functions are defined using the CREATE EXTENSION syntax. Please refer to the PostGIS documentaion for installation. For example, the following query uses the GPU-executable PostGIS funtion st_contains() and st_makepoint() to determine if a two-dimensional point read from the table is contained within the range of the geometry type constant 'polygon ((10 10,30 10,30 20,10 20,10 10))' . As you can see from the fact that these functions are listed as part of the \"GPU Filter:\", PG-Strom will automatically detect supported PostGIS functions and attempt to run them on the GPU as much as possible. =# explain select * from dpoints where st_contains('polygon ((10 10,30 10,30 20,10 20,10 10))', st_makepoint(x,y)); QUERY PLAN ------------------------------------------------------------------------------------------ Custom Scan (GpuScan) on dpoints (cost=1397205.10..12627630.76 rows=800 width=28) GPU Filter: st_contains('01030000000100000005000000000000000000244000000000000024400000000000003E4000000000000024400000000000003E4000000000000034400000000000002440000000000000344000000000000024400000000000002440'::geometry, st_makepoint(x, y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) (3 rows)","title":"PostGIS Usage"},{"location":"postgis/#gist-index","text":"Some of the PostGIS functions that evaluate relationships between geometries, such as st_contains() and st_crosses() , support the GiST index (R-Tree), which enables fast refinement of the search using only the CPU. GpuJoin in PG-Strom sometimes transfers not only the contents of the table but also GiST index (R-Tree) to filter the rows to be joined fast when the join condition between tables can be accelerated. This process is usually executed at a much higher parallelism level than the CPU, so a significant speedup can be expected. On the other hand, GpuScan does not use GiST index to scan a single table. This is because IndexScan filtering by CPU is often faster. The following is an example of a SQL statement to create a GiST index on city boundary data (\"geom\" column of \"giscity\" table). =# CREATE INDEX on giscity USING gist (geom); CREATE INDEX The following is an execution plan of SQL that joins municipal boundary data (\"giscity\" table) and latitude and longitude data (\"dpoints\" table) and outputs the number of latitude and longitude data (points) contained in the area expressed as polygons for each municipality. The optimizer selects GpuJoin, and GpuGiSTJoin to join \"giscity\" table with \"dpoints\" table. The \"IndexFilter:\" line shows that the filtering condition on the GiST index is (g.geom ~ st_makepoint(d.x, d.y)) and the index giscity_geom_idx will be used. The execution of PostGIS functions is a relatively \"heavy\" process even for GPU. By using GiST index, we can eliminate combinations that obviously do not match the condition and speed up the search process significantly. =# EXPLAIN SELECT pref, city, count(*) FROM giscity g, dpoints d WHERE pref = 'Tokyo' AND st_contains(g.geom,st_makepoint(d.x, d.y)) GROUP BY pref, city; QUERY PLAN ----------------------------------------------------------------------------------------------------------- GroupAggregate (cost=5700646.35..5700759.39 rows=5024 width=29) Group Key: g.n03_001, g.n03_004 -> Sort (cost=5700646.35..5700658.91 rows=5024 width=29) Sort Key: g.n03_004 -> Custom Scan (GpuPreAgg) (cost=5700274.71..5700337.51 rows=5024 width=29) Reduction: Local Combined GpuJoin: enabled GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Custom Scan (GpuJoin) on dpoints d (cost=638671.58..5668511.23 rows=50821573 width=21) Outer Scan: dpoints d (cost=0.00..141628.18 rows=7999618 width=16) Depth 1: GpuGiSTJoin(nrows 7999618...50821573) HeapSize: 3251.36KB IndexFilter: (g.geom ~ st_makepoint(d.x, d.y)) on giscity_geom_idx JoinQuals: st_contains(g.geom, st_makepoint(d.x, d.y)) GPU Preference: GPU0 (NVIDIA Tesla V100-PCIE-16GB) -> Seq Scan on giscity g (cost=0.00..8929.24 rows=6353 width=1883) Filter: ((pref)::text = 'Tokyo'::text) (17 rows)","title":"GiST Index"},{"location":"ref_devfuncs/","text":"Functions and operators This chapter introduces the functions and operators executable on GPU devices. Type cast bool <-- int4 int1 <-- int2 , int4 , int8 , float2 , float4 , float8 , numeric int2 <-- int1 , int4 , int8 , float2 , float4 , float8 , numeric int4 <-- bool , int1 , int2 , int8 , float2 , float4 , float8 , numeric int8 <-- int1 , int2 , int4 , float2 , float4 , float8 , numeric float2 <-- int1 , int2 , int4 , int8 , float4 , float8 , numeric float4 <-- int1 , int2 , int4 , int8 , float2 , float8 , numeric float8 <-- int1 , int2 , int4 , int8 , float2 , float4 , numeric numeric <-- int1 , int2 , int4 , int8 , float2 , float4 , float8 money <-- int4 , int8 , numeric date <-- timestamp , timestamptz time <-- timetz , timestamp , timestamptz timetz <-- time , timestamptz timestamp <-- date , timestamptz timestamptz <-- date , timestamp Numeric functions/operators bool COMP bool comparison operators of boolean type. COMP is any of =,<> } INT COMP INT comparison operators of integer types. INT is any of int1,int2,int4,int8 . It is acceptable if left side and right side have different interger types. COMP is any of =,<>,<,<=,>=,> } FP COMP FP comparison operators of floating-point types. FP is any of float2,float4,float8 . It is acceptable if left side and right side have different floating-point types. COMP is any of =,<>,<,<=,>=,> } numeric COMP numeric comparison operators of numeric type. COMP is any of =,<>,<,<=,>=,> } INT OP INT arithemetic operators of integer types. INT is any of int1,int2,int4,int8 . It is acceptable if left side and right side have different interger types. OP is any of +,-,*,/ } FP OP FP arithemetic operators of floating-point types. FP is any of float2,float4,float8 . It is acceptable if left side and right side have different floating-point types. COMP is any of +,-,*,/ } numeric OP numeric comparison operators of numeric type. OP is any of +,-,*,/ } INT % INT Reminer operator. INT is any of int1,int2,int4,int8 } INT & INT Bitwise AND operator. INT is any of int1,int2,int4,int8 } INT | INT Bitwise OR operator. INT is any of int1,int2,int4,int8 } INT # INT Bitwise XOR operator. INT is any of int1,int2,int4,int8 } ~ INT Bitwise NOT operator. INT is any of int1,int2,int4,int8 } INT >> int4 Right shift operator. INT is any of int1,int2,int4,int8 } INT << int4 Left shift operator. INT is any of int1,int2,int4,int8 } + TYPE Unary plus operator. TYPE is any of int1,int2,int4,int8,float2,float4,float8,numeric .} - TYPE Unary minus operator. TYPE is any of int1,int2,int4,int8,float2,float4,float8,numeric .} @ TYPE Absolute value. TYPE is any of int1,int2,int4,int8,float2,float4,float8,numeric .} Mathematical functions float8 cbrt(float8) float8 dcbrt(float8) cube root float8 ceil(float8) float8 ceiling(float8) nearest integer greater than or equal to argument float8 exp(float8) float8 dexp(float8) exponential float8 floor(float8) nearest integer less than or equal to argument float8 ln(float8) float8 dlog1(float8) natural logarithm float8 log(float8) float8 dlog10(float8) base 10 logarithm float8 pi() circumference ratio float8 power(float8,float8) float8 pow(float8,float8) float8 dpow(float8,float8) power float8 round(float8) float8 dround(float8) round to the nearest integer float8 sign(float8) sign of the argument float8 sqrt(float8) float8 dsqrt(float8) square root| float8 trunc(float8) float8 dtrunc(float8) truncate toward zero| Trigonometric functions float8 degrees(float8) radians to degrees} float8 radians(float8) degrees to radians} float8 acos(float8) inverse cosine} float8 asin(float8) inverse sine} float8 atan(float8) inverse tangent} float8 atan2(float8,float8) inverse tangent of arg1 / arg2 } float8 cos(float8) cosine} float8 cot(float8) cotangent} float8 sin(float8) sine} float8 tan(float8) tangent} Date and time operators date COMP date comparison operators for date type. COMP is any of =,<>,<,<=,>=,> .} date COMP timestamp timestamp COMP date comparison operators for date and timestamp type. COMP is any of =,<>,<,<=,>=,> .} date COMP timestamptz timestamptz COMP date comparison operators for date and timestamptz type. COMP is any of =,<>,<,<=,>=,> .} time COMP time comparison operators for time type. COMP is any of =,<>,<,<=,>=,> .} timetz COMP timetz comparison operators for timetz type. COMP is any of =,<>,<,<=,>=,> .} timestamp COMP timestamp comparison operators for timestamp type. COMP is any of =,<>,<,<=,>=,> .} timestamptz COMP timestamptz comparison operators for timestamptz type. COMP is any of =,<>,<,<=,>=,> .} timestamp COMP timestamptz timestamptz COMP timestamp comparison operators for timestamp and timestamptz type. COMP is any of =,<>,<,<=,>=,> .} interval COMP interval comparison operators for interval type. COMP is any of =,<>,<,<=,>=,> .} date + int4 int4 + date addition operator of date type} date - int4 subtraction operator of date type} date - date difference between date types} date + time time + date constructs a timestamp from date and time } date + timetz constructs a timestamptz from date and timetz } time - time difference between time types} timestamp - timestamp difference between timestamp types} timetz + interval timetz - interval addition or subtraction operator of timetz by interval .} timestamptz + interval timestamptz - interval addition or subtraction operator of timestamptz by interval .} overlaps(TYPE,TYPE,TYPE,TYPE) checks whether the 2 given time periods overlaps. TYPE is any of time,timetz,timestamp,timestamptz .} extract(text FROM TYPE) retrieves subfields such as day or hour from date/time values. TYPE is any of time,timetz,timestamp,timestamptz,interval .} now() current time of the transaction} - interval unary minus operator of interval type} interval + interval addition operator of interval type} interval - interval subtraction operator of interval type} Text functions/operators {text,bpchar} COMP {text,bpchar} comparison operators; COMP is any of =,<>,<,<=,>=,> Note that <,<=,>=,> operators are valid only when locale is UTF-8 or C (no locale).} substring(text,int4) substring(text,int4,int4) substr(text,int4) substr(text,int4,int4) extracts the substring} length({text,bpchar}) length of the string} {text,bpchar} [NOT] LIKE text pattern-matching according to the LIKE expression} {text,bpchar} [NOT] ILIKE text case-insensitive pattern-matching according to the LIKE expression. Note that ILIKE operator is valid only when locale is UTF-8 or C (no locale).} Network functions/operators macaddr COMP macaddr comparison operators; COMP is any of =,<>,<,<=,>=,> } macaddr & macaddr Bitwise AND operator} macaddr | macaddr Bitwise OR operator} ~ macaddr Bitwise NOT operator} trunc(macaddr) Set last 3 bytes to zero} inet COMP inet comparison operators; COMP is any of =,<>,<,<=,>=,> } inet << inet Left side is contained by right side} inet <<= inet Left side is contained by or equals to right side} inet >> inet Left side contains right side} inet >>= inet Left side contains or is equals to right side} inet && inet Left side contains or is contained by right side} ~ inet Bitwise NOT operator} inet & inet Bitwise AND operator} inet | inet Bitwise OR operator} inet + int8 addition operator} inet - int8 subtraction operator} inet - inet subtraction operator} broadcast(inet) returns the broadcast address of the given network address} family(inet) returns the family of the given network address; 4 for IPv4, and 6 for IPv6} hostmask(inet) extract host mask of the given network address} masklen(inet) extract netmask length of the given network address} netmask(inet) extract netmask of the given network address} network(inet) extract network part of the given network address} set_masklen(NETADDR,int) set netmask length of the given network address; NETADDR is either inet or cidr .} inet_merge(inet,inet) the smallest network which includes both of the given networks} Currency operators money COMP money comparison operators; COMP is any of =,<>,<,<=,>=,> } money OP money arthmetric operators; OP is any of +,-,/ } money * TYPE TYPE * money Multiply a currency with a numeric value; TYPE is any of int2,int4,float2,float4,float8 } money / TYPE Division of a currency by a numeric value; TYPE is any of int2,int4,float2,float4,float8 } money / money Division of currency values} UUID operators uuid COMP uuid comparison operator. COMP is any of =,<>,<,<=,>=,> } JSONB operators jsonb -> KEY Get a JSON object field specified by the KEY } jsonb -> NUM Get a JSON array element indexed by NUM } jsonb ->> KEY Get a JSON object field specified by the KEY , as text} jsonb ->> NUM Get a JSON array element indexed by NUM , as text} (jsonb ->> KEY)::TYPE If TYPE is any of int2,int4,int8,float4,float8,numeric , get a JSON object field specified by KEY , as numeric data type. See the note below.} (jsonb ->> NUM)::TYPE If TYPE is any of int2,int4,int8,float4,float8,numeric Get a JSON array element indexed by NUM , as numeric data type. See the note below.} jsonb ? KEY Check whether jsonb object contains the KEY } Note When we convert a jsonb element fetched by jsonb ->> KEY operator into numerical data types like float or numeric , PostgreSQL takes 2 steps operations; an internal numerical form is printed as text first, then it is converted into numerical data type. PG-Strom optimizes the GPU code using a special device function to fetch a numerical datum from jsonb object/array, if jsonb ->> KEY operator and text-to-numeric case are continuously used. PostGIS Functions geometry st_makepoint(float8,float8) geometry st_point(float8,float8) It makes 2-dimensional POINT geometry. geometry st_makepoint(float8,float8,float8) It makes 3-dimensional POINT geometry. geometry st_makepoint(float8,float8,float8,float8) It makes 4-dimensional POINT geometry. geometry st_setsrid(geometry,int4) It assigns SRID on the given geometry float8 st_distance(geometry,geometry) It returns the distance between geometries in float8 . bool st_dwithin(geometry,geometry,float8) It returns true if the distance between geometries is shorter than the specified threshold. It is often faster than the combination of st_distance and comparison operator. text st_relate(geometry,geometry) It checks intersection of geometries, then returns DE9-IM(Dimensionally Extended Nine-Intersection Matrix) format string. bool st_contains(geometry,geometry) It returns whether the geometry1 fully contains the geometry2. bool st_crosses(geometry,geometry) It returns whether the geometries are crossed. int4 st_linecrossingdirection(geometry,geometry) It checks how two LINESTRING geometries are crossing, or not crossing. CUBE Type Functions cube COMP cube comparison operators; COMP is any of =,<>,<,<=,>=,> } bool cube_contains(cube, cube) It returns whether the first cube fully contains the second cube. bool cube_contained(cube, cube) It returns whether the first cube is fully contained by the second cube. float8 cube_ll_coord(cube, int4)","title":"Functions and Operators"},{"location":"ref_devfuncs/#functions-and-operators","text":"This chapter introduces the functions and operators executable on GPU devices.","title":"Functions and operators"},{"location":"ref_devfuncs/#type-cast","text":"bool <-- int4 int1 <-- int2 , int4 , int8 , float2 , float4 , float8 , numeric int2 <-- int1 , int4 , int8 , float2 , float4 , float8 , numeric int4 <-- bool , int1 , int2 , int8 , float2 , float4 , float8 , numeric int8 <-- int1 , int2 , int4 , float2 , float4 , float8 , numeric float2 <-- int1 , int2 , int4 , int8 , float4 , float8 , numeric float4 <-- int1 , int2 , int4 , int8 , float2 , float8 , numeric float8 <-- int1 , int2 , int4 , int8 , float2 , float4 , numeric numeric <-- int1 , int2 , int4 , int8 , float2 , float4 , float8 money <-- int4 , int8 , numeric date <-- timestamp , timestamptz time <-- timetz , timestamp , timestamptz timetz <-- time , timestamptz timestamp <-- date , timestamptz timestamptz <-- date , timestamp","title":"Type cast"},{"location":"ref_devfuncs/#numeric-functionsoperators","text":"bool COMP bool comparison operators of boolean type. COMP is any of =,<> } INT COMP INT comparison operators of integer types. INT is any of int1,int2,int4,int8 . It is acceptable if left side and right side have different interger types. COMP is any of =,<>,<,<=,>=,> } FP COMP FP comparison operators of floating-point types. FP is any of float2,float4,float8 . It is acceptable if left side and right side have different floating-point types. COMP is any of =,<>,<,<=,>=,> } numeric COMP numeric comparison operators of numeric type. COMP is any of =,<>,<,<=,>=,> } INT OP INT arithemetic operators of integer types. INT is any of int1,int2,int4,int8 . It is acceptable if left side and right side have different interger types. OP is any of +,-,*,/ } FP OP FP arithemetic operators of floating-point types. FP is any of float2,float4,float8 . It is acceptable if left side and right side have different floating-point types. COMP is any of +,-,*,/ } numeric OP numeric comparison operators of numeric type. OP is any of +,-,*,/ } INT % INT Reminer operator. INT is any of int1,int2,int4,int8 } INT & INT Bitwise AND operator. INT is any of int1,int2,int4,int8 } INT | INT Bitwise OR operator. INT is any of int1,int2,int4,int8 } INT # INT Bitwise XOR operator. INT is any of int1,int2,int4,int8 } ~ INT Bitwise NOT operator. INT is any of int1,int2,int4,int8 } INT >> int4 Right shift operator. INT is any of int1,int2,int4,int8 } INT << int4 Left shift operator. INT is any of int1,int2,int4,int8 } + TYPE Unary plus operator. TYPE is any of int1,int2,int4,int8,float2,float4,float8,numeric .} - TYPE Unary minus operator. TYPE is any of int1,int2,int4,int8,float2,float4,float8,numeric .} @ TYPE Absolute value. TYPE is any of int1,int2,int4,int8,float2,float4,float8,numeric .}","title":"Numeric functions/operators"},{"location":"ref_devfuncs/#mathematical-functions","text":"float8 cbrt(float8) float8 dcbrt(float8) cube root float8 ceil(float8) float8 ceiling(float8) nearest integer greater than or equal to argument float8 exp(float8) float8 dexp(float8) exponential float8 floor(float8) nearest integer less than or equal to argument float8 ln(float8) float8 dlog1(float8) natural logarithm float8 log(float8) float8 dlog10(float8) base 10 logarithm float8 pi() circumference ratio float8 power(float8,float8) float8 pow(float8,float8) float8 dpow(float8,float8) power float8 round(float8) float8 dround(float8) round to the nearest integer float8 sign(float8) sign of the argument float8 sqrt(float8) float8 dsqrt(float8) square root| float8 trunc(float8) float8 dtrunc(float8) truncate toward zero|","title":"Mathematical functions"},{"location":"ref_devfuncs/#trigonometric-functions","text":"float8 degrees(float8) radians to degrees} float8 radians(float8) degrees to radians} float8 acos(float8) inverse cosine} float8 asin(float8) inverse sine} float8 atan(float8) inverse tangent} float8 atan2(float8,float8) inverse tangent of arg1 / arg2 } float8 cos(float8) cosine} float8 cot(float8) cotangent} float8 sin(float8) sine} float8 tan(float8) tangent}","title":"Trigonometric functions"},{"location":"ref_devfuncs/#date-and-time-operators","text":"date COMP date comparison operators for date type. COMP is any of =,<>,<,<=,>=,> .} date COMP timestamp timestamp COMP date comparison operators for date and timestamp type. COMP is any of =,<>,<,<=,>=,> .} date COMP timestamptz timestamptz COMP date comparison operators for date and timestamptz type. COMP is any of =,<>,<,<=,>=,> .} time COMP time comparison operators for time type. COMP is any of =,<>,<,<=,>=,> .} timetz COMP timetz comparison operators for timetz type. COMP is any of =,<>,<,<=,>=,> .} timestamp COMP timestamp comparison operators for timestamp type. COMP is any of =,<>,<,<=,>=,> .} timestamptz COMP timestamptz comparison operators for timestamptz type. COMP is any of =,<>,<,<=,>=,> .} timestamp COMP timestamptz timestamptz COMP timestamp comparison operators for timestamp and timestamptz type. COMP is any of =,<>,<,<=,>=,> .} interval COMP interval comparison operators for interval type. COMP is any of =,<>,<,<=,>=,> .} date + int4 int4 + date addition operator of date type} date - int4 subtraction operator of date type} date - date difference between date types} date + time time + date constructs a timestamp from date and time } date + timetz constructs a timestamptz from date and timetz } time - time difference between time types} timestamp - timestamp difference between timestamp types} timetz + interval timetz - interval addition or subtraction operator of timetz by interval .} timestamptz + interval timestamptz - interval addition or subtraction operator of timestamptz by interval .} overlaps(TYPE,TYPE,TYPE,TYPE) checks whether the 2 given time periods overlaps. TYPE is any of time,timetz,timestamp,timestamptz .} extract(text FROM TYPE) retrieves subfields such as day or hour from date/time values. TYPE is any of time,timetz,timestamp,timestamptz,interval .} now() current time of the transaction} - interval unary minus operator of interval type} interval + interval addition operator of interval type} interval - interval subtraction operator of interval type}","title":"Date and time operators"},{"location":"ref_devfuncs/#text-functionsoperators","text":"{text,bpchar} COMP {text,bpchar} comparison operators; COMP is any of =,<>,<,<=,>=,> Note that <,<=,>=,> operators are valid only when locale is UTF-8 or C (no locale).} substring(text,int4) substring(text,int4,int4) substr(text,int4) substr(text,int4,int4) extracts the substring} length({text,bpchar}) length of the string} {text,bpchar} [NOT] LIKE text pattern-matching according to the LIKE expression} {text,bpchar} [NOT] ILIKE text case-insensitive pattern-matching according to the LIKE expression. Note that ILIKE operator is valid only when locale is UTF-8 or C (no locale).}","title":"Text functions/operators"},{"location":"ref_devfuncs/#network-functionsoperators","text":"macaddr COMP macaddr comparison operators; COMP is any of =,<>,<,<=,>=,> } macaddr & macaddr Bitwise AND operator} macaddr | macaddr Bitwise OR operator} ~ macaddr Bitwise NOT operator} trunc(macaddr) Set last 3 bytes to zero} inet COMP inet comparison operators; COMP is any of =,<>,<,<=,>=,> } inet << inet Left side is contained by right side} inet <<= inet Left side is contained by or equals to right side} inet >> inet Left side contains right side} inet >>= inet Left side contains or is equals to right side} inet && inet Left side contains or is contained by right side} ~ inet Bitwise NOT operator} inet & inet Bitwise AND operator} inet | inet Bitwise OR operator} inet + int8 addition operator} inet - int8 subtraction operator} inet - inet subtraction operator} broadcast(inet) returns the broadcast address of the given network address} family(inet) returns the family of the given network address; 4 for IPv4, and 6 for IPv6} hostmask(inet) extract host mask of the given network address} masklen(inet) extract netmask length of the given network address} netmask(inet) extract netmask of the given network address} network(inet) extract network part of the given network address} set_masklen(NETADDR,int) set netmask length of the given network address; NETADDR is either inet or cidr .} inet_merge(inet,inet) the smallest network which includes both of the given networks}","title":"Network functions/operators"},{"location":"ref_devfuncs/#currency-operators","text":"money COMP money comparison operators; COMP is any of =,<>,<,<=,>=,> } money OP money arthmetric operators; OP is any of +,-,/ } money * TYPE TYPE * money Multiply a currency with a numeric value; TYPE is any of int2,int4,float2,float4,float8 } money / TYPE Division of a currency by a numeric value; TYPE is any of int2,int4,float2,float4,float8 } money / money Division of currency values}","title":"Currency operators"},{"location":"ref_devfuncs/#uuid-operators","text":"uuid COMP uuid comparison operator. COMP is any of =,<>,<,<=,>=,> }","title":"UUID operators"},{"location":"ref_devfuncs/#jsonb-operators","text":"jsonb -> KEY Get a JSON object field specified by the KEY } jsonb -> NUM Get a JSON array element indexed by NUM } jsonb ->> KEY Get a JSON object field specified by the KEY , as text} jsonb ->> NUM Get a JSON array element indexed by NUM , as text} (jsonb ->> KEY)::TYPE If TYPE is any of int2,int4,int8,float4,float8,numeric , get a JSON object field specified by KEY , as numeric data type. See the note below.} (jsonb ->> NUM)::TYPE If TYPE is any of int2,int4,int8,float4,float8,numeric Get a JSON array element indexed by NUM , as numeric data type. See the note below.} jsonb ? KEY Check whether jsonb object contains the KEY } Note When we convert a jsonb element fetched by jsonb ->> KEY operator into numerical data types like float or numeric , PostgreSQL takes 2 steps operations; an internal numerical form is printed as text first, then it is converted into numerical data type. PG-Strom optimizes the GPU code using a special device function to fetch a numerical datum from jsonb object/array, if jsonb ->> KEY operator and text-to-numeric case are continuously used.","title":"JSONB operators"},{"location":"ref_devfuncs/#postgis-functions","text":"geometry st_makepoint(float8,float8) geometry st_point(float8,float8) It makes 2-dimensional POINT geometry. geometry st_makepoint(float8,float8,float8) It makes 3-dimensional POINT geometry. geometry st_makepoint(float8,float8,float8,float8) It makes 4-dimensional POINT geometry. geometry st_setsrid(geometry,int4) It assigns SRID on the given geometry float8 st_distance(geometry,geometry) It returns the distance between geometries in float8 . bool st_dwithin(geometry,geometry,float8) It returns true if the distance between geometries is shorter than the specified threshold. It is often faster than the combination of st_distance and comparison operator. text st_relate(geometry,geometry) It checks intersection of geometries, then returns DE9-IM(Dimensionally Extended Nine-Intersection Matrix) format string. bool st_contains(geometry,geometry) It returns whether the geometry1 fully contains the geometry2. bool st_crosses(geometry,geometry) It returns whether the geometries are crossed. int4 st_linecrossingdirection(geometry,geometry) It checks how two LINESTRING geometries are crossing, or not crossing.","title":"PostGIS Functions"},{"location":"ref_devfuncs/#cube-type-functions","text":"cube COMP cube comparison operators; COMP is any of =,<>,<,<=,>=,> } bool cube_contains(cube, cube) It returns whether the first cube fully contains the second cube. bool cube_contained(cube, cube) It returns whether the first cube is fully contained by the second cube. float8 cube_ll_coord(cube, int4)","title":"CUBE Type Functions"},{"location":"ref_params/","text":"GUC Parameters This session introduces PG-Strom's configuration parameters. Enables/disables a particular feature pg_strom.enabled [type: bool / default: on] Enables/disables entire PG-Strom features at once pg_strom.enable_gpuscan [type: bool / default: on] Enables/disables GpuScan pg_strom.enable_gpuhashjoin [type: bool / default: on] Enables/disables JOIN by GpuHashJoin pg_strom.enable_gpugistindex [type: bool / default: on] Enables/disables JOIN by GpuGiSTIndex pg_strom.enable_gpujoin [type: bool / default: on] Enables/disables entire GpuJoin features (including GpuHashJoin and GpuGiSTIndex) pg_strom.enable_gpupreagg [type: bool / default: on] Enables/disables GpuPreAgg pg_strom.enable_numeric_aggfuncs [type: bool / default: on] Enables/disables support of aggregate function that takes numeric data type. Note that aggregated function at GPU mapps numeric data type to double precision floating point values. So, if you are sensitive to calculation errors, you can turn off this configuration to suppress the calculation errors by the operations on CPU. pg_strom.enable_brin [type: bool / default: on] Enables/disables BRIN index support on tables scan pg_strom.cpu_fallback [type: enum / default: notice ] Controls whether it actually run CPU fallback operations, if GPU program returned \"CPU ReCheck Error\" notice ... Runs CPU fallback operations with notice message on , true ... Runs CPU fallback operations with no message output off , false ... Disabled CPU fallback operations with an error pg_strom.regression_test_mode [type: bool / default: off] It disables some EXPLAIN command output that depends on software execution platform, like GPU model name. It avoid \"false-positive\" on the regression test, so use usually don't tough this configuration. Optimizer Configuration pg_strom.gpu_setup_cost [type: real / default: 100 * DEFAULT_SEQ_PAGE_COST ] Cost value for initialization of GPU device pg_strom.gpu_tuple_cost [type: real / default: DEFAULT_CPU_TUPLE_COST ] Cost value to send tuples to, or receive tuples from GPU for each. pg_strom.gpu_operator_cost [type: real / default: DEFAULT_CPU_OPERATOR_COST / 16 ] Cost value to process an expression formula on GPU. If larger value than cpu_operator_cost is configured, no chance to choose PG-Strom towards any size of tables pg_strom.enable_partitionwise_gpujoin [type: bool / default: on] Enables/disables whether GpuJoin is pushed down to the partition children. pg_strom.enable_partitionwise_gpupreagg [type: bool / default: on] Enables/disables whether GpuPreAgg is pushed down to the partition children. pg_strom.pinned_inner_buffer_threshold [type: int / \u521d\u671f\u5024: 0 ] If the INNER table of GpuJoin is either GpuScan or GpuJoin, and the estimated size of its processing result is larger than this configured value, the result is retained on the GPU device without being returned to the CPU, and then reused as a part of the INNER buffer of the subsequent GpuJoin. If the configured value is 0 , this function will be disabled. Executor Configuration pg_strom.max_async_tasks [type: int / default: 12 ] Max number of asynchronous taks PG-Strom can submit to the GPU execution queue, and is also the number of GPU Service worker threads. GPUDirect SQL Configuration pg_strom.gpudirect_driver [type: text ] It shows the driver software name of GPUDirect SQL (read-only). Either cufile , nvme-strom or vfs pg_strom.gpudirect_enabled [type: bool / default: on ] Enables/disables GPUDirect SQL feature. pg_strom.gpu_direct_seq_page_cost [type: real / default: DEFAULT_SEQ_PAGE_COST / 4 ] The cost of scanning a table using GPU-Direct SQL, instead of the seq_page_cost , when the optimizer calculates the cost of an execution plan. pg_strom.gpudirect_threshold [type: int / default: auto] Controls the table-size threshold to invoke GPUDirect SQL feature. The default is auto configuration; a threshold calculated by the system physical memory size and shared_buffers configuration. pg_strom.manual_optimal_gpus [type: text / default: none] It manually configures the closest GPU for the target storage volumn, like NVME device or NFS volume. Its format string is: {|/path/to/tablespace}=gpuX[:gpuX...] . It describes relationship between the closest GPU and NVME device or tablespace directory path. It accepts multiple configurations separated by comma character. Example: pg_strom.manual_optimal_gpus = 'nvme1=gpu0,nvme2=gpu1,/mnt/nfsroot=gpu0' means a GPU with device identifier X. means a local NVME-SSD or a remote NVME-oF device. /path/to/tablespace means full-path of the tablespace directory. Automatic configuration is often sufficient for local NVME-SSD drives, however, you should manually configure the closest GPU for NVME-oF or NFS-over-RDMA volumes. Arrow_Fdw Configuration arrow_fdw.enabled [type: bool / default: on ] By adjustment of estimated cost value, it turns on/off Arrow_Fdw. Note that only Foreign Scan (Arrow_Fdw) can scan on Arrow files, if GpuScan is not capable to run on. arrow_fdw.stats_hint_enabled [type: bool / default: on ] When Arrow file has min/max statistics, this parameter controls whether unnecessary record-batches shall be skipped, or not. arrow_fdw.metadata_cache_size [type: int / default: 512MB ] Size of shared memory to cache metadata of Arrow files. Once consumption of the shared memory exceeds this value, the older metadata shall be released based on LRU. GPU Cache configuration pg_strom.enable_gpucache [type: bool / default: on ] Controls whether search/analytic query tries to use GPU Cache. Note that GPU Cache trigger functions continue to update the REDO Log buffer, even if this parameter is turned off. pg_strom.gpucache_auto_preload [type: text / default: null ] It specifies the table names to be loaded onto GPU Cache just after PostgreSQL startup. Its format is DATABASE_NAME.SCHEMA_NAME.TABLE_NAME , and separated by comma if multiple tables are preloaded. Initial-loading of GPU Cache usually takes a lot of time. So, preloading enables to avoid delay of response time of search/analytic queries on the first time. If this parameter is '*', PG-Strom tries to load all the configured tables onto GPU Cache sequentially. GPU Device Configuration pg_strom.gpu_mempool_segment_sz [type: int / default: 1GB ] The segment size when GPU Service allocates GPU device memory for the memory pool. GPU device memory allocation is a relatively heavy process, so it is recommended to use memory pools to reuse memory. pg_strom.gpu_mempool_max_ratio [type: real / default: 50% ] It specifies the percentage of device memory that can be used for the GPU device memory memory pool. It works to suppress excessive GPU device memory consumption by the memory pool and ensure sufficient working memory. pg_strom.gpu_mempool_min_ratio [type: real / default: 5% ] It specify the percentage of GPU device memory that is preserved as the memory pool segment, and remained even after memory usage. By maintaining a minimum memory pool, the next query can be executed quickly. pg_strom.gpu_mempool_release_delay [type: int / default: 5000 ] GPU Service does not release a segment of a memory pool immediately, even if it becomes empty. When the time specified by this parameter (in milliseconds) has elapsed since the segment was last used, it is released and returned to the system. By inserting a certain delay, you can reduce the frequency of GPU device memory allocation/release. pg_strom.gpuserv_debug_output [type: bool / default: false ] Enable/disable GPU Service debug message output. This message may be useful for debugging, but normally you should not change it from the default value. pg_strom.cuda_visible_devices [type: text / default: null ] List of GPU device numbers in comma separated, if you want to recognize particular GPUs on PostgreSQL startup. It is equivalent to the environment variable CUDAVISIBLE_DEVICES","title":"GUC Parameters"},{"location":"ref_params/#guc-parameters","text":"This session introduces PG-Strom's configuration parameters.","title":"GUC Parameters"},{"location":"ref_params/#enablesdisables-a-particular-feature","text":"pg_strom.enabled [type: bool / default: on] Enables/disables entire PG-Strom features at once pg_strom.enable_gpuscan [type: bool / default: on] Enables/disables GpuScan pg_strom.enable_gpuhashjoin [type: bool / default: on] Enables/disables JOIN by GpuHashJoin pg_strom.enable_gpugistindex [type: bool / default: on] Enables/disables JOIN by GpuGiSTIndex pg_strom.enable_gpujoin [type: bool / default: on] Enables/disables entire GpuJoin features (including GpuHashJoin and GpuGiSTIndex) pg_strom.enable_gpupreagg [type: bool / default: on] Enables/disables GpuPreAgg pg_strom.enable_numeric_aggfuncs [type: bool / default: on] Enables/disables support of aggregate function that takes numeric data type. Note that aggregated function at GPU mapps numeric data type to double precision floating point values. So, if you are sensitive to calculation errors, you can turn off this configuration to suppress the calculation errors by the operations on CPU. pg_strom.enable_brin [type: bool / default: on] Enables/disables BRIN index support on tables scan pg_strom.cpu_fallback [type: enum / default: notice ] Controls whether it actually run CPU fallback operations, if GPU program returned \"CPU ReCheck Error\" notice ... Runs CPU fallback operations with notice message on , true ... Runs CPU fallback operations with no message output off , false ... Disabled CPU fallback operations with an error pg_strom.regression_test_mode [type: bool / default: off] It disables some EXPLAIN command output that depends on software execution platform, like GPU model name. It avoid \"false-positive\" on the regression test, so use usually don't tough this configuration.","title":"Enables/disables a particular feature"},{"location":"ref_params/#optimizer-configuration","text":"pg_strom.gpu_setup_cost [type: real / default: 100 * DEFAULT_SEQ_PAGE_COST ] Cost value for initialization of GPU device pg_strom.gpu_tuple_cost [type: real / default: DEFAULT_CPU_TUPLE_COST ] Cost value to send tuples to, or receive tuples from GPU for each. pg_strom.gpu_operator_cost [type: real / default: DEFAULT_CPU_OPERATOR_COST / 16 ] Cost value to process an expression formula on GPU. If larger value than cpu_operator_cost is configured, no chance to choose PG-Strom towards any size of tables pg_strom.enable_partitionwise_gpujoin [type: bool / default: on] Enables/disables whether GpuJoin is pushed down to the partition children. pg_strom.enable_partitionwise_gpupreagg [type: bool / default: on] Enables/disables whether GpuPreAgg is pushed down to the partition children. pg_strom.pinned_inner_buffer_threshold [type: int / \u521d\u671f\u5024: 0 ] If the INNER table of GpuJoin is either GpuScan or GpuJoin, and the estimated size of its processing result is larger than this configured value, the result is retained on the GPU device without being returned to the CPU, and then reused as a part of the INNER buffer of the subsequent GpuJoin. If the configured value is 0 , this function will be disabled.","title":"Optimizer Configuration"},{"location":"ref_params/#executor-configuration","text":"pg_strom.max_async_tasks [type: int / default: 12 ] Max number of asynchronous taks PG-Strom can submit to the GPU execution queue, and is also the number of GPU Service worker threads.","title":"Executor Configuration"},{"location":"ref_params/#gpudirect-sql-configuration","text":"pg_strom.gpudirect_driver [type: text ] It shows the driver software name of GPUDirect SQL (read-only). Either cufile , nvme-strom or vfs pg_strom.gpudirect_enabled [type: bool / default: on ] Enables/disables GPUDirect SQL feature. pg_strom.gpu_direct_seq_page_cost [type: real / default: DEFAULT_SEQ_PAGE_COST / 4 ] The cost of scanning a table using GPU-Direct SQL, instead of the seq_page_cost , when the optimizer calculates the cost of an execution plan. pg_strom.gpudirect_threshold [type: int / default: auto] Controls the table-size threshold to invoke GPUDirect SQL feature. The default is auto configuration; a threshold calculated by the system physical memory size and shared_buffers configuration. pg_strom.manual_optimal_gpus [type: text / default: none] It manually configures the closest GPU for the target storage volumn, like NVME device or NFS volume. Its format string is: {|/path/to/tablespace}=gpuX[:gpuX...] . It describes relationship between the closest GPU and NVME device or tablespace directory path. It accepts multiple configurations separated by comma character. Example: pg_strom.manual_optimal_gpus = 'nvme1=gpu0,nvme2=gpu1,/mnt/nfsroot=gpu0' means a GPU with device identifier X. means a local NVME-SSD or a remote NVME-oF device. /path/to/tablespace means full-path of the tablespace directory. Automatic configuration is often sufficient for local NVME-SSD drives, however, you should manually configure the closest GPU for NVME-oF or NFS-over-RDMA volumes.","title":"GPUDirect SQL Configuration"},{"location":"ref_params/#arrow_fdw-configuration","text":"arrow_fdw.enabled [type: bool / default: on ] By adjustment of estimated cost value, it turns on/off Arrow_Fdw. Note that only Foreign Scan (Arrow_Fdw) can scan on Arrow files, if GpuScan is not capable to run on. arrow_fdw.stats_hint_enabled [type: bool / default: on ] When Arrow file has min/max statistics, this parameter controls whether unnecessary record-batches shall be skipped, or not. arrow_fdw.metadata_cache_size [type: int / default: 512MB ] Size of shared memory to cache metadata of Arrow files. Once consumption of the shared memory exceeds this value, the older metadata shall be released based on LRU.","title":"Arrow_Fdw Configuration"},{"location":"ref_params/#gpu-cache-configuration","text":"pg_strom.enable_gpucache [type: bool / default: on ] Controls whether search/analytic query tries to use GPU Cache. Note that GPU Cache trigger functions continue to update the REDO Log buffer, even if this parameter is turned off. pg_strom.gpucache_auto_preload [type: text / default: null ] It specifies the table names to be loaded onto GPU Cache just after PostgreSQL startup. Its format is DATABASE_NAME.SCHEMA_NAME.TABLE_NAME , and separated by comma if multiple tables are preloaded. Initial-loading of GPU Cache usually takes a lot of time. So, preloading enables to avoid delay of response time of search/analytic queries on the first time. If this parameter is '*', PG-Strom tries to load all the configured tables onto GPU Cache sequentially.","title":"GPU Cache configuration"},{"location":"ref_params/#gpu-device-configuration","text":"pg_strom.gpu_mempool_segment_sz [type: int / default: 1GB ] The segment size when GPU Service allocates GPU device memory for the memory pool. GPU device memory allocation is a relatively heavy process, so it is recommended to use memory pools to reuse memory. pg_strom.gpu_mempool_max_ratio [type: real / default: 50% ] It specifies the percentage of device memory that can be used for the GPU device memory memory pool. It works to suppress excessive GPU device memory consumption by the memory pool and ensure sufficient working memory. pg_strom.gpu_mempool_min_ratio [type: real / default: 5% ] It specify the percentage of GPU device memory that is preserved as the memory pool segment, and remained even after memory usage. By maintaining a minimum memory pool, the next query can be executed quickly. pg_strom.gpu_mempool_release_delay [type: int / default: 5000 ] GPU Service does not release a segment of a memory pool immediately, even if it becomes empty. When the time specified by this parameter (in milliseconds) has elapsed since the segment was last used, it is released and returned to the system. By inserting a certain delay, you can reduce the frequency of GPU device memory allocation/release. pg_strom.gpuserv_debug_output [type: bool / default: false ] Enable/disable GPU Service debug message output. This message may be useful for debugging, but normally you should not change it from the default value. pg_strom.cuda_visible_devices [type: text / default: null ] List of GPU device numbers in comma separated, if you want to recognize particular GPUs on PostgreSQL startup. It is equivalent to the environment variable CUDAVISIBLE_DEVICES","title":"GPU Device Configuration"},{"location":"ref_sqlfuncs/","text":"SQL Objects This chapter introduces SQL objects additionally provided by PG-Strom. System Information pgstrom.device_info System View It shows properties of GPU devices installed for PG-Strom. Below is schema definition of the view. name type description gpu_id int GPU device number att_name text Attribute name att_value text Attribute value att_desc text Attribute description There are various kind of GPU device properties, but depending on the CUDA driver version where system is running. So, pgstrom.device_info system view identifies the target property by GPU device identifier ( gpu_id ) and attribute name ( att_name ). Below is an example of pgstrom.device_info system view. postgres=# select * from pgstrom.gpu_device_info limit 10; gpu_id | att_name | att_value | att_desc --------+-----------------------+------------------------------------------+------------------------------------- 0 | DEV_NAME | NVIDIA A100-PCIE-40GB | GPU Device Name 0 | DEV_ID | 0 | GPU Device ID 0 | DEV_UUID | GPU-13943bfd-5b30-38f5-0473-78979c134606 | GPU Device UUID 0 | DEV_TOTAL_MEMSZ | 39.39GB | GPU Total RAM Size 0 | DEV_BAR1_MEMSZ | 64.00GB | GPU PCI Bar1 Size 0 | NUMA_NODE_ID | -1 | GPU NUMA Node Id 0 | MAX_THREADS_PER_BLOCK | 1024 | Maximum number of threads per block 0 | MAX_BLOCK_DIM_X | 1024 | Maximum block dimension X 0 | MAX_BLOCK_DIM_Y | 1024 | Maximum block dimension Y 0 | MAX_BLOCK_DIM_Z | 64 | Maximum block dimension Z (10 rows) Arrow_Fdw fdw_handler pgstrom.arrow_fdw_handler() FDW handler function of Arrow_Fdw. Usually, users don't need to invoke this function. void pgstrom.arrow_fdw_validator(text[], oid) FDW options validation function of Arrow_Fdw. Usually, users don't need to invoke this function. event_trigger pgstrom.arrow_fdw_precheck_schema() Event trigger function to validate schema definition of Arrow files. Usually, users don't need to invoke this function. void pgstrom.arrow_fdw_import_file(text, text, text = null) This function tries to import Apache Arrow file, and defines a new foreign table. Its first argument is name of the new foreign table, the second argument is path of the Apache Arrow file, and the optional third argument is the schema name. This function is similar to IMPORT FOREIGN SCHEMA statement, but allows to import Apache Arrow files that have wider fields than the limitation of number of columns in PostgreSQL ( MaxTupleAttributeNumber = 1664). So, we recommend to use IMPORT FOREIGN SCHEMA statement for most cases. The example below shows the steps to import an Apache Arrow file with 2000 of Int16 fields by the pgstrom.arrow_fdw_import_file . The result of \\d mytest shows this foreign table has 2000 fields. Due to the internal data format of PostgreSQL, it is not possible to read all the columns at once, but possible to read a part of columns like the last example. =# select pgstrom.arrow_fdw_import_file('mytest', '/tmp/wide2000.arrow'); arrow_fdw_import_file ----------------------- (1 row) =# \\d List of relations Schema | Name | Type | Owner --------+--------+---------------+-------- public | mytest | foreign table | kaigai (1 row) =# \\d mytest Foreign table \"public.mytest\" Column | Type | Collation | Nullable | Default | FDW options -----------+----------+-----------+----------+---------+------------- object_id | integer | | | | c000 | smallint | | | | c001 | smallint | | | | c002 | smallint | | | | c003 | smallint | | | | : : : : : : c1997 | smallint | | | | c1998 | smallint | | | | c1999 | smallint | | | | Server: arrow_fdw FDW options: (file '/tmp/wide2000.arrow') =# select * from mytest ; ERROR: target lists can have at most 1664 entries =# select c0010,c1234,c1999 from mytest limit 3; c0010 | c1234 | c1999 -------+-------+------- 232 | 232 | 232 537 | 537 | 537 219 | 219 | 219 (3 rows) GPU Cache pgstrom.gpucache_info System View It shows the current status of GPU Cache. Below is schema definition of the view. name type description database_oid oid Database OID where the table with GPU Cache belongs to. database_name text Database name where the table with GPU Cache belongs to. table_oid oid Table OID that has GPU Cache. Note that it may not be in the current database. table_name text Table name that has GPU Cache. Note that it may not be in the current database. signature int8 An identifier hash value of GPU Cache. It may be changed after ALTER TABLE for example. phase text Phase of GPU cache construction: either not_built , is_empty , is_loading , is_ready , or corrupted rowid_num_used int8 Number of allocated row-id rowid_num_free int8 Number of free row-id gpu_main_sz int8 Size of the fixed-length values area on the GPU Cache. gpu_main_nitems int8 Number of tuples on the GPU Cache. gpu_extra_sz int8 Size of the variable-length values area on the GPU Cache. gpu_extra_usage int8 Size of the used variable-length values area on the GPU Cache. gpu_extra_dead int8 Size of the free variable-length values area on the GPU Cache. redo_write_ts timestamptz Last update timestamp on the REDO Log buffer redo_write_nitems int8 Total number of REDO Log entries written to the REDO Log buffer. redo_write_pos int8 Total bytes of REDO Log entries written to the REDO Log buffer. redo_read_nitems int8 Total number of REDO Log entries read from REDO Log buffer, and already applied to. redo_read_pos int8 Total bytes of REDO Log entries read from REDO Log buffer, and already applied to. redo_sync_pos int8 The latest position on the REDO Log buffer, where it is already required the background worker to synchronize onto the GPU Cache. When free space of REDO Log buffer becomes tight, it is internally used to avoid flood of simultaneous asynchronized requests by many sessions. config_options text Options string of the GPU Cache Below is an example of pgstrom.gpucache_info system view. =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | phase | rowid_num_used | rowid_num_free | gpu_main_sz | gpu_main_nitems | gpu_extra_sz | gpu_extra_usage | gpu_extra_dead | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------------+------------+----------+----------------+----------------+-------------+-----------------+--------------+-----------------+----------------+-------------------------------+-------------------+----------------+------------------+---------------+---------------+--------------------------------------------------------------------------------------------------------------------- 193450 | hoge | 603029 | cache_test_table | 4529357070 | is_ready | 4000 | 6000 | 439904 | 4000 | 3200024 | 473848 | 0 | 2023-12-18 01:25:42.850193+09 | 4000 | 603368 | 4000 | 603368 | 603368 | gpu_device_id=0,max_num_rows=10000,redo_buffer_size=157286400,gpu_sync_interval=4000000,gpu_sync_threshold=10485760 (1 row) trigger pgstrom.gpucache_sync_trigger() A trigger function to synchronize GPU Cache on table updates. See GPU Cache chapter for more details. bigint pgstrom.gpucache_apply_redo(regclass) If the given table has GPU Cache configured, it forcibly applies the REDO log entries onto the GPU Cache. bigint pgstrom.gpucache_compaction(regclass) If the given table has GPU Cache configured, it forcibly run compaction of the variable-length data buffer. bigint pgstrom.gpucache_recovery(regclass) It tries to recover the corrupted GPU cache. Test Data Generator void pgstrom.random_setseed(int) It initializes the random seed. bigint pgstrom.random_int(float=0.0, bigint=0, bigint=INT_MAX) It generates random data in bigint type within the range. float pgstrom.random_float(float=0.0, float=0.0, float=1.0) It generates random data in float type within the range. date pgstrom.random_date(float=0.0, date='2015-01-01', date='2025-12-31') It generates random data in date type within the range. time pgstrom.random_time(float=0.0, time='00:00:00', time='23:59:59') It generates random data in time type within the range. timetz pgstrom.random_timetz(float=0.0, time='00:00:00', time='23:59:59') It generates random data in timetz type within the range. timestamp pgstrom.random_timestamp(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') It generates random data in timestamp type within the range. macaddr pgstrom.random_macaddr(float=0.0, macaddr='ab:cd:00:00:00', macaddr='ab:cd:ff:ff:ff:ff') It generates random data in macaddr type within the range. inet pgstrom.random_inet(float=0.0, inet='192.168.0.1/16') It generates random data in inet type within the range. text pgstrom.random_text(float=0.0, text='test_**') It generates random data in text type. The '*' characters in 2nd argument shall be replaced randomly. text pgstrom.random_text_len(float=0.0, int=10) It generates random data in text type within the specified length. int4range pgstrom.random_int4range(float=0.0, bigint=0, bigint=INT_MAX) It generates random data in int4range type within the range.} int8range pgstrom.random_int8range(float=0.0, bigint=0, bigint=LONG_MAX) It generates random data in int8range type within the range. tsrange pgstrom.random_tsrange(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') It generates random data in tsrange type within the range. tstzrange pgstrom.random_tstzrange(float=0.0, timestamptz='2015-01-01', timestamptz='2025-01-01') It generates random data in tstzrange type within the range. daterange pgstrom.random_daterange(float=0.0, date='2015-01-01', date='2025-12-31') It generates random data in daterange type within the range. Other Functions text pgstrom.githash() It displays the hash value of the source code revision from the currently loaded PG-Strom module is based. This value is useful in determining the software revision in the event of a failure. postgres=# select pgstrom.githash(); githash ------------------------------------------ 103984be24cafd1e7ce6330a050960d97675c196 text pgstrom.license_query() It displays the active commercial subscription, if loaded. =# select pgstrom.license_query(); license_query ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2020-11-24\", \"expired_at\" : \"2025-12-31\", \"gpus\" : [ { \"uuid\" : \"GPU-8ba149db-53d8-c5f3-0f55-97ce8cfadb28\" } ]} (1 row)","title":"SQL Objects"},{"location":"ref_sqlfuncs/#sql-objects","text":"This chapter introduces SQL objects additionally provided by PG-Strom.","title":"SQL Objects"},{"location":"ref_sqlfuncs/#system-information","text":"pgstrom.device_info System View It shows properties of GPU devices installed for PG-Strom. Below is schema definition of the view. name type description gpu_id int GPU device number att_name text Attribute name att_value text Attribute value att_desc text Attribute description There are various kind of GPU device properties, but depending on the CUDA driver version where system is running. So, pgstrom.device_info system view identifies the target property by GPU device identifier ( gpu_id ) and attribute name ( att_name ). Below is an example of pgstrom.device_info system view. postgres=# select * from pgstrom.gpu_device_info limit 10; gpu_id | att_name | att_value | att_desc --------+-----------------------+------------------------------------------+------------------------------------- 0 | DEV_NAME | NVIDIA A100-PCIE-40GB | GPU Device Name 0 | DEV_ID | 0 | GPU Device ID 0 | DEV_UUID | GPU-13943bfd-5b30-38f5-0473-78979c134606 | GPU Device UUID 0 | DEV_TOTAL_MEMSZ | 39.39GB | GPU Total RAM Size 0 | DEV_BAR1_MEMSZ | 64.00GB | GPU PCI Bar1 Size 0 | NUMA_NODE_ID | -1 | GPU NUMA Node Id 0 | MAX_THREADS_PER_BLOCK | 1024 | Maximum number of threads per block 0 | MAX_BLOCK_DIM_X | 1024 | Maximum block dimension X 0 | MAX_BLOCK_DIM_Y | 1024 | Maximum block dimension Y 0 | MAX_BLOCK_DIM_Z | 64 | Maximum block dimension Z (10 rows)","title":"System Information"},{"location":"ref_sqlfuncs/#arrow_fdw","text":"fdw_handler pgstrom.arrow_fdw_handler() FDW handler function of Arrow_Fdw. Usually, users don't need to invoke this function. void pgstrom.arrow_fdw_validator(text[], oid) FDW options validation function of Arrow_Fdw. Usually, users don't need to invoke this function. event_trigger pgstrom.arrow_fdw_precheck_schema() Event trigger function to validate schema definition of Arrow files. Usually, users don't need to invoke this function. void pgstrom.arrow_fdw_import_file(text, text, text = null) This function tries to import Apache Arrow file, and defines a new foreign table. Its first argument is name of the new foreign table, the second argument is path of the Apache Arrow file, and the optional third argument is the schema name. This function is similar to IMPORT FOREIGN SCHEMA statement, but allows to import Apache Arrow files that have wider fields than the limitation of number of columns in PostgreSQL ( MaxTupleAttributeNumber = 1664). So, we recommend to use IMPORT FOREIGN SCHEMA statement for most cases. The example below shows the steps to import an Apache Arrow file with 2000 of Int16 fields by the pgstrom.arrow_fdw_import_file . The result of \\d mytest shows this foreign table has 2000 fields. Due to the internal data format of PostgreSQL, it is not possible to read all the columns at once, but possible to read a part of columns like the last example. =# select pgstrom.arrow_fdw_import_file('mytest', '/tmp/wide2000.arrow'); arrow_fdw_import_file ----------------------- (1 row) =# \\d List of relations Schema | Name | Type | Owner --------+--------+---------------+-------- public | mytest | foreign table | kaigai (1 row) =# \\d mytest Foreign table \"public.mytest\" Column | Type | Collation | Nullable | Default | FDW options -----------+----------+-----------+----------+---------+------------- object_id | integer | | | | c000 | smallint | | | | c001 | smallint | | | | c002 | smallint | | | | c003 | smallint | | | | : : : : : : c1997 | smallint | | | | c1998 | smallint | | | | c1999 | smallint | | | | Server: arrow_fdw FDW options: (file '/tmp/wide2000.arrow') =# select * from mytest ; ERROR: target lists can have at most 1664 entries =# select c0010,c1234,c1999 from mytest limit 3; c0010 | c1234 | c1999 -------+-------+------- 232 | 232 | 232 537 | 537 | 537 219 | 219 | 219 (3 rows)","title":"Arrow_Fdw"},{"location":"ref_sqlfuncs/#gpu-cache","text":"pgstrom.gpucache_info System View It shows the current status of GPU Cache. Below is schema definition of the view. name type description database_oid oid Database OID where the table with GPU Cache belongs to. database_name text Database name where the table with GPU Cache belongs to. table_oid oid Table OID that has GPU Cache. Note that it may not be in the current database. table_name text Table name that has GPU Cache. Note that it may not be in the current database. signature int8 An identifier hash value of GPU Cache. It may be changed after ALTER TABLE for example. phase text Phase of GPU cache construction: either not_built , is_empty , is_loading , is_ready , or corrupted rowid_num_used int8 Number of allocated row-id rowid_num_free int8 Number of free row-id gpu_main_sz int8 Size of the fixed-length values area on the GPU Cache. gpu_main_nitems int8 Number of tuples on the GPU Cache. gpu_extra_sz int8 Size of the variable-length values area on the GPU Cache. gpu_extra_usage int8 Size of the used variable-length values area on the GPU Cache. gpu_extra_dead int8 Size of the free variable-length values area on the GPU Cache. redo_write_ts timestamptz Last update timestamp on the REDO Log buffer redo_write_nitems int8 Total number of REDO Log entries written to the REDO Log buffer. redo_write_pos int8 Total bytes of REDO Log entries written to the REDO Log buffer. redo_read_nitems int8 Total number of REDO Log entries read from REDO Log buffer, and already applied to. redo_read_pos int8 Total bytes of REDO Log entries read from REDO Log buffer, and already applied to. redo_sync_pos int8 The latest position on the REDO Log buffer, where it is already required the background worker to synchronize onto the GPU Cache. When free space of REDO Log buffer becomes tight, it is internally used to avoid flood of simultaneous asynchronized requests by many sessions. config_options text Options string of the GPU Cache Below is an example of pgstrom.gpucache_info system view. =# select * from pgstrom.gpucache_info ; database_oid | database_name | table_oid | table_name | signature | phase | rowid_num_used | rowid_num_free | gpu_main_sz | gpu_main_nitems | gpu_extra_sz | gpu_extra_usage | gpu_extra_dead | redo_write_ts | redo_write_nitems | redo_write_pos | redo_read_nitems | redo_read_pos | redo_sync_pos | config_options --------------+---------------+-----------+------------------+------------+----------+----------------+----------------+-------------+-----------------+--------------+-----------------+----------------+-------------------------------+-------------------+----------------+------------------+---------------+---------------+--------------------------------------------------------------------------------------------------------------------- 193450 | hoge | 603029 | cache_test_table | 4529357070 | is_ready | 4000 | 6000 | 439904 | 4000 | 3200024 | 473848 | 0 | 2023-12-18 01:25:42.850193+09 | 4000 | 603368 | 4000 | 603368 | 603368 | gpu_device_id=0,max_num_rows=10000,redo_buffer_size=157286400,gpu_sync_interval=4000000,gpu_sync_threshold=10485760 (1 row) trigger pgstrom.gpucache_sync_trigger() A trigger function to synchronize GPU Cache on table updates. See GPU Cache chapter for more details. bigint pgstrom.gpucache_apply_redo(regclass) If the given table has GPU Cache configured, it forcibly applies the REDO log entries onto the GPU Cache. bigint pgstrom.gpucache_compaction(regclass) If the given table has GPU Cache configured, it forcibly run compaction of the variable-length data buffer. bigint pgstrom.gpucache_recovery(regclass) It tries to recover the corrupted GPU cache.","title":"GPU Cache"},{"location":"ref_sqlfuncs/#test-data-generator","text":"void pgstrom.random_setseed(int) It initializes the random seed. bigint pgstrom.random_int(float=0.0, bigint=0, bigint=INT_MAX) It generates random data in bigint type within the range. float pgstrom.random_float(float=0.0, float=0.0, float=1.0) It generates random data in float type within the range. date pgstrom.random_date(float=0.0, date='2015-01-01', date='2025-12-31') It generates random data in date type within the range. time pgstrom.random_time(float=0.0, time='00:00:00', time='23:59:59') It generates random data in time type within the range. timetz pgstrom.random_timetz(float=0.0, time='00:00:00', time='23:59:59') It generates random data in timetz type within the range. timestamp pgstrom.random_timestamp(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') It generates random data in timestamp type within the range. macaddr pgstrom.random_macaddr(float=0.0, macaddr='ab:cd:00:00:00', macaddr='ab:cd:ff:ff:ff:ff') It generates random data in macaddr type within the range. inet pgstrom.random_inet(float=0.0, inet='192.168.0.1/16') It generates random data in inet type within the range. text pgstrom.random_text(float=0.0, text='test_**') It generates random data in text type. The '*' characters in 2nd argument shall be replaced randomly. text pgstrom.random_text_len(float=0.0, int=10) It generates random data in text type within the specified length. int4range pgstrom.random_int4range(float=0.0, bigint=0, bigint=INT_MAX) It generates random data in int4range type within the range.} int8range pgstrom.random_int8range(float=0.0, bigint=0, bigint=LONG_MAX) It generates random data in int8range type within the range. tsrange pgstrom.random_tsrange(float=0.0, timestamp='2015-01-01', timestamp='2025-01-01') It generates random data in tsrange type within the range. tstzrange pgstrom.random_tstzrange(float=0.0, timestamptz='2015-01-01', timestamptz='2025-01-01') It generates random data in tstzrange type within the range. daterange pgstrom.random_daterange(float=0.0, date='2015-01-01', date='2025-12-31') It generates random data in daterange type within the range.","title":"Test Data Generator"},{"location":"ref_sqlfuncs/#other-functions","text":"text pgstrom.githash() It displays the hash value of the source code revision from the currently loaded PG-Strom module is based. This value is useful in determining the software revision in the event of a failure. postgres=# select pgstrom.githash(); githash ------------------------------------------ 103984be24cafd1e7ce6330a050960d97675c196 text pgstrom.license_query() It displays the active commercial subscription, if loaded. =# select pgstrom.license_query(); license_query ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { \"version\" : 2, \"serial_nr\" : \"HDB-TRIAL\", \"issued_at\" : \"2020-11-24\", \"expired_at\" : \"2025-12-31\", \"gpus\" : [ { \"uuid\" : \"GPU-8ba149db-53d8-c5f3-0f55-97ce8cfadb28\" } ]} (1 row)","title":"Other Functions"},{"location":"ref_types/","text":"Data Types PG-Strom support the following data types for use on GPU device. Numeric types int1 [length: 1byte] 8bit integer data type; enhanced data type by PG-Strom int2 (alias smallint ) [length: 2bytes] 16bit integer data type int4 (alias int ) [length: 4bytes] 32bit integer data type int8 (alias bigint ) [length: 8bytes] 64bit integer data type float2 [length: 2bytes] Half precision data type; enhanced data type by PG-Strom Note Even though GPU supports half-precision floating-point numbers by hardware, CPU (x86_64 processor) does not support it yet. So, when CPU processes float2 data types, it transform them to float or double on calculations. So, CPU has no advantages for calculation performance of float2 , unlike GPU. It is a feature to save storage/memory capacity for machine-learning / statistical-analytics. float4 (alias real ) [length: 4bytes] Single precision floating-point data type float8 (alias double precision ) [length: 8bytes] Double precision floating-point data type numeric [length: variable] Real number data type; handled as a 128bit fixed-point value in GPU Note When GPU processes values in numeric data type, it is converted to an internal 128bit fixed-point number because of implementation reason. (This layout is identical to Decimal type in Apache Arrow.) It is transparently converted to/from the internal format, on the other hands, PG-Strom cannot convert numaric datum with large number of digits, so tries to fallback operations by CPU. Therefore, it may lead slowdown if numeric data with large number of digits are supplied to GPU device. To avoid the problem, turn off the GUC option pg_strom.enable_numeric_type not to run operational expression including numeric data types on GPU devices. Date and time types date [length: 4bytes] Date data type time (alias time without time zone ) [length: 8bytes] Time data type timetz (alias time with time zone ) [length: 12bytes] Time with timezone data type timestamp (alias timestamp without time zone ) [length: 8bytes] Timestamp data type timestamptz (alias timestamp with time zone ) [length: 8bytes] Timestamp with timezone data type interval [length: 16bytes] Interval data type Variable length types bpchar [length: variable] variable length text with whitespace paddings varchar [length: variable] variable length text type text [length: variable] variable length text type bytea [length: variable] variable length binary type unstructured data types jsonb [length: variable] JSON data type with binary indexed keys Note Pay attention for the two points below, when GPU processes jsonb data types. jsonb is not performance efficient data types because it has to load unreferenced attributes onto GPU from the storage, so tend to consume I/O bandwidth by junk data. In case when jsonb data length exceeds the threshold of datum TOASTen , entire jsonb value is written out to TOAST table, thus, GPU cannot process these values and invokes inefficient CPU-fallback operations. Regarding to the 2nd problem, you can extend table's storage option toast_tuple_target to enlarge the threshold for datum TOASTen. Miscellaneous types boolean [length: 1byte] Boolean data type money [length: 8bytes] Money data type uuid [length: 16bytes] UUID data type macaddr [length: 6bytes] Network MAC address data type inet [length: 7 or 19bytes] Network address data type cidr [length: 7 or 19butes] Network address data type cube [length: variable] Extra data type provided by contrib/cube Geometry data types geometry [length: variable] Geometry object of PostGIS box2df [length: 16bytes] 2-dimension bounding box (used to GiST-index)","title":"Data Types"},{"location":"ref_types/#data-types","text":"PG-Strom support the following data types for use on GPU device.","title":"Data Types"},{"location":"ref_types/#numeric-types","text":"int1 [length: 1byte] 8bit integer data type; enhanced data type by PG-Strom int2 (alias smallint ) [length: 2bytes] 16bit integer data type int4 (alias int ) [length: 4bytes] 32bit integer data type int8 (alias bigint ) [length: 8bytes] 64bit integer data type float2 [length: 2bytes] Half precision data type; enhanced data type by PG-Strom Note Even though GPU supports half-precision floating-point numbers by hardware, CPU (x86_64 processor) does not support it yet. So, when CPU processes float2 data types, it transform them to float or double on calculations. So, CPU has no advantages for calculation performance of float2 , unlike GPU. It is a feature to save storage/memory capacity for machine-learning / statistical-analytics. float4 (alias real ) [length: 4bytes] Single precision floating-point data type float8 (alias double precision ) [length: 8bytes] Double precision floating-point data type numeric [length: variable] Real number data type; handled as a 128bit fixed-point value in GPU Note When GPU processes values in numeric data type, it is converted to an internal 128bit fixed-point number because of implementation reason. (This layout is identical to Decimal type in Apache Arrow.) It is transparently converted to/from the internal format, on the other hands, PG-Strom cannot convert numaric datum with large number of digits, so tries to fallback operations by CPU. Therefore, it may lead slowdown if numeric data with large number of digits are supplied to GPU device. To avoid the problem, turn off the GUC option pg_strom.enable_numeric_type not to run operational expression including numeric data types on GPU devices.","title":"Numeric types"},{"location":"ref_types/#date-and-time-types","text":"date [length: 4bytes] Date data type time (alias time without time zone ) [length: 8bytes] Time data type timetz (alias time with time zone ) [length: 12bytes] Time with timezone data type timestamp (alias timestamp without time zone ) [length: 8bytes] Timestamp data type timestamptz (alias timestamp with time zone ) [length: 8bytes] Timestamp with timezone data type interval [length: 16bytes] Interval data type","title":"Date and time types"},{"location":"ref_types/#variable-length-types","text":"bpchar [length: variable] variable length text with whitespace paddings varchar [length: variable] variable length text type text [length: variable] variable length text type bytea [length: variable] variable length binary type","title":"Variable length types"},{"location":"ref_types/#unstructured-data-types","text":"jsonb [length: variable] JSON data type with binary indexed keys Note Pay attention for the two points below, when GPU processes jsonb data types. jsonb is not performance efficient data types because it has to load unreferenced attributes onto GPU from the storage, so tend to consume I/O bandwidth by junk data. In case when jsonb data length exceeds the threshold of datum TOASTen , entire jsonb value is written out to TOAST table, thus, GPU cannot process these values and invokes inefficient CPU-fallback operations. Regarding to the 2nd problem, you can extend table's storage option toast_tuple_target to enlarge the threshold for datum TOASTen.","title":"unstructured data types"},{"location":"ref_types/#miscellaneous-types","text":"boolean [length: 1byte] Boolean data type money [length: 8bytes] Money data type uuid [length: 16bytes] UUID data type macaddr [length: 6bytes] Network MAC address data type inet [length: 7 or 19bytes] Network address data type cidr [length: 7 or 19butes] Network address data type cube [length: variable] Extra data type provided by contrib/cube","title":"Miscellaneous types"},{"location":"ref_types/#geometry-data-types","text":"geometry [length: variable] Geometry object of PostGIS box2df [length: 16bytes] 2-dimension bounding box (used to GiST-index)","title":"Geometry data types"},{"location":"release_v2.0/","text":"PG-Strom v2.0 Release PG-Strom Development Team (17-Apr-2018) Overview Major enhancement in PG-Strom v2.0 includes: Overall redesign of the internal infrastructure to manage GPU and stabilization CPU+GPU hybrid parallel execution SSD-to-GPU Direct SQL Execution In-memory columnar cache GPU memory store (gstore_fdw) Redesign of GpuJoin and GpuPreAgg and speed-up GpuPreAgg + GpuJoin + GpuScan combined GPU kernel You can download the summary of new features from: PG-Strom v2.0 Technical Brief . Prerequisites PostgreSQL v9.6, v10 CUDA Toolkit 9.1 Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or Volta) New Features Entire re-design and stabilization of the internal infrastructure to manage GPU device. PostgreSQL backend process simultaneously uses only one GPU at most. In case of multi-GPUs installation, it assumes combination use with CPU parallel execution of PostgreSQL. Usually, it is not a matter because throughput of CPU to provide data to GPU is much narrower than capability of GPU processors. We prioritized simpleness of the software architecture. We began to utilize the demand paging feature of GPU device memory supported at the GPU models since Pascal generation. In most of SQL workloads, we cannot know exact size of the required result buffer prior to its execution, therefore, we had allocated more buffer than estimated buffer length, and retried piece of the workloads if estimated buffer size is not sufficient actually. This design restricts available resources of GPU which can be potentially used for other concurrent processes, and complicated error-retry logic was a nightmare for software quality. The demand paging feature allows to eliminate and simplify these stuffs. We stop to use CUDA asynchronous interface. Use of the demand paging feature on GPU device memory makes asynchronous APIs for DMA (like cuMemCpyHtoD ) perform synchronously, then it reduces concurrency and usage ratio of GPU kernels. Instead of the CUDA asynchronous APIs, PG-Strom manages its own worker threads which call synchronous APIs for each. As a by-product, we also could eliminate asynchronous callbacks ( cuStreamAddCallback ), it allows to use MPS daemon which has a restriction at this API. CPU+GPU Hybrid Parallel Execution CPU parallel execution at PostgreSQL v9.6 is newly supported. CustomScan logic of GpuScan, GpuJoin and GpuPreAgg provided by PG-Strom are executable on multiple background worker processes of PostgreSQL in parallel. Limitation: PG-Strom's own statistics displayed at EXPLAIN ANALYZE if CPU parallel execution. Because PostgreSQL v9.6 does not provide ShutdownCustomScan callback of the CustomScan interface, coordinator process has no way to reclaim information of worker processes prior to the release of DSM (Dynamic Shared Memory) segment. SSD-to-GPU Direct SQL Execution By cooperation with the nvme_strom Linux kernel module, it enables to load PostgreSQL's data blocks on NVMe-SSD to GPU device memory directly, bypassing the CPU and host buffer. This feature enables to apply PG-Strom on the area which have to process large data set more than system RAM size. It allows to pull out pretty high throughput close to the hardware limitation because its data stream skips block-device or filesystem layer. Then, GPU runs SQL workloads that usually reduce the amount of data to be processed by CPU. The chemical reaction of these characteristics enables to redefine GPU's role as accelerator of I/O workloads also, not only computing intensive workloads. In-memory Columnar Cache For middle size data-set loadable onto the system RAM, it allows to cache data-blocks in column format which is more suitable for GPU computing. If cached data-blocks are found during table scan, PG-Strom prefers to reference the columnar cache more than shared buffer of PostgreSQL. In-memory columnar cache can be built synchronously, or asynchronously by the background workers. You may remember very early revision of PG-Strom had similar feature. In case when a cached tuple gets updated, the latest in-memory columnar cache which we newly implemented in v2.0 invalidates the cache block which includes the updated tuples. It never updates the columnar cache according to the updates of row-store, so performance degradation is quite limited. GPU Memory Store (gstore_fdw) It enables to write to / read from preserved GPU device memory region by SELECT/INSERT/UPDATE/DELETE in SQL-level, using foreign table interface. In v2.0, only pgstrom internal data format is supported. It saves written data using PG-Strom's buffer format of KDS_FORMAT_COLUMN . It can compress variable length data using LZ algorithm. In v2.0, GPU memory store can be used as data source of PL/CUDA user defined function. Redesign and performance improvement of GpuJoin and GpuPreAgg Stop using Dynamic Parallelism which we internally used in GpuJoin and GpuPreAgg, and revised entire logic of these operations. Old design had a problem of less GPU usage ratio because a GPU kernel which launches GPU sub-kernel and just waits for its completion occupied GPU's execution slot. A coproduct of this redesign is suspend/resume of GpuJoin. In principle, JOIN operation of SQL may generate larger number of rows than number of input rows, but preliminary not predictive. The new design allows to suspend GPU kernel once buffer available space gets lacked, then resume with new result buffer. It simplifies size estimation logic of the result buffer, and eliminates GPU kernel retry by lack of buffer on run-time. GpuPreAgg+GpuJoin+GpuScan combined GPU kernel In case when GPU executable SCAN, JOIN and GROUP BY are serially cascaded, a single GPU kernel invocation runs a series of tasks equivalent to the GpuScan, GpuJoin and GpuPreAgg. This is an approach to minimize data exchange between CPU and GPU. For example, result buffer of GpuJoin is used as input buffer of GpuPreAgg. This feature is especially valuable if combined with SSD-to-GPU Direct SQL Execution. PL/CUDA Enhancement #plcuda_include is enhanced to specify SQL function which returns text type. It can change the code block to inject according to the argument, so it also allows to generate multiple GPU kernel variations, not only inclusion of externally defined functions. If PL/CUDA takes reggstore type argument, GPU kernel function receives pointer of the GPU memory store. Note that it does not pass the OID value. Other Enhancement lo_import_gpu and lo_export_gpu functions allows to import contents of the GPU device memory acquired by external applications directly, or export contents of the largeobject to the GPU device memory. Packaging Add RPM packages to follow the PostgreSQL packages distributed by PostgreSQL Global Development Group. All the software packages are available at HeteroDB SWDC(Software Distribution Center) and downloadable. Document PG-Strom documentation was entirely rewritten using markdown and mkdocs. It makes documentation maintenance easier than the previous HTML based approach, so expects timely updates according to the development of new features. Test Regression test for PG-Strom was built on top of the regression test framework of PostgreSQL. Dropped features PostgreSQL v9.5 Support PostgreSQL v9.6 had big changes in both of the optimizer and executor to support CPU parallel query execution. The biggest change for extension modules that interact them is an enhancement of the interface called \"upper planner path-ification\". It allows to choose an optimal execution-plan from the multiple candidates based on the estimated cost, even if it is aggregation or sorting. It is fundamentally different from the older way where we rewrote query execution plan to inject GpuPreAgg using the hooks. It allows to inject GpuPreAgg node in more reasonable and reliable way, and we could drop complicated (and buggy) logic to rewrite query execution plan once constructed. CustomScan interface is also enhanced to support CPU parallel execution. Due to the reason, we dropped PostgreSQL v9.5 support to follow these new enhancement. GpuSort feature We dropped GpuSort because we have little advantages in the performance. Sorting is one of the GPU suitable workloads. However, in case when we try to sort data blocks larger than GPU device memory, we have to split the data blocks into multiple chunks, then partially sort them and merge them by CPU to generate final results. Larger chunk size is better to reduce the load to merge multiple chunks by CPU, on the other hands, larger chunk size takes larger lead time to launch GPU kernel to sort. It means here is a trade-off; which disallows asynchronous processing by PG-Strom to make data transfer latency invisible. It is hard to solve the problem, or too early to solve the problem, we dropped GpuSort feature once.","title":"PG-Strom v2.0"},{"location":"release_v2.0/#pg-strom-v20-release","text":"PG-Strom Development Team (17-Apr-2018)","title":"PG-Strom v2.0 Release"},{"location":"release_v2.0/#overview","text":"Major enhancement in PG-Strom v2.0 includes: Overall redesign of the internal infrastructure to manage GPU and stabilization CPU+GPU hybrid parallel execution SSD-to-GPU Direct SQL Execution In-memory columnar cache GPU memory store (gstore_fdw) Redesign of GpuJoin and GpuPreAgg and speed-up GpuPreAgg + GpuJoin + GpuScan combined GPU kernel You can download the summary of new features from: PG-Strom v2.0 Technical Brief .","title":"Overview"},{"location":"release_v2.0/#prerequisites","text":"PostgreSQL v9.6, v10 CUDA Toolkit 9.1 Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or Volta)","title":"Prerequisites"},{"location":"release_v2.0/#new-features","text":"Entire re-design and stabilization of the internal infrastructure to manage GPU device. PostgreSQL backend process simultaneously uses only one GPU at most. In case of multi-GPUs installation, it assumes combination use with CPU parallel execution of PostgreSQL. Usually, it is not a matter because throughput of CPU to provide data to GPU is much narrower than capability of GPU processors. We prioritized simpleness of the software architecture. We began to utilize the demand paging feature of GPU device memory supported at the GPU models since Pascal generation. In most of SQL workloads, we cannot know exact size of the required result buffer prior to its execution, therefore, we had allocated more buffer than estimated buffer length, and retried piece of the workloads if estimated buffer size is not sufficient actually. This design restricts available resources of GPU which can be potentially used for other concurrent processes, and complicated error-retry logic was a nightmare for software quality. The demand paging feature allows to eliminate and simplify these stuffs. We stop to use CUDA asynchronous interface. Use of the demand paging feature on GPU device memory makes asynchronous APIs for DMA (like cuMemCpyHtoD ) perform synchronously, then it reduces concurrency and usage ratio of GPU kernels. Instead of the CUDA asynchronous APIs, PG-Strom manages its own worker threads which call synchronous APIs for each. As a by-product, we also could eliminate asynchronous callbacks ( cuStreamAddCallback ), it allows to use MPS daemon which has a restriction at this API. CPU+GPU Hybrid Parallel Execution CPU parallel execution at PostgreSQL v9.6 is newly supported. CustomScan logic of GpuScan, GpuJoin and GpuPreAgg provided by PG-Strom are executable on multiple background worker processes of PostgreSQL in parallel. Limitation: PG-Strom's own statistics displayed at EXPLAIN ANALYZE if CPU parallel execution. Because PostgreSQL v9.6 does not provide ShutdownCustomScan callback of the CustomScan interface, coordinator process has no way to reclaim information of worker processes prior to the release of DSM (Dynamic Shared Memory) segment. SSD-to-GPU Direct SQL Execution By cooperation with the nvme_strom Linux kernel module, it enables to load PostgreSQL's data blocks on NVMe-SSD to GPU device memory directly, bypassing the CPU and host buffer. This feature enables to apply PG-Strom on the area which have to process large data set more than system RAM size. It allows to pull out pretty high throughput close to the hardware limitation because its data stream skips block-device or filesystem layer. Then, GPU runs SQL workloads that usually reduce the amount of data to be processed by CPU. The chemical reaction of these characteristics enables to redefine GPU's role as accelerator of I/O workloads also, not only computing intensive workloads. In-memory Columnar Cache For middle size data-set loadable onto the system RAM, it allows to cache data-blocks in column format which is more suitable for GPU computing. If cached data-blocks are found during table scan, PG-Strom prefers to reference the columnar cache more than shared buffer of PostgreSQL. In-memory columnar cache can be built synchronously, or asynchronously by the background workers. You may remember very early revision of PG-Strom had similar feature. In case when a cached tuple gets updated, the latest in-memory columnar cache which we newly implemented in v2.0 invalidates the cache block which includes the updated tuples. It never updates the columnar cache according to the updates of row-store, so performance degradation is quite limited. GPU Memory Store (gstore_fdw) It enables to write to / read from preserved GPU device memory region by SELECT/INSERT/UPDATE/DELETE in SQL-level, using foreign table interface. In v2.0, only pgstrom internal data format is supported. It saves written data using PG-Strom's buffer format of KDS_FORMAT_COLUMN . It can compress variable length data using LZ algorithm. In v2.0, GPU memory store can be used as data source of PL/CUDA user defined function. Redesign and performance improvement of GpuJoin and GpuPreAgg Stop using Dynamic Parallelism which we internally used in GpuJoin and GpuPreAgg, and revised entire logic of these operations. Old design had a problem of less GPU usage ratio because a GPU kernel which launches GPU sub-kernel and just waits for its completion occupied GPU's execution slot. A coproduct of this redesign is suspend/resume of GpuJoin. In principle, JOIN operation of SQL may generate larger number of rows than number of input rows, but preliminary not predictive. The new design allows to suspend GPU kernel once buffer available space gets lacked, then resume with new result buffer. It simplifies size estimation logic of the result buffer, and eliminates GPU kernel retry by lack of buffer on run-time. GpuPreAgg+GpuJoin+GpuScan combined GPU kernel In case when GPU executable SCAN, JOIN and GROUP BY are serially cascaded, a single GPU kernel invocation runs a series of tasks equivalent to the GpuScan, GpuJoin and GpuPreAgg. This is an approach to minimize data exchange between CPU and GPU. For example, result buffer of GpuJoin is used as input buffer of GpuPreAgg. This feature is especially valuable if combined with SSD-to-GPU Direct SQL Execution. PL/CUDA Enhancement #plcuda_include is enhanced to specify SQL function which returns text type. It can change the code block to inject according to the argument, so it also allows to generate multiple GPU kernel variations, not only inclusion of externally defined functions. If PL/CUDA takes reggstore type argument, GPU kernel function receives pointer of the GPU memory store. Note that it does not pass the OID value. Other Enhancement lo_import_gpu and lo_export_gpu functions allows to import contents of the GPU device memory acquired by external applications directly, or export contents of the largeobject to the GPU device memory. Packaging Add RPM packages to follow the PostgreSQL packages distributed by PostgreSQL Global Development Group. All the software packages are available at HeteroDB SWDC(Software Distribution Center) and downloadable. Document PG-Strom documentation was entirely rewritten using markdown and mkdocs. It makes documentation maintenance easier than the previous HTML based approach, so expects timely updates according to the development of new features. Test Regression test for PG-Strom was built on top of the regression test framework of PostgreSQL.","title":"New Features"},{"location":"release_v2.0/#dropped-features","text":"PostgreSQL v9.5 Support PostgreSQL v9.6 had big changes in both of the optimizer and executor to support CPU parallel query execution. The biggest change for extension modules that interact them is an enhancement of the interface called \"upper planner path-ification\". It allows to choose an optimal execution-plan from the multiple candidates based on the estimated cost, even if it is aggregation or sorting. It is fundamentally different from the older way where we rewrote query execution plan to inject GpuPreAgg using the hooks. It allows to inject GpuPreAgg node in more reasonable and reliable way, and we could drop complicated (and buggy) logic to rewrite query execution plan once constructed. CustomScan interface is also enhanced to support CPU parallel execution. Due to the reason, we dropped PostgreSQL v9.5 support to follow these new enhancement. GpuSort feature We dropped GpuSort because we have little advantages in the performance. Sorting is one of the GPU suitable workloads. However, in case when we try to sort data blocks larger than GPU device memory, we have to split the data blocks into multiple chunks, then partially sort them and merge them by CPU to generate final results. Larger chunk size is better to reduce the load to merge multiple chunks by CPU, on the other hands, larger chunk size takes larger lead time to launch GPU kernel to sort. It means here is a trade-off; which disallows asynchronous processing by PG-Strom to make data transfer latency invisible. It is hard to solve the problem, or too early to solve the problem, we dropped GpuSort feature once.","title":"Dropped features"},{"location":"release_v2.2/","text":"PG-Strom v2.2 Release PG-Strom Development Team (1-May-2019) Overview Major enhancement in PG-Strom v2.2 includes: Table partitioning support Columnar store support with Arrow_Fdw Pre-built GPU binary support Enables to implement GPU functions that returns variable length data GpuSort support on GPU memory store (Gstore_Fdw) NVME-oF support (Experimental) Prerequisites PostgreSQL v9.6, v10, v11 CUDA Toolkit 10.1 Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or Volta) New Features Table partitioning support If multi-GPUs configuration, an optimal GPU shall be chosen according to the physical distance between GPU and child tables that construct a partition. If PG-Strom cannot identify the distance from PCIe-bus topology, like NVME-oF configuration, DBA can configure the relation of GPU and NVME-SSD using pg_strom.nvme_distance_map . When we join a partitioned table with non-partition tables, this version can produce a query execution plan that preliminary joins the non-partitioned table with partition child tables for each, and gather the results from child tables. This feature is proposed to PostgreSQL v13 core, as Asymmetric Partition-wise JOIN. Columnar store support with Arrow_Fdw It supports to read external Apache Arrow files using foreign table. It also supports SSD-to-GPU Direct SQL on Apache Arrow files. Pre-built GPU binary support When GPU binary code is generated from SQL, the older version wrote out eitire CUDA C source code, including static portions like libraries, then NVRTC(NVIDIA Run-Time Compiker) built them on the fly. However, a part of complicated function consumed much longer compilation time. v2.2 preliminary builds static functions preliminary, and only dynamic portion from SQL are built dynamically. It reduces the time for GPU binary generation. JSONB data type support This version allows to reference elements of JSONB object, and to utilize them as numeric or test . Enables to implement GPU functions that returns variable length data This version allows to implement SQL functions that returns variable-length data, like textcat , on GPU devices. GpuSort support on GPU memory store (Gstore_Fdw) This version allows to read data from GPU memory store for SQL workloads execution, not only PL/CUDA. Addition of regression test Several simple regression tests are added. NVME-oF support (Experimental) It supports SSD-to-GPU Direct SQL from remote SSD disks which are mounted using NVME-over-Fabric. Please note that it is an experimental feature, and it needs to replace the nvme_rdma kernel module on Red Hat Enterprise Linux 7.x / CentOS 7.x. Features to be deprecated PostgreSQL v9.6 support CustomScan API in PostgreSQL v9.6 lacks a few APIs to handle dynamic shared memory (DSM), so it is unable to collect run-time statistics. It also changes the way to keep expression objects internally, therefore, we had to put #if ... #endif blocks at no little points. It has damaged to code maintainability. Due to the problems, this is the last version to support PostgreSQL v9.6. If you applied PG-Strom on PostgreSQL v9.6, let us recommend to move PostgreSQL v11 as soon as possible. The pgstrom format of Gstore_Fdw foreign table The internal data format on GPU memory store (Gstore_Fdw) is originally designed for data source of PL/CUDA procedures. It is our own format, and used PostgreSQL's data representations as is, like variable-length data, numeric, and so on. After that, NVIDIA released RAPIDS(cuDF), based on Apache Arrow, for data exchange on GPU, then its adoption becomes wider on machine-learning application and Python software stack. PG-Strom will switch its internal data format of Gstore_Fdw, to improve interoperability with these machine-learning software, then existing data format shall be deprecated. Dropped Features In-memory columnar cache As results of use-case analysis, we concluded Arrow_Fdw can replace this feature in most cases. Due to feature duplication, we dropped the in-memory columnar cache.","title":"PG-Strom v2.2"},{"location":"release_v2.2/#pg-strom-v22-release","text":"PG-Strom Development Team (1-May-2019)","title":"PG-Strom v2.2 Release"},{"location":"release_v2.2/#overview","text":"Major enhancement in PG-Strom v2.2 includes: Table partitioning support Columnar store support with Arrow_Fdw Pre-built GPU binary support Enables to implement GPU functions that returns variable length data GpuSort support on GPU memory store (Gstore_Fdw) NVME-oF support (Experimental)","title":"Overview"},{"location":"release_v2.2/#prerequisites","text":"PostgreSQL v9.6, v10, v11 CUDA Toolkit 10.1 Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or Volta)","title":"Prerequisites"},{"location":"release_v2.2/#new-features","text":"Table partitioning support If multi-GPUs configuration, an optimal GPU shall be chosen according to the physical distance between GPU and child tables that construct a partition. If PG-Strom cannot identify the distance from PCIe-bus topology, like NVME-oF configuration, DBA can configure the relation of GPU and NVME-SSD using pg_strom.nvme_distance_map . When we join a partitioned table with non-partition tables, this version can produce a query execution plan that preliminary joins the non-partitioned table with partition child tables for each, and gather the results from child tables. This feature is proposed to PostgreSQL v13 core, as Asymmetric Partition-wise JOIN. Columnar store support with Arrow_Fdw It supports to read external Apache Arrow files using foreign table. It also supports SSD-to-GPU Direct SQL on Apache Arrow files. Pre-built GPU binary support When GPU binary code is generated from SQL, the older version wrote out eitire CUDA C source code, including static portions like libraries, then NVRTC(NVIDIA Run-Time Compiker) built them on the fly. However, a part of complicated function consumed much longer compilation time. v2.2 preliminary builds static functions preliminary, and only dynamic portion from SQL are built dynamically. It reduces the time for GPU binary generation. JSONB data type support This version allows to reference elements of JSONB object, and to utilize them as numeric or test . Enables to implement GPU functions that returns variable length data This version allows to implement SQL functions that returns variable-length data, like textcat , on GPU devices. GpuSort support on GPU memory store (Gstore_Fdw) This version allows to read data from GPU memory store for SQL workloads execution, not only PL/CUDA. Addition of regression test Several simple regression tests are added. NVME-oF support (Experimental) It supports SSD-to-GPU Direct SQL from remote SSD disks which are mounted using NVME-over-Fabric. Please note that it is an experimental feature, and it needs to replace the nvme_rdma kernel module on Red Hat Enterprise Linux 7.x / CentOS 7.x.","title":"New Features"},{"location":"release_v2.2/#features-to-be-deprecated","text":"PostgreSQL v9.6 support CustomScan API in PostgreSQL v9.6 lacks a few APIs to handle dynamic shared memory (DSM), so it is unable to collect run-time statistics. It also changes the way to keep expression objects internally, therefore, we had to put #if ... #endif blocks at no little points. It has damaged to code maintainability. Due to the problems, this is the last version to support PostgreSQL v9.6. If you applied PG-Strom on PostgreSQL v9.6, let us recommend to move PostgreSQL v11 as soon as possible. The pgstrom format of Gstore_Fdw foreign table The internal data format on GPU memory store (Gstore_Fdw) is originally designed for data source of PL/CUDA procedures. It is our own format, and used PostgreSQL's data representations as is, like variable-length data, numeric, and so on. After that, NVIDIA released RAPIDS(cuDF), based on Apache Arrow, for data exchange on GPU, then its adoption becomes wider on machine-learning application and Python software stack. PG-Strom will switch its internal data format of Gstore_Fdw, to improve interoperability with these machine-learning software, then existing data format shall be deprecated.","title":"Features to be deprecated"},{"location":"release_v2.2/#dropped-features","text":"In-memory columnar cache As results of use-case analysis, we concluded Arrow_Fdw can replace this feature in most cases. Due to feature duplication, we dropped the in-memory columnar cache.","title":"Dropped Features"},{"location":"release_v2.3/","text":"PG-Strom v2.3 Release PG-Strom Development Team (1-Apr-2020) Overview Major changes in PG-Strom v2.3 includes: GpuJoin supports parallel construction of inner buffer Arrow_Fdw now becomes writable; supports INSERT/TRUNCATE. pg2arrow command supports 'append' mode. mysql2arrow command was added. Prerequisites PostgreSQL v10, v11, v12 CUDA Toolkit 10.1 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or Volta) New Features GpuJoin supports parallel construction of inner buffer The older version construct inner buffer of GpuJoin by the backend process only. This restriction leads a problem; parallel scan of partitioned table delays extremely. This version allows both of the backend and worker processes to construct inner buffer. In case when we scan a partitioned table, any processes that is assigned to a particular child table can start GpuJoin operations immediately. Refactoring of the partition-wise asymmetric GpuJoin By the refactoring of the partition-wise asymmetric GpuJoin, optimizer becomes to prefer multi-level GpuJoin in case when it offers cheaper execution cost. Arrow_Fdw becomes writable; INSERT/TRUNCATE supported Arrow_Fdw foreign table allows bulk-loading by INSERT and data elimination by pgstrom.arrow_fdw_truncate . pg2arrow command supports 'append' mode. We added --append option for pg2arrow command. As literal, it appends query results on existing Apache Arrow file. Also, -t table option was added as an alias of SELECT * FROM table . mysql2arrow command was added. We added mysql2arrow command that connects to MySQL server, not PostgreSQL, and write out SQL query results as Apache Arrow files. It has equivalent functionality to pg2arrow except for enum data type. mysql2arrow saves enum values as flat Utf8 values without DictionaryBatch chunks. Regression test was added Several test cases were added according to the PostgreSQL regression test framework. Significant bug fixes Revised cache invalidation logic for GPU device functions / types The older version had invalidated all the metadata cache entries of GPU device functions / type on execution of ALTER command. It was revised to invalidate the entries that are actually updated. Revised extreme performance degradation if GROUP BY has same grouping key twice or even number times. GpuPreAgg combined hash values of grouping key of GROUP BY using XOR. So, if case when same column appeared even number time, it always leads 0 for hash-index problematically. Now we add a randomization for better hash distribution. Potential infinite loop on GpuScan By uninitialized values, GpuScan potentially goes to infinite loop when SSD2GPU Direct SQL is available. Potential GPU kernel crash on GpuJoin By uninitialized values, GpuJoin potentially makes GPU kernel crash when 3 or more tables are joined. Deprecated Features PostgreSQL v9.6 Support CustomScan API in PostgreSQL v9.6 lacks a few APIs to handle dynamic shared memory (DSM). It has been a problem to handle a common code for v10 or later. To avoid the problem, we dropped PostgreSQL v9.6 support in this version. PL/CUDA According to the usecase analytics, users prefer familiar programming language environment like Python, rather than own special environment. A combination of Arrow_Fdw's GPU export functionality and CuPy invocation at PL/Python is a successor of PL/CUDA, for in-database machine-learning / statistical analytics. Gstore_Fdw This feature is replaced by the writable Arrow_Fdw and its GPU export functionality. Largeobject export to/import from GPU According to the usecase analytics, we determined this feature is not needed.","title":"PG-Strom v2.3"},{"location":"release_v2.3/#pg-strom-v23-release","text":"PG-Strom Development Team (1-Apr-2020)","title":"PG-Strom v2.3 Release"},{"location":"release_v2.3/#overview","text":"Major changes in PG-Strom v2.3 includes: GpuJoin supports parallel construction of inner buffer Arrow_Fdw now becomes writable; supports INSERT/TRUNCATE. pg2arrow command supports 'append' mode. mysql2arrow command was added.","title":"Overview"},{"location":"release_v2.3/#prerequisites","text":"PostgreSQL v10, v11, v12 CUDA Toolkit 10.1 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or Volta)","title":"Prerequisites"},{"location":"release_v2.3/#new-features","text":"GpuJoin supports parallel construction of inner buffer The older version construct inner buffer of GpuJoin by the backend process only. This restriction leads a problem; parallel scan of partitioned table delays extremely. This version allows both of the backend and worker processes to construct inner buffer. In case when we scan a partitioned table, any processes that is assigned to a particular child table can start GpuJoin operations immediately. Refactoring of the partition-wise asymmetric GpuJoin By the refactoring of the partition-wise asymmetric GpuJoin, optimizer becomes to prefer multi-level GpuJoin in case when it offers cheaper execution cost. Arrow_Fdw becomes writable; INSERT/TRUNCATE supported Arrow_Fdw foreign table allows bulk-loading by INSERT and data elimination by pgstrom.arrow_fdw_truncate . pg2arrow command supports 'append' mode. We added --append option for pg2arrow command. As literal, it appends query results on existing Apache Arrow file. Also, -t table option was added as an alias of SELECT * FROM table . mysql2arrow command was added. We added mysql2arrow command that connects to MySQL server, not PostgreSQL, and write out SQL query results as Apache Arrow files. It has equivalent functionality to pg2arrow except for enum data type. mysql2arrow saves enum values as flat Utf8 values without DictionaryBatch chunks. Regression test was added Several test cases were added according to the PostgreSQL regression test framework.","title":"New Features"},{"location":"release_v2.3/#significant-bug-fixes","text":"Revised cache invalidation logic for GPU device functions / types The older version had invalidated all the metadata cache entries of GPU device functions / type on execution of ALTER command. It was revised to invalidate the entries that are actually updated. Revised extreme performance degradation if GROUP BY has same grouping key twice or even number times. GpuPreAgg combined hash values of grouping key of GROUP BY using XOR. So, if case when same column appeared even number time, it always leads 0 for hash-index problematically. Now we add a randomization for better hash distribution. Potential infinite loop on GpuScan By uninitialized values, GpuScan potentially goes to infinite loop when SSD2GPU Direct SQL is available. Potential GPU kernel crash on GpuJoin By uninitialized values, GpuJoin potentially makes GPU kernel crash when 3 or more tables are joined.","title":"Significant bug fixes"},{"location":"release_v2.3/#deprecated-features","text":"PostgreSQL v9.6 Support CustomScan API in PostgreSQL v9.6 lacks a few APIs to handle dynamic shared memory (DSM). It has been a problem to handle a common code for v10 or later. To avoid the problem, we dropped PostgreSQL v9.6 support in this version. PL/CUDA According to the usecase analytics, users prefer familiar programming language environment like Python, rather than own special environment. A combination of Arrow_Fdw's GPU export functionality and CuPy invocation at PL/Python is a successor of PL/CUDA, for in-database machine-learning / statistical analytics. Gstore_Fdw This feature is replaced by the writable Arrow_Fdw and its GPU export functionality. Largeobject export to/import from GPU According to the usecase analytics, we determined this feature is not needed.","title":"Deprecated Features"},{"location":"release_v3.0/","text":"PG-Strom v3.0 Release PG-Strom Development Team (29-Jun-2021) Overview Major changes in PG-Strom v3.0 are as follows: NVIDIA GPUDirect Storage (cuFile) is now supported. Several PostGIS functions are executable on GPUs. GpuJoin using GiST index is now supported. GPU Cache mechanism is newly implemented. User-defined GPU data types/functions/operators are experimentally supported. Software license was switched from GPLv2 to PostgreSQL license. Prerequisites PostgreSQL v11, v12, v13 CUDA Toolkit 11.2 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or newer) NVIDIA GPUDirect Storage GPUDirect Storage , has been developed by NVIDIA, is now supported as a driver for GPU Direct SQL , in addition to the existing nvme_strom kernel module. Both of drivers have almost equivalent functionalities and performance, but supports of GPUDirect Storage enables P2P direct read from NVME-oF (NVME over Fabrics) devices, SDS (Software Defined Storage) devices and shared filesystem built on these devices. Therefore, it offers larger and more flexible storage configuration. We can use GPUDirect SQL to scan PostgreSQL's heap table and Apache Arrow files. It can expect significant performance improvement for the workloads where table scans are the major bottleneck, in either driver cases. The performance measurement below is by SSBM (Star Schema Benchmark) using 1xGPU and 4xNVME-SSDs under the GPUDirect Storage driver. It shows number of rows processed per unit time is significantly improved regardless of the storage system; either PostgreSQL heap or Apache Arrow. In comparison of the read throughput from NVME-SSD drives during the query execution, it shows the table scan by GPUDirect Storage pulls out almost optimal performance close to the hardware limitation, much faster than the scan by filesystem (PostgreSQL Heap Storage). GPU-PostGIS and GiST-index We have implemented GPU versions of several PostGIS functions. When these PostGIS functions are used in qualifier clauses (like, WHERE-clause), PG-Strom will automatically generate a GPU program to execute it on the GPU. The main target of GPU version of PostGIS is the workload to check the real-time location data of mobile devices, like smartphones or vehicles, against the area definition data like boundary of municipality or school districts. For example, when you want to deliver an advertisement to smartphonws in a particular area, or when you want to deliver traffic jam information to cara in a particular area, it is effective in the process of searching for the corresponding device using the position as a key. In the following example, it creates 16 million random points data in a rectangular area that includes the Tokyo region, then count up number of the points contained in the cities in Tokyo for each. The vanilla PostGIS and GiST index took more than 160sec, on the other hand, GPU-version of PostGIS and GiST index responded in 0.830 sec. GPU Cache GPU Cache mechanism can store a copy of the target table in a pre-allocated area on the GPU device memory. It was designed for efficient execution of analytical/search queries on frequently updated data with relatively small data size (~10GB). The GPU can process SQL workloads by referring to GPU Cache instead of loading data from tables when executing analytical/search queries. This is typically a workload that keeps real-time data from millions of devices on the GPU and frequently updates timestamps and location information. When the table with GPU cache is updated, the update history is stored in the on-memory redo log buffer, then applied to the GPU cache at a regular intervals or before executing the analysis / search workload. By this mechanism, it achieved both of frequent updates and consistency of GPU cache. User-defined GPU datatype/functions A new API is provided to add user-defined GPU data types/functions. This allows users to define and implement their own niche data types and SQL functions to process them, without modifying PG-Strom itself. Notice This API is still under the experimental state, so its specifications may be changed without notifications. Also note that we assume the users of this API well understand PG-Strom internal, so no documentations are provided right now. PostgreSQL License Adoption PG-Strom v3.0 or later adopt the PostgreSQL License. The earlier version of PG-Strom has used GPLv2 due to the historical background, however, we recognized several concerns that license mismatch prevents joint solution development using PG-Strom core features and comprehensive tools. Other updates Unique int1 (8-bit integer) data type and related operators are now supported. --inner-join and --outer-join options are now available for pg2arrow . Apache Arrow files having more columns than the limit of PostgreSQL can now be generated. In a multi-GPU environment, the GPU Memory Keeper background worker will now be launched for each GPU. PostgreSQL v13.x is now supported. CUDA 11.2 and Ampere generation GPUs are now supported. GPUDirect SQL now supports ScaleFlux's Computational Storage CSD2000 series (only cuFile driver). Miscellaneous bug fixes Deprecated Features Support for PostgreSQL v10.x has been discontinued. The feature to link data with Python scripts (PyStrom) has been discontinued.","title":"PG-Strom v3.0"},{"location":"release_v3.0/#pg-strom-v30-release","text":"PG-Strom Development Team (29-Jun-2021)","title":"PG-Strom v3.0 Release"},{"location":"release_v3.0/#overview","text":"Major changes in PG-Strom v3.0 are as follows: NVIDIA GPUDirect Storage (cuFile) is now supported. Several PostGIS functions are executable on GPUs. GpuJoin using GiST index is now supported. GPU Cache mechanism is newly implemented. User-defined GPU data types/functions/operators are experimentally supported. Software license was switched from GPLv2 to PostgreSQL license.","title":"Overview"},{"location":"release_v3.0/#prerequisites","text":"PostgreSQL v11, v12, v13 CUDA Toolkit 11.2 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal or newer)","title":"Prerequisites"},{"location":"release_v3.0/#nvidia-gpudirect-storage","text":"GPUDirect Storage , has been developed by NVIDIA, is now supported as a driver for GPU Direct SQL , in addition to the existing nvme_strom kernel module. Both of drivers have almost equivalent functionalities and performance, but supports of GPUDirect Storage enables P2P direct read from NVME-oF (NVME over Fabrics) devices, SDS (Software Defined Storage) devices and shared filesystem built on these devices. Therefore, it offers larger and more flexible storage configuration. We can use GPUDirect SQL to scan PostgreSQL's heap table and Apache Arrow files. It can expect significant performance improvement for the workloads where table scans are the major bottleneck, in either driver cases. The performance measurement below is by SSBM (Star Schema Benchmark) using 1xGPU and 4xNVME-SSDs under the GPUDirect Storage driver. It shows number of rows processed per unit time is significantly improved regardless of the storage system; either PostgreSQL heap or Apache Arrow. In comparison of the read throughput from NVME-SSD drives during the query execution, it shows the table scan by GPUDirect Storage pulls out almost optimal performance close to the hardware limitation, much faster than the scan by filesystem (PostgreSQL Heap Storage).","title":"NVIDIA GPUDirect Storage"},{"location":"release_v3.0/#gpu-postgis-and-gist-index","text":"We have implemented GPU versions of several PostGIS functions. When these PostGIS functions are used in qualifier clauses (like, WHERE-clause), PG-Strom will automatically generate a GPU program to execute it on the GPU. The main target of GPU version of PostGIS is the workload to check the real-time location data of mobile devices, like smartphones or vehicles, against the area definition data like boundary of municipality or school districts. For example, when you want to deliver an advertisement to smartphonws in a particular area, or when you want to deliver traffic jam information to cara in a particular area, it is effective in the process of searching for the corresponding device using the position as a key. In the following example, it creates 16 million random points data in a rectangular area that includes the Tokyo region, then count up number of the points contained in the cities in Tokyo for each. The vanilla PostGIS and GiST index took more than 160sec, on the other hand, GPU-version of PostGIS and GiST index responded in 0.830 sec.","title":"GPU-PostGIS and GiST-index"},{"location":"release_v3.0/#gpu-cache","text":"GPU Cache mechanism can store a copy of the target table in a pre-allocated area on the GPU device memory. It was designed for efficient execution of analytical/search queries on frequently updated data with relatively small data size (~10GB). The GPU can process SQL workloads by referring to GPU Cache instead of loading data from tables when executing analytical/search queries. This is typically a workload that keeps real-time data from millions of devices on the GPU and frequently updates timestamps and location information. When the table with GPU cache is updated, the update history is stored in the on-memory redo log buffer, then applied to the GPU cache at a regular intervals or before executing the analysis / search workload. By this mechanism, it achieved both of frequent updates and consistency of GPU cache.","title":"GPU Cache"},{"location":"release_v3.0/#user-defined-gpu-datatypefunctions","text":"A new API is provided to add user-defined GPU data types/functions. This allows users to define and implement their own niche data types and SQL functions to process them, without modifying PG-Strom itself. Notice This API is still under the experimental state, so its specifications may be changed without notifications. Also note that we assume the users of this API well understand PG-Strom internal, so no documentations are provided right now.","title":"User-defined GPU datatype/functions"},{"location":"release_v3.0/#postgresql-license-adoption","text":"PG-Strom v3.0 or later adopt the PostgreSQL License. The earlier version of PG-Strom has used GPLv2 due to the historical background, however, we recognized several concerns that license mismatch prevents joint solution development using PG-Strom core features and comprehensive tools.","title":"PostgreSQL License Adoption"},{"location":"release_v3.0/#other-updates","text":"Unique int1 (8-bit integer) data type and related operators are now supported. --inner-join and --outer-join options are now available for pg2arrow . Apache Arrow files having more columns than the limit of PostgreSQL can now be generated. In a multi-GPU environment, the GPU Memory Keeper background worker will now be launched for each GPU. PostgreSQL v13.x is now supported. CUDA 11.2 and Ampere generation GPUs are now supported. GPUDirect SQL now supports ScaleFlux's Computational Storage CSD2000 series (only cuFile driver). Miscellaneous bug fixes","title":"Other updates"},{"location":"release_v3.0/#deprecated-features","text":"Support for PostgreSQL v10.x has been discontinued. The feature to link data with Python scripts (PyStrom) has been discontinued.","title":"Deprecated Features"},{"location":"release_v5.0/","text":"PG-Strom v5.0 Release PG-Strom Development Team (15-Dec-2023) Overview Major changes in PG-Strom v5.0 are as follows: The code base has been re-designed entirely with various improvement. Process model was revised to multi-threaded background worker (PG-Strom GPU Service) from multi-process model. It reduced GPU resource consumption and overhead of task-switching. GPU device code dynamically generated using CUDA C++ was replaced by the pseudo kernel code. It eliminates just-in-time compilation using NVRTC, and improved the first response time. This is also a groundwork for the future support of CSD(Computational Storage Drive) and DPU(Data Processing Unit). GPU-Cache is now deployed on CUDA managed memory that allows overcommit of GPU device memory. Data layout of PostgreSQL data types were revised to adjust Coalesced Memory Access. GpuPreAgg replaced entire GROUP BY implementation, then improved whole performance. GpuJoin extract tuples only once regardless of the depth of Join. Arrow_Fdw and Pg2Arrow supports min/max statistics of arrow files. Two arrow tools were added: Pca2Arrow captures network packets, and arrow2csv dumps arrow files in CSV format. Prerequisites PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal at least; Volta or newer is recommended) New Process Model In v5.0, the multi-threaded background worker process (PG-Strom GPU Service) coordinates GPU resources and task executions, and individual PostgreSQL backend processes send requests to and receive results from the GPU service over IPC. Before the v3.x series, each PostgreSQL backend controls GPU devices individually. This design helps software debugging by easy identification of the problematic code when software quality of CUDA and PG-Strom were not sufficient, however, it extremely consumed GPU resources according to increase of database sessions, and was not recommended software architecture from the standpoint of task-switching. This design change makes PG-Strom v5.0 more stable towards increase of concurrent database sessions, and improves heavy GPU task's performance. Pseudo device code PG-Strom v5.0 now generates its own \"pseudo-code\" from the supplied SQL, and the GPU device code works as an interpreter to execute this \"pseudo-code\". Unlike v3.x series, it does not generate CUDA C++ native code no longer. At first glance, this may appear to be a factor in performance degradation. However, dynamic code generation was originally targeted for only a small part of the code that changes with each query, such as the WHERE clause; most implementations were statically built, and runtime compilation was handled by NVRTC. (approximately 150ms) can now be omitted, contributing to improved response time. The \"pseudo-code\" is a set of low-level commands, can be displayed in EXPLAIN VERBOSE. For example, the query below contains the expression lo_quantity > 10 in the WHERE clause. This operation is defined as Scan Quals OpCode to call the numeric_gt function which compares the magnitude relationship between the lo_quantity column and the constant 10 . postgres=# explain verbose select count(*), sum(lo_quantity), lo_shipmode from lineorder where lo_quantity > 10 group by lo_shipmode; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- HashAggregate (cost=3242387.01..3242387.10 rows=7 width=51) Output: pgstrom.fcount((pgstrom.nrows())), pgstrom.sum_fp_num((pgstrom.psum((lo_quantity)::double precision))), lo_shipmode Group Key: lineorder.lo_shipmode -> Custom Scan (GpuPreAgg) on public.lineorder (cost=3242386.89..3242386.96 rows=7 width=51) Output: (pgstrom.nrows()), (pgstrom.psum((lo_quantity)::double precision)), lo_shipmode GPU Projection: pgstrom.nrows(), pgstrom.psum((lo_quantity)::double precision), lo_shipmode GPU Scan Quals: (lo_quantity > '10'::numeric) [rows: 600128800 -> 479262800] GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , KVecs-Buffer: nbytes: 83968, ndims: 2, items=[kvec0=<0x0000-dfff, type='numeric', expr='lo_quantity'>, kvec1=<0xe000-147ff, type='bpchar', expr='lo_shipmode'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, ]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, ]}}} Scan Quals OpCode: {Func(bool)::numeric_gt args=[{Var(numeric): slot=0, expr='lo_quantity'}, {Const(numeric): value='10'}]} Group-By KeyHash OpCode: {HashValue arg={SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}} Group-By KeyLoad OpCode: {LoadVars(depth=-2): kvars=[]} Group-By KeyComp OpCode: {Func(bool)::bpchareq args=[{Var(bpchar): slot=1, expr='lo_shipmode'}, {Var(bpchar): slot=2, expr='lo_shipmode'}]} Partial Aggregation OpCode: {AggFuncs args=[{SaveExpr: arg={Func(float8)::float8 arg={Var(numeric): kvec=0x0000-e000, expr='lo_quantity'}}}, {SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}]} Partial Function BufSz: 24 (18 rows) Although not currently implemented, this pseudo-code is also designed to offload SQL processing to a CSD (Computational Storage Drive) or DPU (Data Processing Unit) in the future. Improvement of data layout GPU has a wider memory bandwidth than CPU, but in order to take advantage of this performance, it is necessary to satisfy the condition of coalesced memory access, which accesses nearby memory areas at the same time. In v5.0, the layout of PostgreSQL data types in GPU device code has been improved to make them more suitable for Coalesced Memory Access. If we would use the PostgreSQL data type as is, fields that are referenced at certain times will be placed in discrete positions, making it impossible to effectively utilize the read bandwidth from DRAM. By arranging multiple of these for each field, adjacent cores can read data from adjacent areas, making it easier to satisfy the conditions of Coalesced Memory Access. This improvement is aimed at bringing out sufficient execution performance not only for high-end GPU products with extremely high performance memory bandwidth, but also for mid-end GPUs. Arrow_Fdw supports min/max statistics Pg2Arrow can now generate Apache Arrow files with min/max statistics. Its new option --stat=COLUMN_NAME records the maximum/minimum value of the specified column for each RecordBatch and embeds it in the footer using Apache Arrow's Custom-Metadata mechanism. When reading an Apache Arrow file using Arrow_Fdw, perform like a range index scan using the above min/max statistics. For example, if the WHERE-clause for the Arrow_Fdw foreign table is as follows: WHERE ymd BETERRN '2020-01-01'::date AND '2021-12-31'::date Arrow_Fdw will skip the record-batch where the maximum value of the ymd field is less than '2020-01-01'::date , or the record-batch where the minimum value of ymd field is greater than '2021-12-31 ::date`, because it is obvious that it does not match the search conditions. As a result, performance equivalent to narrowing down using a range index can be obtained for datasets with patterns in which records with similar values \u200b\u200bare clustered nearby, such as log data timestamps. Other changes PG-Strom v5.0 stopped support of PostgreSQL v14 or older. Plan version up v15 or later. Due to development schedule reason, v5.0 disables partition-wise GpuJoin. It shall be re-implemented at the near future version.","title":"PG-Strom v5.0"},{"location":"release_v5.0/#pg-strom-v50-release","text":"PG-Strom Development Team (15-Dec-2023)","title":"PG-Strom v5.0 Release"},{"location":"release_v5.0/#overview","text":"Major changes in PG-Strom v5.0 are as follows: The code base has been re-designed entirely with various improvement. Process model was revised to multi-threaded background worker (PG-Strom GPU Service) from multi-process model. It reduced GPU resource consumption and overhead of task-switching. GPU device code dynamically generated using CUDA C++ was replaced by the pseudo kernel code. It eliminates just-in-time compilation using NVRTC, and improved the first response time. This is also a groundwork for the future support of CSD(Computational Storage Drive) and DPU(Data Processing Unit). GPU-Cache is now deployed on CUDA managed memory that allows overcommit of GPU device memory. Data layout of PostgreSQL data types were revised to adjust Coalesced Memory Access. GpuPreAgg replaced entire GROUP BY implementation, then improved whole performance. GpuJoin extract tuples only once regardless of the depth of Join. Arrow_Fdw and Pg2Arrow supports min/max statistics of arrow files. Two arrow tools were added: Pca2Arrow captures network packets, and arrow2csv dumps arrow files in CSV format.","title":"Overview"},{"location":"release_v5.0/#prerequisites","text":"PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal at least; Volta or newer is recommended)","title":"Prerequisites"},{"location":"release_v5.0/#new-process-model","text":"In v5.0, the multi-threaded background worker process (PG-Strom GPU Service) coordinates GPU resources and task executions, and individual PostgreSQL backend processes send requests to and receive results from the GPU service over IPC. Before the v3.x series, each PostgreSQL backend controls GPU devices individually. This design helps software debugging by easy identification of the problematic code when software quality of CUDA and PG-Strom were not sufficient, however, it extremely consumed GPU resources according to increase of database sessions, and was not recommended software architecture from the standpoint of task-switching. This design change makes PG-Strom v5.0 more stable towards increase of concurrent database sessions, and improves heavy GPU task's performance.","title":"New Process Model"},{"location":"release_v5.0/#pseudo-device-code","text":"PG-Strom v5.0 now generates its own \"pseudo-code\" from the supplied SQL, and the GPU device code works as an interpreter to execute this \"pseudo-code\". Unlike v3.x series, it does not generate CUDA C++ native code no longer. At first glance, this may appear to be a factor in performance degradation. However, dynamic code generation was originally targeted for only a small part of the code that changes with each query, such as the WHERE clause; most implementations were statically built, and runtime compilation was handled by NVRTC. (approximately 150ms) can now be omitted, contributing to improved response time. The \"pseudo-code\" is a set of low-level commands, can be displayed in EXPLAIN VERBOSE. For example, the query below contains the expression lo_quantity > 10 in the WHERE clause. This operation is defined as Scan Quals OpCode to call the numeric_gt function which compares the magnitude relationship between the lo_quantity column and the constant 10 . postgres=# explain verbose select count(*), sum(lo_quantity), lo_shipmode from lineorder where lo_quantity > 10 group by lo_shipmode; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- HashAggregate (cost=3242387.01..3242387.10 rows=7 width=51) Output: pgstrom.fcount((pgstrom.nrows())), pgstrom.sum_fp_num((pgstrom.psum((lo_quantity)::double precision))), lo_shipmode Group Key: lineorder.lo_shipmode -> Custom Scan (GpuPreAgg) on public.lineorder (cost=3242386.89..3242386.96 rows=7 width=51) Output: (pgstrom.nrows()), (pgstrom.psum((lo_quantity)::double precision)), lo_shipmode GPU Projection: pgstrom.nrows(), pgstrom.psum((lo_quantity)::double precision), lo_shipmode GPU Scan Quals: (lo_quantity > '10'::numeric) [rows: 600128800 -> 479262800] GPU-Direct SQL: enabled (GPU-0) KVars-Slot: , , , KVecs-Buffer: nbytes: 83968, ndims: 2, items=[kvec0=<0x0000-dfff, type='numeric', expr='lo_quantity'>, kvec1=<0xe000-147ff, type='bpchar', expr='lo_shipmode'>] LoadVars OpCode: {Packed items[0]={LoadVars(depth=0): kvars=[, ]}} MoveVars OpCode: {Packed items[0]={MoveVars(depth=0): items=[, ]}}} Scan Quals OpCode: {Func(bool)::numeric_gt args=[{Var(numeric): slot=0, expr='lo_quantity'}, {Const(numeric): value='10'}]} Group-By KeyHash OpCode: {HashValue arg={SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}} Group-By KeyLoad OpCode: {LoadVars(depth=-2): kvars=[]} Group-By KeyComp OpCode: {Func(bool)::bpchareq args=[{Var(bpchar): slot=1, expr='lo_shipmode'}, {Var(bpchar): slot=2, expr='lo_shipmode'}]} Partial Aggregation OpCode: {AggFuncs args=[{SaveExpr: arg={Func(float8)::float8 arg={Var(numeric): kvec=0x0000-e000, expr='lo_quantity'}}}, {SaveExpr: arg={Var(bpchar): kvec=0xe000-14800, expr='lo_shipmode'}}]} Partial Function BufSz: 24 (18 rows) Although not currently implemented, this pseudo-code is also designed to offload SQL processing to a CSD (Computational Storage Drive) or DPU (Data Processing Unit) in the future.","title":"Pseudo device code"},{"location":"release_v5.0/#improvement-of-data-layout","text":"GPU has a wider memory bandwidth than CPU, but in order to take advantage of this performance, it is necessary to satisfy the condition of coalesced memory access, which accesses nearby memory areas at the same time. In v5.0, the layout of PostgreSQL data types in GPU device code has been improved to make them more suitable for Coalesced Memory Access. If we would use the PostgreSQL data type as is, fields that are referenced at certain times will be placed in discrete positions, making it impossible to effectively utilize the read bandwidth from DRAM. By arranging multiple of these for each field, adjacent cores can read data from adjacent areas, making it easier to satisfy the conditions of Coalesced Memory Access. This improvement is aimed at bringing out sufficient execution performance not only for high-end GPU products with extremely high performance memory bandwidth, but also for mid-end GPUs.","title":"Improvement of data layout"},{"location":"release_v5.0/#arrow_fdw-supports-minmax-statistics","text":"Pg2Arrow can now generate Apache Arrow files with min/max statistics. Its new option --stat=COLUMN_NAME records the maximum/minimum value of the specified column for each RecordBatch and embeds it in the footer using Apache Arrow's Custom-Metadata mechanism. When reading an Apache Arrow file using Arrow_Fdw, perform like a range index scan using the above min/max statistics. For example, if the WHERE-clause for the Arrow_Fdw foreign table is as follows: WHERE ymd BETERRN '2020-01-01'::date AND '2021-12-31'::date Arrow_Fdw will skip the record-batch where the maximum value of the ymd field is less than '2020-01-01'::date , or the record-batch where the minimum value of ymd field is greater than '2021-12-31 ::date`, because it is obvious that it does not match the search conditions. As a result, performance equivalent to narrowing down using a range index can be obtained for datasets with patterns in which records with similar values \u200b\u200bare clustered nearby, such as log data timestamps.","title":"Arrow_Fdw supports min/max statistics"},{"location":"release_v5.0/#other-changes","text":"PG-Strom v5.0 stopped support of PostgreSQL v14 or older. Plan version up v15 or later. Due to development schedule reason, v5.0 disables partition-wise GpuJoin. It shall be re-implemented at the near future version.","title":"Other changes"},{"location":"release_v5.1/","text":"PG-Strom v5.1 Release PG-Strom Development Team (17-Apr-2024) Overview Major changes in PG-Strom v5.1 are as follows: Added support for partition-wise GPU-Join/PreAgg. GPU code is now built in the execution environment at startup. pg2arrow now support parallel execution. CUDA Stack size is now set adaptically. Cumulative bug fixes Prerequisites PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal at least; Volta or newer is recommended) Partition-wise GpuJoin/GpuPreAgg Support for PostgreSQL partitions itself was also included in PG-Strom v3.0, but execution plans often could not be created properly, therefore it could not be moved out of its experimental status. Then, in PG-Strom v5.1, we fundamentally revised the internal design, re-implemented it, and incorporated it as an official feature again. If the lineorder table below is partitioned and the date1 table is a non-partitioned table, previously all the data read from the partitioned tables under lineorder must be joined with date1 table after the consolidation of all the partition leafs by the Append node. Usually, PG-Strom bypasses the CPU and loads data from the NVME-SSD to the GPU to perform various SQL processing (GPU-Direct SQL), so the data must be returned to the CPU before JOIN. It has been a big penalty. ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate -> Hash Join Hash Cond: (lineorder.lo_orderdate = date1.d_datekey) -> Append -> Custom Scan (GpuScan) on lineorder__p1992 lineorder_1 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1993 lineorder_2 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1994 lineorder_3 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1995 lineorder_4 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1996 lineorder_5 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1997 lineorder_6 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1998 lineorder_7 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on lineorder__p1999 lineorder_8 Filter: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash -> Seq Scan on date1 Filter: (d_year = 1993) (37 rows) In PG-Strom v5.1, it is now possible to push-down JOINs with non-partitioned tables to partitioned child tables. In some cases, it is also possible to complete the GROUP-BY processing and then return much smaller results to CPU. For example, in the example below, 70 million rows extracted from a total of 600 million rows in the partitioned child tables. By performing a JOIN with the non-partitioned table date1 and then aggregation function SUM() pushed-down to the partitioned child tables, the CPU only needs to process 8 rows. Although there is a disadvantage that reading on the INNER side occurs multiple times (* This will be fixed in a future version), this type of rewriting will significantly reduce the amount of data that must be processed by the CPU, contributing to improved processing speed. To do. ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------- Aggregate -> Append -> Custom Scan (GpuPreAgg) on lineorder__p1992 lineorder_1 GPU Projection: pgstrom.psum(((lineorder_1.lo_extendedprice * lineorder_1.lo_discount))::double precision) GPU Scan Quals: ((lineorder_1.lo_discount >= '1'::numeric) AND (lineorder_1.lo_discount <= '3'::numeric) AND (lineorder_1.lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU Join Quals [1]: (lineorder_1.lo_orderdate = date1.d_datekey) ... [nrows: 11911380 -> 1700960] GPU Outer Hash [1]: lineorder_1.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1993 lineorder_2 GPU Projection: pgstrom.psum(((lineorder_2.lo_extendedprice * lineorder_2.lo_discount))::double precision) GPU Scan Quals: ((lineorder_2.lo_discount >= '1'::numeric) AND (lineorder_2.lo_discount <= '3'::numeric) AND (lineorder_2.lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU Join Quals [1]: (lineorder_2.lo_orderdate = date1.d_datekey) ... [nrows: 11980460 -> 1710824] GPU Outer Hash [1]: lineorder_2.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1994 lineorder_3 GPU Projection: pgstrom.psum(((lineorder_3.lo_extendedprice * lineorder_3.lo_discount))::double precision) GPU Scan Quals: ((lineorder_3.lo_discount >= '1'::numeric) AND (lineorder_3.lo_discount <= '3'::numeric) AND (lineorder_3.lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU Join Quals [1]: (lineorder_3.lo_orderdate = date1.d_datekey) ... [nrows: 12150700 -> 1735135] GPU Outer Hash [1]: lineorder_3.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1995 lineorder_4 GPU Projection: pgstrom.psum(((lineorder_4.lo_extendedprice * lineorder_4.lo_discount))::double precision) GPU Scan Quals: ((lineorder_4.lo_discount >= '1'::numeric) AND (lineorder_4.lo_discount <= '3'::numeric) AND (lineorder_4.lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU Join Quals [1]: (lineorder_4.lo_orderdate = date1.d_datekey) ... [nrows: 11779920 -> 1682188] GPU Outer Hash [1]: lineorder_4.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1996 lineorder_5 GPU Projection: pgstrom.psum(((lineorder_5.lo_extendedprice * lineorder_5.lo_discount))::double precision) GPU Scan Quals: ((lineorder_5.lo_discount >= '1'::numeric) AND (lineorder_5.lo_discount <= '3'::numeric) AND (lineorder_5.lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU Join Quals [1]: (lineorder_5.lo_orderdate = date1.d_datekey) ... [nrows: 11942810 -> 1705448] GPU Outer Hash [1]: lineorder_5.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1997 lineorder_6 GPU Projection: pgstrom.psum(((lineorder_6.lo_extendedprice * lineorder_6.lo_discount))::double precision) GPU Scan Quals: ((lineorder_6.lo_discount >= '1'::numeric) AND (lineorder_6.lo_discount <= '3'::numeric) AND (lineorder_6.lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU Join Quals [1]: (lineorder_6.lo_orderdate = date1.d_datekey) ... [nrows: 12069740 -> 1723574] GPU Outer Hash [1]: lineorder_6.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1998 lineorder_7 GPU Projection: pgstrom.psum(((lineorder_7.lo_extendedprice * lineorder_7.lo_discount))::double precision) GPU Scan Quals: ((lineorder_7.lo_discount >= '1'::numeric) AND (lineorder_7.lo_discount <= '3'::numeric) AND (lineorder_7.lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU Join Quals [1]: (lineorder_7.lo_orderdate = date1.d_datekey) ... [nrows: 6898138 -> 985063] GPU Outer Hash [1]: lineorder_7.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1999 lineorder_8 GPU Projection: pgstrom.psum(((lineorder_8.lo_extendedprice * lineorder_8.lo_discount))::double precision) GPU Scan Quals: ((lineorder_8.lo_discount >= '1'::numeric) AND (lineorder_8.lo_discount <= '3'::numeric) AND (lineorder_8.lo_quantity < '25'::numeric)) [rows: 150 -> 1] GPU Join Quals [1]: (lineorder_8.lo_orderdate = date1.d_datekey) ... [nrows: 1 -> 1] GPU Outer Hash [1]: lineorder_8.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) (82 rows) Build GPU code on startup Previous versions of PG-Strom was distributing pre-built binary modules for GPUs. Although this is simple, the GPU binary module often raised a runtime error depending on the combination of CUDA Toolkit and NVIDIA driver versions in the PG-Strom (PostgreSQL) execution environment. Typically, this is when the execution environment has an older version of the CUDA Toolkit or NVIDIA driver installed than the environment in which the RPM package was built. PG-Strom v5.1 has been changed to check the GPU source code and CUDA Toolkit version at startup, and build a GPU binary module if there are any difference. With this fix, PG-Strom can now utilize GPU devices and GPU binary modules for CUDA Toolkit in the execution environment. pg2arrow parallel execution pg2arrow now supports the new -n|--num-workers and -k|--parallel-keys options. -n N_WORKERS option launches the specified number of threads to connect to PostgreSQL for each, execute queries in parallel, and write the results to the Apache Arrow file. Queries can contain the special token $(N_WORKERS) and $(WORKER_ID) , which will be replaced by the number of workers and worker-specific ID values, respectively, when querying PostgreSQL. It is user's responsibility to ensure the tuples read by each worker thread do not overlap or are missing. Another -k|--parallel-key option starts a worker thread for each comma-separated key value given by the argument, and replaces $(PARALLEL_KEY) with the key in the query. The worker thread runs this query for each, then write the result as an Apache Arrow file. For example, if the lineorder table is partitioned and there are child tables lineorder__sun , lineorder__mon , ... lineorder__sat , each worker thread scans each child table of the partition according to the keys given by the -k sun,mon,tue,wed,thu,fri,sat option. This parallel key is replaced by the $(PARALLEL_KEY) in the query given by -c 'SELECT * FROM lineorder__$(PARALLEL_KEY)' option. It launches 7 worker threads which shall scan the partitioned child table for each. $ pg2arrow -d ssbm -c 'SELECT * FROM lineorder__$(PARALLEL_KEY)' -o /path/to/f_lineorder.arrow -k=sun,mon,tue,wed,thu,fri,sat --progress worker:1 SQL=[SELECT * FROM lineorder__sun] worker:3 SQL=[SELECT * FROM lineorder__tue] worker:2 SQL=[SELECT * FROM lineorder__mon] worker:4 SQL=[SELECT * FROM lineorder__wed] worker:5 SQL=[SELECT * FROM lineorder__thu] : :","title":"PG-Strom v5.1"},{"location":"release_v5.1/#pg-strom-v51-release","text":"PG-Strom Development Team (17-Apr-2024)","title":"PG-Strom v5.1 Release"},{"location":"release_v5.1/#overview","text":"Major changes in PG-Strom v5.1 are as follows: Added support for partition-wise GPU-Join/PreAgg. GPU code is now built in the execution environment at startup. pg2arrow now support parallel execution. CUDA Stack size is now set adaptically. Cumulative bug fixes","title":"Overview"},{"location":"release_v5.1/#prerequisites","text":"PostgreSQL v15.x, v16.x CUDA Toolkit 12.2 or later Linux distributions supported by CUDA Toolkit Intel x86 64bit architecture (x86_64) NVIDIA GPU CC 6.0 or later (Pascal at least; Volta or newer is recommended)","title":"Prerequisites"},{"location":"release_v5.1/#partition-wise-gpujoingpupreagg","text":"Support for PostgreSQL partitions itself was also included in PG-Strom v3.0, but execution plans often could not be created properly, therefore it could not be moved out of its experimental status. Then, in PG-Strom v5.1, we fundamentally revised the internal design, re-implemented it, and incorporated it as an official feature again. If the lineorder table below is partitioned and the date1 table is a non-partitioned table, previously all the data read from the partitioned tables under lineorder must be joined with date1 table after the consolidation of all the partition leafs by the Append node. Usually, PG-Strom bypasses the CPU and loads data from the NVME-SSD to the GPU to perform various SQL processing (GPU-Direct SQL), so the data must be returned to the CPU before JOIN. It has been a big penalty. ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate -> Hash Join Hash Cond: (lineorder.lo_orderdate = date1.d_datekey) -> Append -> Custom Scan (GpuScan) on lineorder__p1992 lineorder_1 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1993 lineorder_2 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1994 lineorder_3 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1995 lineorder_4 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1996 lineorder_5 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1997 lineorder_6 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU-Direct SQL: enabled (GPU-0) -> Custom Scan (GpuScan) on lineorder__p1998 lineorder_7 GPU Projection: lo_extendedprice, lo_discount, lo_orderdate GPU Scan Quals: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on lineorder__p1999 lineorder_8 Filter: ((lo_discount >= '1'::numeric) AND (lo_discount <= '3'::numeric) AND (lo_quantity < '25'::numeric)) -> Hash -> Seq Scan on date1 Filter: (d_year = 1993) (37 rows) In PG-Strom v5.1, it is now possible to push-down JOINs with non-partitioned tables to partitioned child tables. In some cases, it is also possible to complete the GROUP-BY processing and then return much smaller results to CPU. For example, in the example below, 70 million rows extracted from a total of 600 million rows in the partitioned child tables. By performing a JOIN with the non-partitioned table date1 and then aggregation function SUM() pushed-down to the partitioned child tables, the CPU only needs to process 8 rows. Although there is a disadvantage that reading on the INNER side occurs multiple times (* This will be fixed in a future version), this type of rewriting will significantly reduce the amount of data that must be processed by the CPU, contributing to improved processing speed. To do. ssbm=# explain (costs off) select sum(lo_extendedprice*lo_discount) as revenue from lineorder,date1 where lo_orderdate = d_datekey and d_year = 1993 and lo_discount between 1 and 3 and lo_quantity < 25; QUERY PLAN ---------------------------------------------------------------------------------------------------- Aggregate -> Append -> Custom Scan (GpuPreAgg) on lineorder__p1992 lineorder_1 GPU Projection: pgstrom.psum(((lineorder_1.lo_extendedprice * lineorder_1.lo_discount))::double precision) GPU Scan Quals: ((lineorder_1.lo_discount >= '1'::numeric) AND (lineorder_1.lo_discount <= '3'::numeric) AND (lineorder_1.lo_quantity < '25'::numeric)) [rows: 91250920 -> 11911380] GPU Join Quals [1]: (lineorder_1.lo_orderdate = date1.d_datekey) ... [nrows: 11911380 -> 1700960] GPU Outer Hash [1]: lineorder_1.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1993 lineorder_2 GPU Projection: pgstrom.psum(((lineorder_2.lo_extendedprice * lineorder_2.lo_discount))::double precision) GPU Scan Quals: ((lineorder_2.lo_discount >= '1'::numeric) AND (lineorder_2.lo_discount <= '3'::numeric) AND (lineorder_2.lo_quantity < '25'::numeric)) [rows: 91008500 -> 11980460] GPU Join Quals [1]: (lineorder_2.lo_orderdate = date1.d_datekey) ... [nrows: 11980460 -> 1710824] GPU Outer Hash [1]: lineorder_2.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1994 lineorder_3 GPU Projection: pgstrom.psum(((lineorder_3.lo_extendedprice * lineorder_3.lo_discount))::double precision) GPU Scan Quals: ((lineorder_3.lo_discount >= '1'::numeric) AND (lineorder_3.lo_discount <= '3'::numeric) AND (lineorder_3.lo_quantity < '25'::numeric)) [rows: 91044060 -> 12150700] GPU Join Quals [1]: (lineorder_3.lo_orderdate = date1.d_datekey) ... [nrows: 12150700 -> 1735135] GPU Outer Hash [1]: lineorder_3.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1995 lineorder_4 GPU Projection: pgstrom.psum(((lineorder_4.lo_extendedprice * lineorder_4.lo_discount))::double precision) GPU Scan Quals: ((lineorder_4.lo_discount >= '1'::numeric) AND (lineorder_4.lo_discount <= '3'::numeric) AND (lineorder_4.lo_quantity < '25'::numeric)) [rows: 91011720 -> 11779920] GPU Join Quals [1]: (lineorder_4.lo_orderdate = date1.d_datekey) ... [nrows: 11779920 -> 1682188] GPU Outer Hash [1]: lineorder_4.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1996 lineorder_5 GPU Projection: pgstrom.psum(((lineorder_5.lo_extendedprice * lineorder_5.lo_discount))::double precision) GPU Scan Quals: ((lineorder_5.lo_discount >= '1'::numeric) AND (lineorder_5.lo_discount <= '3'::numeric) AND (lineorder_5.lo_quantity < '25'::numeric)) [rows: 91305650 -> 11942810] GPU Join Quals [1]: (lineorder_5.lo_orderdate = date1.d_datekey) ... [nrows: 11942810 -> 1705448] GPU Outer Hash [1]: lineorder_5.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1997 lineorder_6 GPU Projection: pgstrom.psum(((lineorder_6.lo_extendedprice * lineorder_6.lo_discount))::double precision) GPU Scan Quals: ((lineorder_6.lo_discount >= '1'::numeric) AND (lineorder_6.lo_discount <= '3'::numeric) AND (lineorder_6.lo_quantity < '25'::numeric)) [rows: 91049100 -> 12069740] GPU Join Quals [1]: (lineorder_6.lo_orderdate = date1.d_datekey) ... [nrows: 12069740 -> 1723574] GPU Outer Hash [1]: lineorder_6.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1998 lineorder_7 GPU Projection: pgstrom.psum(((lineorder_7.lo_extendedprice * lineorder_7.lo_discount))::double precision) GPU Scan Quals: ((lineorder_7.lo_discount >= '1'::numeric) AND (lineorder_7.lo_discount <= '3'::numeric) AND (lineorder_7.lo_quantity < '25'::numeric)) [rows: 53370560 -> 6898138] GPU Join Quals [1]: (lineorder_7.lo_orderdate = date1.d_datekey) ... [nrows: 6898138 -> 985063] GPU Outer Hash [1]: lineorder_7.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) -> Custom Scan (GpuPreAgg) on lineorder__p1999 lineorder_8 GPU Projection: pgstrom.psum(((lineorder_8.lo_extendedprice * lineorder_8.lo_discount))::double precision) GPU Scan Quals: ((lineorder_8.lo_discount >= '1'::numeric) AND (lineorder_8.lo_discount <= '3'::numeric) AND (lineorder_8.lo_quantity < '25'::numeric)) [rows: 150 -> 1] GPU Join Quals [1]: (lineorder_8.lo_orderdate = date1.d_datekey) ... [nrows: 1 -> 1] GPU Outer Hash [1]: lineorder_8.lo_orderdate GPU Inner Hash [1]: date1.d_datekey Inner Siblings-Id: 2 GPU-Direct SQL: enabled (GPU-0) -> Seq Scan on date1 Filter: (d_year = 1993) (82 rows)","title":"Partition-wise GpuJoin/GpuPreAgg"},{"location":"release_v5.1/#build-gpu-code-on-startup","text":"Previous versions of PG-Strom was distributing pre-built binary modules for GPUs. Although this is simple, the GPU binary module often raised a runtime error depending on the combination of CUDA Toolkit and NVIDIA driver versions in the PG-Strom (PostgreSQL) execution environment. Typically, this is when the execution environment has an older version of the CUDA Toolkit or NVIDIA driver installed than the environment in which the RPM package was built. PG-Strom v5.1 has been changed to check the GPU source code and CUDA Toolkit version at startup, and build a GPU binary module if there are any difference. With this fix, PG-Strom can now utilize GPU devices and GPU binary modules for CUDA Toolkit in the execution environment.","title":"Build GPU code on startup"},{"location":"release_v5.1/#pg2arrow-parallel-execution","text":"pg2arrow now supports the new -n|--num-workers and -k|--parallel-keys options. -n N_WORKERS option launches the specified number of threads to connect to PostgreSQL for each, execute queries in parallel, and write the results to the Apache Arrow file. Queries can contain the special token $(N_WORKERS) and $(WORKER_ID) , which will be replaced by the number of workers and worker-specific ID values, respectively, when querying PostgreSQL. It is user's responsibility to ensure the tuples read by each worker thread do not overlap or are missing. Another -k|--parallel-key option starts a worker thread for each comma-separated key value given by the argument, and replaces $(PARALLEL_KEY) with the key in the query. The worker thread runs this query for each, then write the result as an Apache Arrow file. For example, if the lineorder table is partitioned and there are child tables lineorder__sun , lineorder__mon , ... lineorder__sat , each worker thread scans each child table of the partition according to the keys given by the -k sun,mon,tue,wed,thu,fri,sat option. This parallel key is replaced by the $(PARALLEL_KEY) in the query given by -c 'SELECT * FROM lineorder__$(PARALLEL_KEY)' option. It launches 7 worker threads which shall scan the partitioned child table for each. $ pg2arrow -d ssbm -c 'SELECT * FROM lineorder__$(PARALLEL_KEY)' -o /path/to/f_lineorder.arrow -k=sun,mon,tue,wed,thu,fri,sat --progress worker:1 SQL=[SELECT * FROM lineorder__sun] worker:3 SQL=[SELECT * FROM lineorder__tue] worker:2 SQL=[SELECT * FROM lineorder__mon] worker:4 SQL=[SELECT * FROM lineorder__wed] worker:5 SQL=[SELECT * FROM lineorder__thu] : :","title":"pg2arrow parallel execution"},{"location":"ssd2gpu/","text":"GPU Direct SQL Execution Overview For the fast execution of SQL workloads, it needs to provide processors rapid data stream from storage or memory, in addition to processor's execution efficiency. Processor will run idle if data stream would not be delivered. GPUDirect SQL Execution directly connects NVMe-SSD which enables high-speed I/O processing by direct attach to the PCIe bus and GPU device that is also attached on the same PCIe bus, and runs SQL workloads very high speed by supplying data stream close to the wired speed of the hardware. Usually, PostgreSQL data blocks on the storage shall be once loaded to CPU/RAM through the PCIe bus, then, PostgreSQL runs WHERE-clause for filtering or JOIN/GROUP BY according to the query execution plan. Due to the characteristics of analytic workloads, the amount of result data set is much smaller than the source data set. For example, it is not rare case to read billions rows but output just hundreds rows after the aggregation operations with GROUP BY. In the other words, we consume bandwidth of the PCIe bus to move junk data, however, we cannot determine whether rows are necessary or not prior to the evaluation by SQL workloads on CPU. So, it is not avoidable restriction in usual implementation. GPU Direct SQL Execution changes the flow to read blocks from the storage sequentially. It directly loads data blocks to GPU using peer-to-peer DMA over PCIe bus, then runs SQL workloads on GPU device to reduce number of rows to be processed by CPU. In other words, it utilizes GPU as a pre-processor of SQL which locates in the middle of the storage and CPU/RAM for reduction of CPU's load, then tries to accelerate I/O processing in the results. This feature internally uses the NVIDIA GPUDirect Storage module ( nvidia-fs ) to coordinate P2P data transfer from NVME storage to GPU device memory. So, this feature requires this Linux kernel module, in addition to PG-Strom as an extension of PostgreSQL. Also note that this feature supports only NVME-SSD or NVME-oF remove devices. It does not support legacy storages like SAS or SATA-SSD. We have tested several NVMD-SSD models. You can refer 002: HW Validation List for your information. System Setup Driver Installation The previous version of PG-Strom required its original Linux kernel module developed by HeteroDB for GPU-Direct SQL support, however, the version 3.0 revised the software design to use GPUDirect Storage provided by NVIDIA, as a part of CUDA Toolkit. The Linux kernel module for GPUDirect Storage ( nvidia-fs ) is integrated into the CUDA Toolkit installation process and requires no additional configuration if you have set up your system as described in the Installation chapter of this manual. You can check whether the required Linux kernel drivers are installed using the modinfo command or lsmod command. $ modinfo nvidia-fs filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/nvidia-fs.ko.xz description: NVIDIA GPUDirect Storage license: GPL v2 version: 2.20.5 rhelversion: 9.4 srcversion: 096A726CAEC0A059E24049E depends: retpoline: Y name: nvidia_fs vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions sig_id: PKCS#7 signer: DKMS module signing key sig_key: 18:B4:AE:27:B8:7D:74:4F:C2:27:68:2A:EB:E0:6A:F0:84:B2:94:EE sig_hashalgo: sha512 : : $ lsmod | grep nvidia nvidia_fs 323584 32 nvidia_uvm 6877184 4 nvidia 8822784 43 nvidia_uvm,nvidia_fs drm 741376 2 drm_kms_helper,nvidia Designing Tablespace GPU Direct SQL Execution shall be invoked in the following case. The target table to be scanned locates on the partition being consist of NVMe-SSD. /dev/nvmeXXXX block device, or md-raid0 volume which consists of NVMe-SSDs only. The target table size is larger than pg_strom.gpudirect_threshold . You can adjust this configuration. Its default is physical RAM size of the system plus 1/3 of shared_buffers configuration. Note Striped read from multiple NVMe-SSD using md-raid0 requires the enterprise subscription provided by HeteroDB,Inc. In order to deploy the tables on the partition consists of NVMe-SSD, you can use the tablespace function of PostgreSQL to specify particular tables or databases to place them on NVMe-SSD volume, in addition to construction of the entire database cluster on the NVMe-SSD volume. For example, you can create a new tablespace below, if NVMe-SSD is mounted at /opt/nvme . CREATE TABLESPACE my_nvme LOCATION '/opt/nvme'; In order to create a new table on the tablespace, specify the TABLESPACE option at the CREATE TABLE command below. CREATE TABLE my_table (...) TABLESPACE my_nvme; Or, use ALTER DATABASE command as follows, to change the default tablespace of the database. Note that tablespace of the existing tables are not changed in thie case. ALTER DATABASE my_database SET TABLESPACE my_nvme; Operations Distance between GPU and NVME-SSD On selection of server hardware and installation of GPU and NVME-SSD, hardware configuration needs to pay attention to the distance between devices, to pull out maximum performance of the device. NVIDIA GPUDirect RDMA , basis of the GPU Direct SQL mechanism, requires both of the edge devices of P2P DMA are connected on the same PCIe root complex. In the other words, unable to configure the P2P DMA traverses QPI between CPUs when NVME-SSD is attached on CPU1 and GPU is attached on CPU2 at dual socket system. From standpoint of the performance, it is recommended to use dedicated PCIe-switch to connect both of the devices more than the PCIe controller built in CPU. The photo below is a motherboard of HPC server. It has 8 of PCIe x16 slots, and each pair is linked to the other over the PCIe switch. The slots in the left-side of the photo are connected to CPU1, and right-side are connected to CPU2. When a table on SSD-2 is scanned using GPU Direct SQL, the optimal GPU choice is GPU-2, and it may be able to use GPU1. However, we have to avoid to choose GPU-3 and GPU-4 due to the restriction of GPUDirect RDMA. PG-Strom calculate logical distances on any pairs of GPU and NVME-SSD using PCIe bus topology information of the system on startup time. It is displayed at the start up log. Each NVME-SSD determines the preferable GPU based on the distance, for example, GPU1 shall be used on scan of the /dev/nvme2 . $ pg_ctl restart : LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78> LOG: [0000:81:00:0] nvme0 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] LOG: [0000:82:00:0] nvme2 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c2:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c6:00:0] nvme5 (Corsair MP600 CORE) --> GPU0 [dist=9] LOG: [0000:c3:00:0] nvme4 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c1:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c4:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Usually automatic configuration works well. In case when NVME-over-Fabric(RDMA) is used, unable to identify the location of nvme device on the PCIe-bus, so you need to configure the logical distance between NVME-SSD and GPU manually. The example below shows the configuration of gpu2 for nvme1 , and gpu1 for nvme2 and nvme3 . It shall be added to postgresql.conf . Please note than manual configuration takes priority than the automatic configuration. pg_strom.nvme_distance_map = 'nvme1=gpu2,nvme2=gpu1,nvme3=gpu1' If the concept of distance on the PCI-E bus is not suitable, such as when running GPU-Direct SQL from a storage server connected via 100Gb Ethernet, other than a local NVME-SSD device, you can specify the directory where the storage is mounted, and the preferable GPU devices to be associated with. Below is a setting example. pg_strom.nvme_distance_map = '/mnt/0=gpu0,/mnt/1=gpu1' Controls using GUC parameters There are two GPU parameters related to GPU Direct SQL Execution. The first is pg_strom.gpudirect_enabled that simply turn on/off the function of GPU Direct SQL Execution. If off , GPU Direct SQL Execution should not be used regardless of the table size or physical location. Default is on . The other one is pg_strom.gpudirect_threshold which specifies the least table size to invoke GPU Direct SQL Execution. PG-Strom will choose GPU Direct SQL Execution when target table is located on NVME-SSD volume (or md-raid0 volume which consists of NVME-SSD only), and the table size is larger than this parameter. Its default configuration is 2GB . In other words, for obviously small tables, priority is given to reading from PostgreSQL's buffer rather than GPU-Direct SQL. Even if GPU Direct SQL Execution has advantages on a single table scan workload, usage of disk cache may work better on the second or later trial for the tables which are available to load onto the main memory. On course, this assumption is not always right depending on the workload charasteristics. Ensure usage of GPU Direct SQL Execution EXPLAIN command allows to ensure whether GPU Direct SQL Execution shall be used in the target query, or not. In the example below, a scan on the lineorder table by Custom Scan (GpuJoin) shows NVMe-Strom: enabled . In this case, GPU Direct SQL Execution shall be used to read from the lineorder table. # explain (costs off) select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_category = 'MFGR#12' and s_region = 'AMERICA' group by d_year, p_brand1 order by d_year, p_brand1; QUERY PLAN ---------------------------------------------------------------------------------------------- GroupAggregate Group Key: date1.d_year, part.p_brand1 -> Sort Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuPreAgg) Reduction: Local GPU Projection: pgstrom.psum((lo_revenue)::double precision), d_year, p_brand1 Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on lineorder GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue Outer Scan: lineorder Depth 1: GpuHashJoin (nrows 2406009600...97764190) HashKeys: lineorder.lo_partkey JoinQuals: (lineorder.lo_partkey = part.p_partkey) KDS-Hash (size: 10.67MB) Depth 2: GpuHashJoin (nrows 97764190...18544060) HashKeys: lineorder.lo_suppkey JoinQuals: (lineorder.lo_suppkey = supplier.s_suppkey) KDS-Hash (size: 131.59MB) Depth 3: GpuHashJoin (nrows 18544060...18544060) HashKeys: lineorder.lo_orderdate JoinQuals: (lineorder.lo_orderdate = date1.d_datekey) KDS-Hash (size: 461.89KB) NVMe-Strom: enabled -> Custom Scan (GpuScan) on part GPU Projection: p_brand1, p_partkey GPU Filter: (p_category = 'MFGR#12'::bpchar) -> Custom Scan (GpuScan) on supplier GPU Projection: s_suppkey GPU Filter: (s_region = 'AMERICA'::bpchar) -> Seq Scan on date1 (31 rows) Attension for visibility map Right now, GPU routines of PG-Strom cannot run MVCC visibility checks per row, because only host code has a special data structure for visibility checks. It also leads a problem. We cannot know which row is visible, or invisible at the time when PG-Strom requires P2P DMA for NVMe-SSD, because contents of the storage blocks are not yet loaded to CPU/RAM, and MVCC related attributes are written with individual records. PostgreSQL had similar problem when it supports IndexOnlyScan. To address the problem, PostgreSQL has an infrastructure of visibility map which is a bunch of flags to indicate whether any records in a particular data block are visible from all the transactions. If associated bit is set, we can know the associated block has no invisible records without reading the block itself. GPU Direct SQL Execution utilizes this infrastructure. It checks the visibility map first, then only \"all-visible\" blocks are required to read with P2P DMA. VACUUM constructs visibility map, so you can enforce PostgreSQL to construct visibility map by explicit launch of VACUUM command. VACUUM ANALYZE linerorder;","title":"GPUDirect SQL"},{"location":"ssd2gpu/#gpu-direct-sql-execution","text":"","title":"GPU Direct SQL Execution"},{"location":"ssd2gpu/#overview","text":"For the fast execution of SQL workloads, it needs to provide processors rapid data stream from storage or memory, in addition to processor's execution efficiency. Processor will run idle if data stream would not be delivered. GPUDirect SQL Execution directly connects NVMe-SSD which enables high-speed I/O processing by direct attach to the PCIe bus and GPU device that is also attached on the same PCIe bus, and runs SQL workloads very high speed by supplying data stream close to the wired speed of the hardware. Usually, PostgreSQL data blocks on the storage shall be once loaded to CPU/RAM through the PCIe bus, then, PostgreSQL runs WHERE-clause for filtering or JOIN/GROUP BY according to the query execution plan. Due to the characteristics of analytic workloads, the amount of result data set is much smaller than the source data set. For example, it is not rare case to read billions rows but output just hundreds rows after the aggregation operations with GROUP BY. In the other words, we consume bandwidth of the PCIe bus to move junk data, however, we cannot determine whether rows are necessary or not prior to the evaluation by SQL workloads on CPU. So, it is not avoidable restriction in usual implementation. GPU Direct SQL Execution changes the flow to read blocks from the storage sequentially. It directly loads data blocks to GPU using peer-to-peer DMA over PCIe bus, then runs SQL workloads on GPU device to reduce number of rows to be processed by CPU. In other words, it utilizes GPU as a pre-processor of SQL which locates in the middle of the storage and CPU/RAM for reduction of CPU's load, then tries to accelerate I/O processing in the results. This feature internally uses the NVIDIA GPUDirect Storage module ( nvidia-fs ) to coordinate P2P data transfer from NVME storage to GPU device memory. So, this feature requires this Linux kernel module, in addition to PG-Strom as an extension of PostgreSQL. Also note that this feature supports only NVME-SSD or NVME-oF remove devices. It does not support legacy storages like SAS or SATA-SSD. We have tested several NVMD-SSD models. You can refer 002: HW Validation List for your information.","title":"Overview"},{"location":"ssd2gpu/#system-setup","text":"","title":"System Setup"},{"location":"ssd2gpu/#driver-installation","text":"The previous version of PG-Strom required its original Linux kernel module developed by HeteroDB for GPU-Direct SQL support, however, the version 3.0 revised the software design to use GPUDirect Storage provided by NVIDIA, as a part of CUDA Toolkit. The Linux kernel module for GPUDirect Storage ( nvidia-fs ) is integrated into the CUDA Toolkit installation process and requires no additional configuration if you have set up your system as described in the Installation chapter of this manual. You can check whether the required Linux kernel drivers are installed using the modinfo command or lsmod command. $ modinfo nvidia-fs filename: /lib/modules/5.14.0-427.18.1.el9_4.x86_64/extra/nvidia-fs.ko.xz description: NVIDIA GPUDirect Storage license: GPL v2 version: 2.20.5 rhelversion: 9.4 srcversion: 096A726CAEC0A059E24049E depends: retpoline: Y name: nvidia_fs vermagic: 5.14.0-427.18.1.el9_4.x86_64 SMP preempt mod_unload modversions sig_id: PKCS#7 signer: DKMS module signing key sig_key: 18:B4:AE:27:B8:7D:74:4F:C2:27:68:2A:EB:E0:6A:F0:84:B2:94:EE sig_hashalgo: sha512 : : $ lsmod | grep nvidia nvidia_fs 323584 32 nvidia_uvm 6877184 4 nvidia 8822784 43 nvidia_uvm,nvidia_fs drm 741376 2 drm_kms_helper,nvidia","title":"Driver Installation"},{"location":"ssd2gpu/#designing-tablespace","text":"GPU Direct SQL Execution shall be invoked in the following case. The target table to be scanned locates on the partition being consist of NVMe-SSD. /dev/nvmeXXXX block device, or md-raid0 volume which consists of NVMe-SSDs only. The target table size is larger than pg_strom.gpudirect_threshold . You can adjust this configuration. Its default is physical RAM size of the system plus 1/3 of shared_buffers configuration. Note Striped read from multiple NVMe-SSD using md-raid0 requires the enterprise subscription provided by HeteroDB,Inc. In order to deploy the tables on the partition consists of NVMe-SSD, you can use the tablespace function of PostgreSQL to specify particular tables or databases to place them on NVMe-SSD volume, in addition to construction of the entire database cluster on the NVMe-SSD volume. For example, you can create a new tablespace below, if NVMe-SSD is mounted at /opt/nvme . CREATE TABLESPACE my_nvme LOCATION '/opt/nvme'; In order to create a new table on the tablespace, specify the TABLESPACE option at the CREATE TABLE command below. CREATE TABLE my_table (...) TABLESPACE my_nvme; Or, use ALTER DATABASE command as follows, to change the default tablespace of the database. Note that tablespace of the existing tables are not changed in thie case. ALTER DATABASE my_database SET TABLESPACE my_nvme;","title":"Designing Tablespace"},{"location":"ssd2gpu/#operations","text":"","title":"Operations"},{"location":"ssd2gpu/#distance-between-gpu-and-nvme-ssd","text":"On selection of server hardware and installation of GPU and NVME-SSD, hardware configuration needs to pay attention to the distance between devices, to pull out maximum performance of the device. NVIDIA GPUDirect RDMA , basis of the GPU Direct SQL mechanism, requires both of the edge devices of P2P DMA are connected on the same PCIe root complex. In the other words, unable to configure the P2P DMA traverses QPI between CPUs when NVME-SSD is attached on CPU1 and GPU is attached on CPU2 at dual socket system. From standpoint of the performance, it is recommended to use dedicated PCIe-switch to connect both of the devices more than the PCIe controller built in CPU. The photo below is a motherboard of HPC server. It has 8 of PCIe x16 slots, and each pair is linked to the other over the PCIe switch. The slots in the left-side of the photo are connected to CPU1, and right-side are connected to CPU2. When a table on SSD-2 is scanned using GPU Direct SQL, the optimal GPU choice is GPU-2, and it may be able to use GPU1. However, we have to avoid to choose GPU-3 and GPU-4 due to the restriction of GPUDirect RDMA. PG-Strom calculate logical distances on any pairs of GPU and NVME-SSD using PCIe bus topology information of the system on startup time. It is displayed at the start up log. Each NVME-SSD determines the preferable GPU based on the distance, for example, GPU1 shall be used on scan of the /dev/nvme2 . $ pg_ctl restart : LOG: PG-Strom: GPU0 NVIDIA A100-PCIE-40GB (108 SMs; 1410MHz, L2 40960kB), RAM 39.50GB (5120bits, 1.16GHz), PCI-E Bar1 64GB, CC 8.0 LOG: [0000:41:00:0] GPU0 (NVIDIA A100-PCIE-40GB; GPU-13943bfd-5b30-38f5-0473-78> LOG: [0000:81:00:0] nvme0 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] LOG: [0000:82:00:0] nvme2 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c2:00:0] nvme3 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c6:00:0] nvme5 (Corsair MP600 CORE) --> GPU0 [dist=9] LOG: [0000:c3:00:0] nvme4 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c1:00:0] nvme1 (INTEL SSDPF2KX038TZ) --> GPU0 [dist=9] LOG: [0000:c4:00:0] nvme6 (NGD-IN2500-080T4-C) --> GPU0 [dist=9] Usually automatic configuration works well. In case when NVME-over-Fabric(RDMA) is used, unable to identify the location of nvme device on the PCIe-bus, so you need to configure the logical distance between NVME-SSD and GPU manually. The example below shows the configuration of gpu2 for nvme1 , and gpu1 for nvme2 and nvme3 . It shall be added to postgresql.conf . Please note than manual configuration takes priority than the automatic configuration. pg_strom.nvme_distance_map = 'nvme1=gpu2,nvme2=gpu1,nvme3=gpu1' If the concept of distance on the PCI-E bus is not suitable, such as when running GPU-Direct SQL from a storage server connected via 100Gb Ethernet, other than a local NVME-SSD device, you can specify the directory where the storage is mounted, and the preferable GPU devices to be associated with. Below is a setting example. pg_strom.nvme_distance_map = '/mnt/0=gpu0,/mnt/1=gpu1'","title":"Distance between GPU and NVME-SSD"},{"location":"ssd2gpu/#controls-using-guc-parameters","text":"There are two GPU parameters related to GPU Direct SQL Execution. The first is pg_strom.gpudirect_enabled that simply turn on/off the function of GPU Direct SQL Execution. If off , GPU Direct SQL Execution should not be used regardless of the table size or physical location. Default is on . The other one is pg_strom.gpudirect_threshold which specifies the least table size to invoke GPU Direct SQL Execution. PG-Strom will choose GPU Direct SQL Execution when target table is located on NVME-SSD volume (or md-raid0 volume which consists of NVME-SSD only), and the table size is larger than this parameter. Its default configuration is 2GB . In other words, for obviously small tables, priority is given to reading from PostgreSQL's buffer rather than GPU-Direct SQL. Even if GPU Direct SQL Execution has advantages on a single table scan workload, usage of disk cache may work better on the second or later trial for the tables which are available to load onto the main memory. On course, this assumption is not always right depending on the workload charasteristics.","title":"Controls using GUC parameters"},{"location":"ssd2gpu/#ensure-usage-of-gpu-direct-sql-execution","text":"EXPLAIN command allows to ensure whether GPU Direct SQL Execution shall be used in the target query, or not. In the example below, a scan on the lineorder table by Custom Scan (GpuJoin) shows NVMe-Strom: enabled . In this case, GPU Direct SQL Execution shall be used to read from the lineorder table. # explain (costs off) select sum(lo_revenue), d_year, p_brand1 from lineorder, date1, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_category = 'MFGR#12' and s_region = 'AMERICA' group by d_year, p_brand1 order by d_year, p_brand1; QUERY PLAN ---------------------------------------------------------------------------------------------- GroupAggregate Group Key: date1.d_year, part.p_brand1 -> Sort Sort Key: date1.d_year, part.p_brand1 -> Custom Scan (GpuPreAgg) Reduction: Local GPU Projection: pgstrom.psum((lo_revenue)::double precision), d_year, p_brand1 Combined GpuJoin: enabled -> Custom Scan (GpuJoin) on lineorder GPU Projection: date1.d_year, part.p_brand1, lineorder.lo_revenue Outer Scan: lineorder Depth 1: GpuHashJoin (nrows 2406009600...97764190) HashKeys: lineorder.lo_partkey JoinQuals: (lineorder.lo_partkey = part.p_partkey) KDS-Hash (size: 10.67MB) Depth 2: GpuHashJoin (nrows 97764190...18544060) HashKeys: lineorder.lo_suppkey JoinQuals: (lineorder.lo_suppkey = supplier.s_suppkey) KDS-Hash (size: 131.59MB) Depth 3: GpuHashJoin (nrows 18544060...18544060) HashKeys: lineorder.lo_orderdate JoinQuals: (lineorder.lo_orderdate = date1.d_datekey) KDS-Hash (size: 461.89KB) NVMe-Strom: enabled -> Custom Scan (GpuScan) on part GPU Projection: p_brand1, p_partkey GPU Filter: (p_category = 'MFGR#12'::bpchar) -> Custom Scan (GpuScan) on supplier GPU Projection: s_suppkey GPU Filter: (s_region = 'AMERICA'::bpchar) -> Seq Scan on date1 (31 rows)","title":"Ensure usage of GPU Direct SQL Execution"},{"location":"ssd2gpu/#attension-for-visibility-map","text":"Right now, GPU routines of PG-Strom cannot run MVCC visibility checks per row, because only host code has a special data structure for visibility checks. It also leads a problem. We cannot know which row is visible, or invisible at the time when PG-Strom requires P2P DMA for NVMe-SSD, because contents of the storage blocks are not yet loaded to CPU/RAM, and MVCC related attributes are written with individual records. PostgreSQL had similar problem when it supports IndexOnlyScan. To address the problem, PostgreSQL has an infrastructure of visibility map which is a bunch of flags to indicate whether any records in a particular data block are visible from all the transactions. If associated bit is set, we can know the associated block has no invisible records without reading the block itself. GPU Direct SQL Execution utilizes this infrastructure. It checks the visibility map first, then only \"all-visible\" blocks are required to read with P2P DMA. VACUUM constructs visibility map, so you can enforce PostgreSQL to construct visibility map by explicit launch of VACUUM command. VACUUM ANALYZE linerorder;","title":"Attension for visibility map"},{"location":"troubles/","text":"Trouble Shooting Identify the problem In case when a particular workloads produce problems, it is the first step to identify which stuff may cause the problem. Unfortunately, much smaller number of developer supports the PG-Strom development community than PostgreSQL developer's community, thus, due to the standpoint of software quality and history, it is a reasonable estimation to suspect PG-Strom first. The pg_strom.enabled parameter allows to turn on/off all the functionality of PG-Strom at once. The configuration below disables PG-Strom, thus identically performs with the standard PostgreSQL. # SET pg_strom.enabled = off; In addition, we provide parameters to disable particular execution plan like GpuScan, GpuJoin and GpuPreAgg. See references/GUC Parameters for more details. Collecting crash dump Crash dump is very helpful for analysis of serious problems which lead system crash for example. This session introduces the way to collect crash dump of the PostgreSQL and PG-Strom process (CPU side) and PG-Strom's GPU kernel, and show the back trace on the serious problems. Add configuration on PostgreSQL startup For generation of crash dump (CPU-side) on process crash, you need to change the resource limitation of the operating system for size of core file PostgreSQL server process can generate. For generation of crash dump (GPU-size) on errors of GPU kernel, PostgreSQL server process has CUDA_ENABLE_COREDUMP_ON_EXCEPTION environment variable, and its value has 1 . You can put a configuration file at /etc/systemd/system/postgresql-.service.d/ when PostgreSQL is kicked by systemd. In case of RPM installation, a configuration file pg_strom.conf is also installed on the directory, and contains the following initial configuration. [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1 In CUDA 9.1, it usually takes more than several minutes to generate crash dump of GPU kernel, and it entirely stops response of the PostgreSQL session which causes an error. So, we recommend to set CUDA_ENABLE_COREDUMP_ON_EXCEPTION environment variable only if you investigate errors of GPU kernels which happen on a certain query. The default configuration on RPM installation comments out the line of CUDA_ENABLE_COREDUMP_ON_EXCEPTION environment variable. PostgreSQL server process should have unlimited Max core file size configuration, after the next restart. You can check it as follows. # cat /proc//limits Limit Soft Limit Hard Limit Units : : : : Max core file size unlimited unlimited bytes : : : : Installation of debuginfo package # yum install postgresql10-debuginfo pg_strom-PG10-debuginfo : ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: pg_strom-PG10-debuginfo x86_64 1.9-180301.el7 heterodb-debuginfo 766 k postgresql10-debuginfo x86_64 10.3-1PGDG.rhel7 pgdg10 9.7 M Transaction Summary ================================================================================ Install 2 Packages : Installed: pg_strom-PG10-debuginfo.x86_64 0:1.9-180301.el7 postgresql10-debuginfo.x86_64 0:10.3-1PGDG.rhel7 Complete! Checking the back-trace on CPU side The kernel parameter kernel.core_pattern and kernel.core_uses_pid determine the path where crash dump is written out. It is usually created on the current working directory of the process, check /var/lib/pgdata where the database cluster is deployed, if you start PostgreSQL server using systemd. Once core. file gets generated, you can check its back-trace to reach system crash using gdb . gdb speficies the core file by -c option, and the crashed program by -f option. # gdb -c /var/lib/pgdata/core.134680 -f /usr/pgsql-10/bin/postgres GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7_4.1 : (gdb) bt #0 0x00007fb942af3903 in __epoll_wait_nocancel () from /lib64/libc.so.6 #1 0x00000000006f71ae in WaitEventSetWaitBlock (nevents=1, occurred_events=0x7ffee51e1d70, cur_timeout=-1, set=0x2833298) at latch.c:1048 #2 WaitEventSetWait (set=0x2833298, timeout=timeout@entry-1, occurred_events=occurred_events@entry0x7ffee51e1d70, nevents=nevents@entry1, wait_event_info=wait_event_info@entry100663296) at latch.c:1000 #3 0x00000000006210fb in secure_read (port=0x2876120, ptr=0xcaa7e0 , len=8192) at be-secure.c:166 #4 0x000000000062b6e8 in pq_recvbuf () at pqcomm.c:963 #5 0x000000000062c345 in pq_getbyte () at pqcomm.c:1006 #6 0x0000000000718682 in SocketBackend (inBuf=0x7ffee51e1ef0) at postgres.c:328 #7 ReadCommand (inBuf=0x7ffee51e1ef0) at postgres.c:501 #8 PostgresMain (argc=, argv=argv@entry0x287bb68, dbname=0x28333f8 \"postgres\", username=) at postgres.c:4030 #9 0x000000000047adbc in BackendRun (port=0x2876120) at postmaster.c:4405 #10 BackendStartup (port=0x2876120) at postmaster.c:4077 #11 ServerLoop () at postmaster.c:1755 #12 0x00000000006afb7f in PostmasterMain (argc=argc@entry3, argv=argv@entry0x2831280) at postmaster.c:1363 #13 0x000000000047bbef in main (argc=3, argv=0x2831280) at main.c:228 bt command of gdb displays the backtrace. In this case, I sent SIGSEGV signal to the PostgreSQL backend which is waiting for queries from the client for intentional crash, the process got crashed at __epoll_wait_nocancel invoked by WaitEventSetWait . Checking the backtrace on GPU Crash dump of GPU kernel is generated on the current working directory of PostgreSQL server process, unless you don't specify the path using CUDA_COREDUMP_FILE environment variable explicitly. Check /var/lib/pgdata where the database cluster is deployed, if systemd started PostgreSQL. Dump file will have the following naming convension. core___.nvcudmp Note that the dump-file of GPU kernel contains no debug information like symbol information in the default configuration. It is nearly impossible to investigate the problem, so enable inclusion of debug information for the GPU programs generated by PG-Strom, as follows. Also note than we don't recommend to turn on the configuration for daily usage, because it makes query execution performan slow down. Turn on only when you investigate the troubles. nvme=# set pg_strom.debug_jit_compile_options = on; SET You can check crash dump of the GPU kernel using cuda-gdb command. # /usr/local/cuda/bin/cuda-gdb NVIDIA (R) CUDA Debugger 9.1 release Portions Copyright (C) 2007-2017 NVIDIA Corporation : For help, type \"help\". Type \"apropos word\" to search for commands related to \"word\". (cuda-gdb) Run cuda-gdb command, then load the crash dump file above using target command on the prompt. (cuda-gdb) target cudacore /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp Opening GPU coredump: /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp [New Thread 216240] CUDA Exception: Warp Illegal Address The exception was triggered at PC 0x7ff4dc82f930 (cuda_gpujoin.h:1159) [Current focus set to CUDA kernel 0, grid 1, block (0,0,0), thread (0,0,0), device 0, sm 0, warp 0, lane 0] #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 1159 while (khitem && khitem->hash != hash_value) You can check backtrace where the error happened on GPU kernel using bt command. (cuda-gdb) bt #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 #1 0x00007ff4dc9428f0 in gpujoin_main<<<(30,1,1),(256,1,1)>>> (kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, kds_dst=0x7fe9e8800030, kparams_gpreagg=0x0) at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1347 Please check CUDA Toolkit Documentation - CUDA-GDB for more detailed usage of cuda-gdb command.","title":"Trouble Shooting"},{"location":"troubles/#trouble-shooting","text":"","title":"Trouble Shooting"},{"location":"troubles/#identify-the-problem","text":"In case when a particular workloads produce problems, it is the first step to identify which stuff may cause the problem. Unfortunately, much smaller number of developer supports the PG-Strom development community than PostgreSQL developer's community, thus, due to the standpoint of software quality and history, it is a reasonable estimation to suspect PG-Strom first. The pg_strom.enabled parameter allows to turn on/off all the functionality of PG-Strom at once. The configuration below disables PG-Strom, thus identically performs with the standard PostgreSQL. # SET pg_strom.enabled = off; In addition, we provide parameters to disable particular execution plan like GpuScan, GpuJoin and GpuPreAgg. See references/GUC Parameters for more details.","title":"Identify the problem"},{"location":"troubles/#collecting-crash-dump","text":"Crash dump is very helpful for analysis of serious problems which lead system crash for example. This session introduces the way to collect crash dump of the PostgreSQL and PG-Strom process (CPU side) and PG-Strom's GPU kernel, and show the back trace on the serious problems.","title":"Collecting crash dump"},{"location":"troubles/#add-configuration-on-postgresql-startup","text":"For generation of crash dump (CPU-side) on process crash, you need to change the resource limitation of the operating system for size of core file PostgreSQL server process can generate. For generation of crash dump (GPU-size) on errors of GPU kernel, PostgreSQL server process has CUDA_ENABLE_COREDUMP_ON_EXCEPTION environment variable, and its value has 1 . You can put a configuration file at /etc/systemd/system/postgresql-.service.d/ when PostgreSQL is kicked by systemd. In case of RPM installation, a configuration file pg_strom.conf is also installed on the directory, and contains the following initial configuration. [Service] LimitNOFILE=65536 LimitCORE=infinity #Environment=CUDA_ENABLE_COREDUMP_ON_EXCEPTION=1 In CUDA 9.1, it usually takes more than several minutes to generate crash dump of GPU kernel, and it entirely stops response of the PostgreSQL session which causes an error. So, we recommend to set CUDA_ENABLE_COREDUMP_ON_EXCEPTION environment variable only if you investigate errors of GPU kernels which happen on a certain query. The default configuration on RPM installation comments out the line of CUDA_ENABLE_COREDUMP_ON_EXCEPTION environment variable. PostgreSQL server process should have unlimited Max core file size configuration, after the next restart. You can check it as follows. # cat /proc//limits Limit Soft Limit Hard Limit Units : : : : Max core file size unlimited unlimited bytes : : : :","title":"Add configuration on PostgreSQL startup"},{"location":"troubles/#installation-of-debuginfo-package","text":"# yum install postgresql10-debuginfo pg_strom-PG10-debuginfo : ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: pg_strom-PG10-debuginfo x86_64 1.9-180301.el7 heterodb-debuginfo 766 k postgresql10-debuginfo x86_64 10.3-1PGDG.rhel7 pgdg10 9.7 M Transaction Summary ================================================================================ Install 2 Packages : Installed: pg_strom-PG10-debuginfo.x86_64 0:1.9-180301.el7 postgresql10-debuginfo.x86_64 0:10.3-1PGDG.rhel7 Complete!","title":"Installation of debuginfo package"},{"location":"troubles/#checking-the-back-trace-on-cpu-side","text":"The kernel parameter kernel.core_pattern and kernel.core_uses_pid determine the path where crash dump is written out. It is usually created on the current working directory of the process, check /var/lib/pgdata where the database cluster is deployed, if you start PostgreSQL server using systemd. Once core. file gets generated, you can check its back-trace to reach system crash using gdb . gdb speficies the core file by -c option, and the crashed program by -f option. # gdb -c /var/lib/pgdata/core.134680 -f /usr/pgsql-10/bin/postgres GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7_4.1 : (gdb) bt #0 0x00007fb942af3903 in __epoll_wait_nocancel () from /lib64/libc.so.6 #1 0x00000000006f71ae in WaitEventSetWaitBlock (nevents=1, occurred_events=0x7ffee51e1d70, cur_timeout=-1, set=0x2833298) at latch.c:1048 #2 WaitEventSetWait (set=0x2833298, timeout=timeout@entry-1, occurred_events=occurred_events@entry0x7ffee51e1d70, nevents=nevents@entry1, wait_event_info=wait_event_info@entry100663296) at latch.c:1000 #3 0x00000000006210fb in secure_read (port=0x2876120, ptr=0xcaa7e0 , len=8192) at be-secure.c:166 #4 0x000000000062b6e8 in pq_recvbuf () at pqcomm.c:963 #5 0x000000000062c345 in pq_getbyte () at pqcomm.c:1006 #6 0x0000000000718682 in SocketBackend (inBuf=0x7ffee51e1ef0) at postgres.c:328 #7 ReadCommand (inBuf=0x7ffee51e1ef0) at postgres.c:501 #8 PostgresMain (argc=, argv=argv@entry0x287bb68, dbname=0x28333f8 \"postgres\", username=) at postgres.c:4030 #9 0x000000000047adbc in BackendRun (port=0x2876120) at postmaster.c:4405 #10 BackendStartup (port=0x2876120) at postmaster.c:4077 #11 ServerLoop () at postmaster.c:1755 #12 0x00000000006afb7f in PostmasterMain (argc=argc@entry3, argv=argv@entry0x2831280) at postmaster.c:1363 #13 0x000000000047bbef in main (argc=3, argv=0x2831280) at main.c:228 bt command of gdb displays the backtrace. In this case, I sent SIGSEGV signal to the PostgreSQL backend which is waiting for queries from the client for intentional crash, the process got crashed at __epoll_wait_nocancel invoked by WaitEventSetWait .","title":"Checking the back-trace on CPU side"},{"location":"troubles/#checking-the-backtrace-on-gpu","text":"Crash dump of GPU kernel is generated on the current working directory of PostgreSQL server process, unless you don't specify the path using CUDA_COREDUMP_FILE environment variable explicitly. Check /var/lib/pgdata where the database cluster is deployed, if systemd started PostgreSQL. Dump file will have the following naming convension. core___.nvcudmp Note that the dump-file of GPU kernel contains no debug information like symbol information in the default configuration. It is nearly impossible to investigate the problem, so enable inclusion of debug information for the GPU programs generated by PG-Strom, as follows. Also note than we don't recommend to turn on the configuration for daily usage, because it makes query execution performan slow down. Turn on only when you investigate the troubles. nvme=# set pg_strom.debug_jit_compile_options = on; SET You can check crash dump of the GPU kernel using cuda-gdb command. # /usr/local/cuda/bin/cuda-gdb NVIDIA (R) CUDA Debugger 9.1 release Portions Copyright (C) 2007-2017 NVIDIA Corporation : For help, type \"help\". Type \"apropos word\" to search for commands related to \"word\". (cuda-gdb) Run cuda-gdb command, then load the crash dump file above using target command on the prompt. (cuda-gdb) target cudacore /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp Opening GPU coredump: /var/lib/pgdata/core_1521131828_magro.heterodb.com_216238.nvcudmp [New Thread 216240] CUDA Exception: Warp Illegal Address The exception was triggered at PC 0x7ff4dc82f930 (cuda_gpujoin.h:1159) [Current focus set to CUDA kernel 0, grid 1, block (0,0,0), thread (0,0,0), device 0, sm 0, warp 0, lane 0] #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 1159 while (khitem && khitem->hash != hash_value) You can check backtrace where the error happened on GPU kernel using bt command. (cuda-gdb) bt #0 0x00007ff4dc82f938 in _INTERNAL_8_pg_strom_0124cb94::gpujoin_exec_hashjoin (kcxt=0x7ff4f7fffbf8, kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, depth=3, rd_stack=0x7fe9f4806118, wr_stack=0x7fe9f480c118, l_state=0x7ff4f7fffc48, matched=0x7ff4f7fffc7c \"\") at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1159 #1 0x00007ff4dc9428f0 in gpujoin_main<<<(30,1,1),(256,1,1)>>> (kgjoin=0x7fe9f4800078, kmrels=0x7fe9f8800000, kds_src=0x7fe9f0800030, kds_dst=0x7fe9e8800030, kparams_gpreagg=0x0) at /usr/pgsql-10/share/extension/cuda_gpujoin.h:1347 Please check CUDA Toolkit Documentation - CUDA-GDB for more detailed usage of cuda-gdb command.","title":"Checking the backtrace on GPU"}]} \ No newline at end of file diff --git a/man/install.md b/man/install.md index c7d7c9f0..0041b116 100644 --- a/man/install.md +++ b/man/install.md @@ -476,8 +476,8 @@ CUDA Toolkitのインストールに続いて、ドライバをインストー **Volta以前のGPUの利用について** オープンソース版nvidiaドライバは、Volta世代以前のGPUには対応していません。 - したがって、VoltaまたはPascal世代のGPUでPG-Stromを利用する場合は、プロプラエタリ版のドライバがGPUDirect Storageに対応しているCUDA 12.2を利用する必要があります。 - CUDA 12.2のパッケージは[こちら](https://developer.nvidia.com/cuda-12-2-2-download-archive?target_os=Linux&target_arch=x86_64&Distribution=RHEL&target_version=8&target_type=rpm_local)から入手する事ができます。 + したがって、VoltaまたはPascal世代のGPUでPG-Stromを利用する場合は、プロプラエタリ版のドライバであってもGPUDirect Storageに対応しているCUDA 12.2 Update 1を利用する必要があります。 + CUDA 12.2 Update 1のパッケージは[こちら](https://developer.nvidia.com/cuda-12-2-1-download-archive?target_os=Linux&target_arch=x86_64&Distribution=RHEL&target_version=8&target_type=rpm_local)から入手する事ができます。 } @en{ @@ -489,8 +489,8 @@ Please use the open source version of nvidia-driver here. Only the open source v **Use of Volta or former GPUs** The open source edition of the nvidia driver does not support Volta generation GPUs or former. - Therefore, if you want to use PG-Strom with Volta or Pascal generation GPUs, you need to use CUDA 12.2, whose proprietary driver supports GPUDirect Storage. - The CUDA 12.2 package can be obtained [here](https://developer.nvidia.com/cuda-12-2-2-download-archive?target_os=Linux&target_arch=x86_64&Distribution=RHEL&target_version=8&target_type=rpm_local). + Therefore, if you want to use PG-Strom with Volta or Pascal generation GPUs, you need to use CUDA 12.2 Update 1, whose proprietary driver supports GPUDirect Storage. + The CUDA 12.2 Update 1 package can be obtained [here](https://developer.nvidia.com/cuda-12-2-1-download-archive?target_os=Linux&target_arch=x86_64&Distribution=RHEL&target_version=8&target_type=rpm_local). } @ja{