2
0

More than 3 years have passed since last update.

OmniSciをCentOS 7 + GeForce RTX 2080 Tiで試してみた。

Last updated at Posted at 2020-10-27

GPUを使ったSQLデータベースの先駆けでもあるOmniSci (旧MapD)をCentOS 7上で試してみました。
使ったのはサンプルのデータベースで、flights_2008_7Mというのです。GPUはPNYのRTX 2080Ti 11GBです。

ベースのコンピュータはCore i5 第七世代、16GB DDR 4 RAM、2TBのcrucial社製SATA SSDを使っています。

OmniSciのインストールの仕方は:
https://docs.omnisci.com/v4.4.1/4_centos7-yum-gpu-ce-recipe.html
にあります。

色々なフライトのデータが700万件入っている物です。
SQL文で機種がボーイング777または737の場合を抽出しています。

使ったコード(Python 3)は:

omnisci-test.py
from pymapd import connect
import pandas as pd
import time

start = time.time()
con = connect(user="admin", password="PasswordHere", host="localhost", dbname="omnisci")
df = pd.read_sql("SELECT plane_model, uniquecarrier, deptime, arrtime from flights_2008_7M where plane_model like '777%' or plane_model like '737%' limit 1000", con)

print(df.to_string())

path = './omnisci-data.txt'

with open(path, 'w') as f:
        print(df.to_string(), file=f)
end = time.time()
print("Time elapsed: " + str(end - start))

二つの前方一致LIKE検索をorした実行時間を測っていますが、SSDにも書き込んでいるので0.324秒でした。
SSDに書かない所までを測ってみると0.2803秒でした。

実行結果:
...
985     737-7H4            WN     1029     1126
986     737-7H4            WN     1720     1817
987     737-5H4            WN      754     1154
988     737-3H4            WN     1408     1511
989     737-7H4            WN     2039     2141
990     737-76Q            WN      622      813
991     737-5H4            WN     2125     2226
992     737-7H4            WN     2040     2156
993     737-3H4            WN      757      945
994     737-7H4            WN      641      739
995     737-3Q8            WN     1617     1903
996     737-3A4            WN     1304     1455
997     737-7H4            WN      737      843
998     737-7H4            WN     1952       42
999     737-5H4            WN     1729     1925
Time elapsed: 0.3249530792236328

試しにLIKE検索を一つにして見ました。(ボーイング
777のみ)

dfの部分
df = pd.read_sql("SELECT plane_model, uniquecarrier, deptime, arrtime from flights_2008_7M where plane_model like '777%' limit 1000", con)

こちらの結果は0.2931640148162842秒でした。(SSDに書き込みの前まで)

SSDに書き込みありは0.29114460945129395秒でした。
LIKEを二つにした程度ではあまり実行速度が変わらない事が分かります。

加藤 翼
株式会社インスパイアサーチ CEO

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0