Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 68ea741

Browse files
author
postgres-ai
authored
Merge pull request #76 from postgres-ai/rework
Rework "nancy run"
2 parents 62afc7c + cece627 commit 68ea741

17 files changed

+745
-641
lines changed

README.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Database experiments are needed when you:
3030

3131
Currently Supported Features
3232
===
33+
* Works anywhere where Docker can run (checked: Linux Ubuntu/Debian, macOS)
3334
* Experiments are conducted in a Docker container with extended Postgres setup
3435
* Supported Postgres versions: 9.6, 10
3536
* Postgres config specified via options, may be partial
@@ -77,8 +78,8 @@ In the minimal configuration, only two steps are needed:
7778
2) Clone this repo and adjust `$PATH`:
7879
```bash
7980
git clone https://github.com/startupturbo/nancy
80-
echo "export PATH=\$PATH:"$(pwd)"/nancy" >> ~/.bashrc
81-
source ~/.bashrc
81+
echo "export PATH=\$PATH:"$(pwd)"/nancy" >> ~/.bash_profile
82+
source ~/.bash_profile
8283
```
8384

8485
Additionally, to allow use of AWS EC2 instances:
@@ -99,36 +100,48 @@ nancy run help
99100

100101
"Hello World!"
101102
===
102-
Locally:
103+
Locally, on any Linux or macOS machine:
103104
```bash
104-
echo "create table hello_world as select i::int4 from generate_series(1, (10^6)::int) _(i);" > ./sample.dump
105+
echo "create table hello_world as select i from generate_series(1, (10^6)::int) _(i);" \
106+
| bzip2 > ./sample.dump.bz2
105107

106108
# "Clean run": w/o index
107109
# (seqscan is expected, total time ~150ms, depending on resources)
108110
nancy run \
109-
--run-on localhost \
110111
--db-dump file://$(pwd)/sample.dump.bz2 \
111-
--tmp-path /tmp \
112-
--workload-custom-sql "select count(1) from hello_world where i between 100000 and 100010;"
112+
--workload-custom-sql "select i from hello_world where i between 10 and 20;"
113113

114114
# Now check how a regular btree index affects performance
115115
# (expected total time: ~0.05ms)
116116
nancy run \
117-
--run-on localhost \
118117
--db-dump file://$(pwd)/sample.dump.bz2 \
119-
--tmp-path /tmp \
120-
--workload-custom-sql "select count(1) from hello_world where i between 100000 and 100010;" \
118+
--workload-custom-sql "select i from hello_world where i between 10 and 20;" \
121119
--target-ddl-do "create index i_hello_world_i on hello_world(i);" \
122120
--target-ddl-undo "drop index i_hello_world_i;"
123121
```
124122

125-
On AWS EC2:
123+
AWS EC2:
126124
```bash
127125
nancy run \
128126
--run-on aws \
129127
--aws-ec2-type "i3.large" \
130-
--aws-keypair-name awskey --aws-ssh-key-path file://$(echo ~)/.ssh/awskey.pem \
131-
--db-dump "create table a as select i::int4 from generate_series(1, (10^9)::int) _(i);" \
132-
--workload-custom-sql "select count(1) from a where i between 10 and 20;"
128+
--aws-keypair-name awskey \
129+
--aws-ssh-key-path file://$(echo ~)/.ssh/awskey.pem \
130+
--db-dump "create table hello_world as select i from generate_series(1, (10^6)::int) _(i);" \
131+
--workload-custom-sql "select i from hello_world where i between 10 and 20;"
133132
```
134133

134+
Additional notes
135+
===
136+
If you experience issues with running (locally) `nancy run` inside `screen` or
137+
`tmux`, double-check that Docker is running and add your user to the `docker`
138+
group:
139+
```bash
140+
usermod -aG docker ${USER}
141+
```
142+
143+
On MacOS, it is recommended to specify `--tmp-path` explicitly, similar to this:
144+
```
145+
mkdir ./tmp
146+
nancy run ... --tmp-path "$(pwd)/tmp"
147+
```

0 commit comments

Comments
 (0)