@@ -30,6 +30,7 @@ Database experiments are needed when you:
30
30
31
31
Currently Supported Features
32
32
===
33
+ * Works anywhere where Docker can run (checked: Linux Ubuntu/Debian, macOS)
33
34
* Experiments are conducted in a Docker container with extended Postgres setup
34
35
* Supported Postgres versions: 9.6, 10
35
36
* Postgres config specified via options, may be partial
@@ -77,8 +78,8 @@ In the minimal configuration, only two steps are needed:
77
78
2 ) Clone this repo and adjust ` $PATH ` :
78
79
``` bash
79
80
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
82
83
```
83
84
84
85
Additionally, to allow use of AWS EC2 instances:
@@ -99,36 +100,48 @@ nancy run help
99
100
100
101
"Hello World!"
101
102
===
102
- Locally:
103
+ Locally, on any Linux or macOS machine :
103
104
``` 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
105
107
106
108
# "Clean run": w/o index
107
109
# (seqscan is expected, total time ~150ms, depending on resources)
108
110
nancy run \
109
- --run-on localhost \
110
111
--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;"
113
113
114
114
# Now check how a regular btree index affects performance
115
115
# (expected total time: ~0.05ms)
116
116
nancy run \
117
- --run-on localhost \
118
117
--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;" \
121
119
--target-ddl-do " create index i_hello_world_i on hello_world(i);" \
122
120
--target-ddl-undo " drop index i_hello_world_i;"
123
121
```
124
122
125
- On AWS EC2:
123
+ AWS EC2:
126
124
``` bash
127
125
nancy run \
128
126
--run-on aws \
129
127
--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;"
133
132
```
134
133
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