#!/bin/bash export PATH=$PATH:$PWD/bin dbname=postgres secs=30 psql -c "alter system set max_parallel_workers_per_gather = 0;" $dbname > /dev/null psql -c "select pg_reload_conf();" $dbname > /dev/null psql -c "create extension if not exists uri;" $dbname > /dev/null cat << EOSQL > bench.sql WITH u(uri) AS MATERIALIZED ( SELECT 'https://example.com#comments'::uri ) SELECT regexp_replace( uri::text, uri_host( uri ), '事例.com' )::uri FROM u; EOSQL for i in {1..5} do pgbench -n -f bench.sql -M prepared -T $secs $dbname | grep tps done