Skip to content

Latest commit

 

History

History
74 lines (52 loc) · 1.43 KB

File metadata and controls

74 lines (52 loc) · 1.43 KB

Athena_PG

This is the repository of Athena_PG which implments the order-centric plan explorer of Athena.

Dependencies

apt-get update

apt-get install -y wget unzip build-essential pkg-config libicu-dev libreadline-dev libz-dev bison flex gosu locales

Build

1. Build Postgres

# configure pg
./configure --prefix=<set you dir for postgres>/pg 

# build
make -j "$(nproc)" install 

# add system path
echo 'export PATH="$PATH:/<you dir for postgres>/pg/bin"' >> ~/.bashrc
source ~/.bashrc

# enter pg dir
cd <you dir for postgres>/pg

# init postgres data dir
initdb -D data

# start postgres
pg_ctl -D data -l logfile start

# connect to postgres
psql postgres

2. Build pg_prewarm

cd contrib/pg_prewarm

make install

3. Build pg_hint_plan

wget -O REL16_1_6_1.tar.gz "https://github.com/ossc-db/pg_hint_plan/archive/refs/tags/REL16_1_6_1.tar.gz"

tar -zxvf REL16_1_6_1.tar.gz

cd pg_hint_plan-REL16_1_6_1/

# you need to modify the line 4 of file SPECS/pg_hint_plan16.spec
"%define _pgdir   /usr/pgsql-16" => "%define _pgdir   <you dir for postgres>/pg"

make install

4. Modify configurations

# postgresql.conf
shared_preload_libraries = 'pg_prewarm, pg_hint_plan'

5. Load pg_prewarm and pg_hint_plan

# connect to postgres
psql postgres

postgres=# LOAD 'pg_hint_plan';
postgres=# CREATE EXTENSION pg_prewarm;