如何获取informix表的大小? [英] How to get the size of a informix table?
问题描述
我需要找出给定表占用了多少磁盘空间.怎么看?假设我有一个名为tb1的表.假设它当前正在使用1000个2kb页面.然后,表大小应为2000kb.
I need to find out how much disk space occupied by a given table. How to see it? Suppose i have a table called tb1. Suppose it is currently using 1000 2kb pages. Then table size should be given as 2000kb.
推荐答案
要添加到Jonathan的注释中,如果表未将数据存储在Blob空间或智能Blob空间中,则oncheck -pt
命令将提供所需的信息.查看每个片段的"Pagesize"和分配的页数"信息.
To add to Jonathan's comment if the table does not store data in blob spaces or smart blob spaces then the oncheck -pt
command will give the required information. Look at the "Pagesize" and "Number of pages allocated" information for each fragment.
您还可以通过以下查询在SQL中获取此信息:
You can also get this information in SQL with a query such as:
select sum(pagesize * nptotal)
from sysmaster:sysptnhdr
where partnum in
( select partnum from systables
where tabname = '<table name>'
union
select partn from sysfragments f, systables t
where f.tabid = t.tabid
and t.tabname = '<table name>' );
这篇关于如何获取informix表的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!