forked from greenplum-db/TPC-H
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollout.sh
executable file
·44 lines (38 loc) · 1.57 KB
/
rollout.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -e
PWD=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source $PWD/../functions.sh
source_bashrc
GEN_DATA_SCALE=$1
EXPLAIN_ANALYZE=$2
RANDOM_DISTRIBUTION=$3
MULTI_USER_COUNT=$4
SINGLE_USER_ITERATIONS=$5
if [[ "$GEN_DATA_SCALE" == "" || "$EXPLAIN_ANALYZE" == "" || "$RANDOM_DISTRIBUTION" == "" || "$MULTI_USER_COUNT" == "" || "$SINGLE_USER_ITERATIONS" == "" ]]; then
echo "You must provide the scale as a parameter in terms of Gigabytes, true/false to run queries with EXPLAIN ANALYZE option, true/false to use random distrbution, multi-user count, and the number of sql iterations."
echo "Example: ./rollout.sh 100 false false 5 1"
exit 1
fi
step=sql
init_log $step
rm -f $PWD/../log/*single.explain_analyze.log
for i in $(ls $PWD/*.tpch.*.sql); do
for x in $(seq 1 $SINGLE_USER_ITERATIONS); do
id=`echo $i | awk -F '.' '{print $1}'`
schema_name=`echo $i | awk -F '.' '{print $2}'`
table_name=`echo $i | awk -F '.' '{print $3}'`
start_log
if [ "$EXPLAIN_ANALYZE" == "false" ]; then
echo "psql -v ON_ERROR_STOP=1 -A -q -t -P pager=off -v EXPLAIN_ANALYZE=\"\" -f $i | wc -l"
tuples=$(psql -v ON_ERROR_STOP=1 -A -q -t -P pager=off -v EXPLAIN_ANALYZE="" -f $i | wc -l; exit ${PIPESTATUS[0]})
else
myfilename=$(basename $i)
mylogfile=$PWD/../log/$myfilename.single.explain_analyze.log
echo "psql -v ON_ERROR_STOP=1 -A -q -t -P pager=off -v EXPLAIN_ANALYZE=\"EXPLAIN ANALYZE\" -f $i > $mylogfile"
psql -v ON_ERROR_STOP=1 -A -q -t -P pager=off -v EXPLAIN_ANALYZE="EXPLAIN ANALYZE" -f $i > $mylogfile
tuples="0"
fi
log $tuples
done
done
end_step $step