[fix](tools)fix perf tools analyze db (#23370)

This commit is contained in:
zhangguoqiang
2023-08-23 18:01:40 +08:00
committed by GitHub
parent 8140fc737e
commit c25e1b7d95
4 changed files with 19 additions and 4 deletions

View File

@ -103,9 +103,12 @@ pre_set() {
pre_set "set global parallel_fragment_exec_instance_num=8;"
pre_set "set global exec_mem_limit=32G;"
pre_set "set global query_timeout=900;"
echo '============================================'
pre_set "show variables"
echo '============================================'
pre_set "analyze table hits with sync;"
TRIES=3
QUERY_NUM=1

View File

@ -117,13 +117,14 @@ origin_batch_size=$(
run_sql "set global parallel_fragment_exec_instance_num=8;"
run_sql "set global exec_mem_limit=8G;"
run_sql "set global batch_size=4096;"
run_sql "set global query_timeout=900;"
echo '============================================'
run_sql "show variables;"
echo '============================================'
run_sql "show table status;"
echo '============================================'
start=$(date +%s)
run_sql "analyze database ${DB} with sync;"
run_sql "analyze table lineorder_flat with sync;"
end=$(date +%s)
totalTime=$((end - start))
echo "analyze database ${DB} with sync total time: ${totalTime} s"

View File

@ -133,7 +133,11 @@ echo '============================================'
run_sql "show table status;"
echo '============================================'
start=$(date +%s)
run_sql "analyze database ${DB} with sync;"
run_sql "analyze table part with sync;"
run_sql "analyze table customer with sync;"
run_sql "analyze table supplier with sync;"
run_sql "analyze table dates with sync;"
run_sql "analyze table lineorder with sync;"
end=$(date +%s)
totalTime=$((end - start))
echo "analyze database ${DB} with sync total time: ${totalTime} s"

View File

@ -96,14 +96,21 @@ run_sql() {
echo "$*"
mysql -h"${FE_HOST}" -u"${USER}" -P"${FE_QUERY_PORT}" -D"${DB}" -e "$*"
}
run_sql "set global query_timeout=900;"
echo '============================================'
run_sql "show variables;"
echo '============================================'
run_sql "show table status;"
echo '============================================'
start=$(date +%s)
run_sql "analyze database ${DB} with sync;"
run_sql "analyze table lineitem with sync;"
run_sql "analyze table orders with sync;"
run_sql "analyze table partsupp with sync;"
run_sql "analyze table part with sync;"
run_sql "analyze table customer with sync;"
run_sql "analyze table supplier with sync;"
run_sql "analyze table nation with sync;"
run_sql "analyze table region with sync;"
end=$(date +%s)
totalTime=$((end - start))
echo "analyze database ${DB} with sync total time: ${totalTime} s"