在数据库没有做update statistics前,systables表里各表记录数与实际表记录数差别比较大,这种情况下可以通过以下方法统计各表的记录数.
脚本如下:
- #!/bin/ksh
- if [ $# -ne 1 ];then
- cat << EOF
- Usage: $0 dbsname
- EOF
- exit 1
- fi
- dbsname="$1" #数据库名
- echo "unload to tables.txt
- select tabname from systables where tabname not like 'sys%' and tabname not like ' %' and tabtype='T';">tables.sql
- dbaccess $dbsname tables.sql 2>/dev/null
- cat tables.txt|awk -F"|" '{print $1}'>tables2.txt
- for i in `cat tables2.txt`
- do
- #统计数据库表记录数
- echo "unload to count.txt select \"$i\"||\"\",count(*) from $i;">file.sql
- dbaccess $dbsname file.sql
- cat count.txt>>total.txt
- rm count.txt
- rm -rf file.sql
- done
- rm -f tables2.txt tables.sql
本日志由 flyinweb 于 2009-10-28 10:25:21 发表到 数据库技术 中,目前已经被浏览 3817 次,评论 0 次;
作者添加了以下标签: 统计Informix表记录数;
而且直接配置文件是效率最高的,通过其它驱动效率都相对较低,BDB
这个测试不太准确,看官方的测试结果:http://bind-dlz.sourceforg
为什么使用BDB时QPS这么低? 我在bind版本基本相似的环境中测试的
It is quite useful and interesting too.
VIRT 的上限是64G,也就是36位, cat /proc/cpuinfo的结果是:addre
昨天要准备用线程重写webbench,试验了下Fedora Linux 2.6.35.14
不明白您的具体的意思是什么?
已经发送到你QQ邮箱