Skip to content

Instantly share code, notes, and snippets.

@mrsiano
Last active May 24, 2017 14:15
Show Gist options
  • Save mrsiano/1afa8f1a26e69d9ffa53598d7ec92015 to your computer and use it in GitHub Desktop.
Save mrsiano/1afa8f1a26e69d9ffa53598d7ec92015 to your computer and use it in GitHub Desktop.
psql-simulatnusly-hits.sh
#!/bin/sh
# the following script simply testing an SQL for simulatnusly execution.
# usage: ./psql-simulatnusly-hits.sh test "SELECT EXTRACT(DECADE FROM TIMESTAMP '2017-05-01 20:00:00');"
db=$1
sql=$2
parallel=$3
# TODO: add statistics.
for p in `seq 1 $parallel`; do
nohup psql -U $db -c "$sql" > /dev/null 2>&1 & echo "";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment