/2018-DQN-indexer

Code used for the Arvix report: The Case for Automatic Database Administration using Deep Reinforcement Learning

Primary LanguagePython

Repository Detail

This repository hosts the code for the prototype implementation used in the following paper:

The Case for Automatic Database Administration using Deep Reinforcement Learning

Installing Dependencies

General dependencies

pip install gym psycopg2 tensorflow keras numpy pandas matplotlib

Reinforcement Learning library

pip install keras-rl

Custom pip package to run queries on TPC-H Schema

cd postgres-executor
python setup.py sdist
pip install --upgrade dist/PostgresExecutor-0.1.tar.gz

Custom gym environment for database

pip install -e gym_dgame

DB2 installation

  • DB2: install as root
  • switch to db2inst1 user, then connect to db
  • Python connector: easy-install-3.6 ibm-db

Store data from CSV into Postgres instance

  • \copy lineitem from 'path to csv' delimiter '|' csv;
  • make sure that the last delimiter character near the end of the file is removed.
  • sed 's/.$//' lineitem.tbl > lineitem_smooth.tbl