2022-02-10 11:08:57 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
set -e
|
2022-02-10 11:11:56 -08:00
|
|
|
set -o xtrace
|
2022-02-10 11:08:57 -08:00
|
|
|
|
|
|
|
|
./target/debug/pgcat &
|
|
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
|
2022-02-10 11:16:08 -08:00
|
|
|
psql -e -h 127.0.0.1 -p 5432 -U postgres -f tests/sharding/query_routing_setup.sql
|
2022-02-10 11:08:57 -08:00
|
|
|
|
|
|
|
|
# Setup PgBench
|
|
|
|
|
pgbench -i -h 127.0.0.1 -p 6432
|
|
|
|
|
|
|
|
|
|
# Run it
|
|
|
|
|
pgbench -h 127.0.0.1 -p 6432 -t 500 -c 2
|
|
|
|
|
|
2022-02-10 11:16:08 -08:00
|
|
|
psql -e -h 127.0.0.1 -p 6432 -f tests/sharding/query_routing_test_insert.sql
|
2022-02-10 11:08:57 -08:00
|
|
|
|
2022-02-10 11:20:33 -08:00
|
|
|
psql -e -h 127.0.0.1 -p 6432 -f tests/sharding/query_routing_test_select.sql > /dev/null
|
2022-02-10 11:08:57 -08:00
|
|
|
|
|
|
|
|
# psql -f tests/sharding/query_routing_test_validate.sql
|
|
|
|
|
|
2022-02-10 11:20:33 -08:00
|
|
|
psql -e -h 127.0.0.1 -p 6432 -f tests/sharding/query_routing_test_primary_replica.sql > /dev/null
|