How to get the size of a informix table?

和自甴很熟 提交于 2019-12-24 10:21:37

问题


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.


回答1:


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.

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>' );


来源:https://stackoverflow.com/questions/54067366/how-to-get-the-size-of-a-informix-table

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!