当前位置:网站首页>GBASE 8s 如何并行执行update statistics
GBASE 8s 如何并行执行update statistics
2022-07-29 21:18:00 【八珍豆腐】
为了加快update statistics命令,通常需要通过并行执行提升执行效率。下面是一个 ksh/awk 脚本完成此功能。
#! /usr/bin/ksh if [[ $# -lt 2 ]]; then echo Usage: $0 database #copies exit 1 fi dbase=$1 ncopies=$2 if [[ $# -eq 3 ]]; then templ=$3 else templ='*' fi dbaccess $dbase - </dev/null output to temp$$ without headings select tabname from systables where tabid > 99 and tabname matches "$templ"; EOF awk -v ncopies=$ncopies -v dbase=$dbase ' BEGIN { cnt=0; pdq=100/ncopies; printf "PDQPRIORITY=%d; export PDQPRIORITY \n", pdq; } { if (length( $1 ) == 0){ next; } } { # Every N copies of dostats insert a wait if ((cnt % ncopies) == 0 && cnt > 0) { print "wait"; } # output a dostats command for each table in the background printf "dostats -d %s -t %s & \n", dbase, $1, pdq; cnt++; } END { # Now update stats on all stored procedures. print "dostats -d %s -p \n", dbase; } ' temp$$ ##### End script ##### |
边栏推荐
猜你喜欢

阿里 P8 爆出的这份大厂面试指南,看完工资暴涨 30k!

华为畅享50 Pro评测:HarmonyOS加持 更流畅更安全

PyQt5学习一(环境搭建)

MySQL Data Query - Simple Query
基于PaddleSpeech搭建个人语音听写服务

全自动化机器学习建模!效果吊打初级炼丹师!

Docker 下 Oracle 安装与配置

linux使用脚本安装redis

HMS Core音频编辑服务音源分离与空间音频渲染,助力快速进入3D音频的世界

Fully automated machine learning modeling!The effect hangs the primary alchemist!
随机推荐
全系都更换带T四缸,安全、舒适一个不落
TCP协议详解
WeChat Mini Program 31 Subcontracting Mechanism
Panorama Tutorial丨How to shoot sunrise and sunset scenes in VR panoramic shooting?
品牌广告投放平台的中台化应用与实践
针对自动识别大麦网滑块验证码,提出解决方案,并进行分析、总结
程序员「小镇做题」出身,月薪是父母半年收入 ……
网络通信编程基础,BIO,NIO
刚重装的win7系统不能上网(深度系统安装步骤)
First thoughts on the first attempt to avoid killing without a file (Part 1)
干货!联邦学习中的合作均衡
ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
MySQL - Design game user information table
linux使用脚本安装redis
[ACTF2020 Freshman Competition]Exec 1
LeetCode 593 有效的正方形[数学] HERODING的LeetCode之路
378. The Kth Smallest Element in an Ordered Matrix
Cobaltstrike and BurpSuite desktop shortcut configuration
华为畅享50 Pro评测:HarmonyOS加持 更流畅更安全
Numpy数组处理(二)