473,396 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Table size in bytes

Hi!

How can I see the actual size of a table is bytes?
I could to a count on table and multiply by page size, but we are using
VARCHARs and I'm affraid that is not the correct value.
I could also find the file that a table is stored in, but I don't know where
to find this information. Where is this information stored in a database?

Thanks and best regards,
Kovi

--
____________________________
|http://kovica.blogspot.com|
-----------------------------~-~-~-~-~-~-~-~-~-~-
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Jan 31 '08 #1
3 2151
On Jan 31, 9:03*am, Gregor Kovač <gregor.ko...@mikropis.siwrote:
Hi!

How can I see the actual size of a table is bytes?
I could to a count on table and multiply by page size, but we are using
VARCHARs and I'm affraid that is not the correct value.
I could also find the file that a table is stored in, but I don't know where
to find this information. Where is this information stored in a database?
Of course you can try this with the information taken from the
catalog. But the statistics have to be actual...

db2pd -db DB -tcbstats

gives a more reliable output - you can also specify the tablespace
(and table ?).

The size of the file is also a way - but this works for SMS only:
Derive the containers of the tablespace where your table lives.
Then the files have the tableid in their names in these containers.
There can be different types like *.dat (data) *.INX *.IN1 (indexes)
and others.
They give you the current usage on disk for data and indexes and lobs.

db2pd also gives the sizes of indexes...
Jan 31 '08 #2
stefan.albert wrote:
The size of the file is also a way - but this works for SMS only:
Derive the containers of the tablespace where your table lives.
Then the files have the tableid in their names in these containers.
There can be different types like *.dat Â*(data) *.INX *.IN1 (indexes)
and others.
They give you the current usage on disk for data and indexes and lobs.
Thanks, this is what I was looking for.

Best regards,
Kovi
--
____________________________
|http://kovica.blogspot.com|
-----------------------------~-~-~-~-~-~-~-~-~-~-
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Jan 31 '08 #3
I found out that you could get the actual size of a table TABLE1 with this
SQL:

SELECT TABSCHEMA, TABNAME, DATA_OBJECT_P_SIZE + INDEX_OBJECT_P_SIZE +
LONG_OBJECT_P_SIZE + LOB_OBJECT_P_SIZE + XML_OBJECT_P_SIZE AS TOTAL_SIZE
FROM SYSIBMADM.ADMINTABINFO WHERE TABNAME = 'TABLE1'

--
____________________________
|http://kovica.blogspot.com|
-----------------------------~-~-~-~-~-~-~-~-~-~-
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Jan 31 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jim Garrison | last post by:
Scenario: 1) Create a GLOBAL TEMPORARY table and populate it with one (1) row. 2) Join that table to another with about 1 million rows. The join condition selects a few hundred rows. ...
2
by: TZone | last post by:
I was hoping I can get some help regarding subject mater located at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_02_92k3.asp MyTable has 23 fields with...
36
by: toedipper | last post by:
Hello, I am designing a table of vehicle types, nothing special, just a list of unique vehicle types such as truck, lorry, bike, motor bike, plane, tractor etc etc For the table design I am...
10
by: Bing Wu | last post by:
Hi Folks, I have a problem while creating a big table space. It reports error: SQL1139N The total size of the table space is too big Explanation: The size of the current table space is too...
2
by: Stanley Sinclair | last post by:
About to create a table which will "include" a BLOB. Am not sure how large to make the container and the tablespace. What I see says that BLOB is stored "separately." However, I don't know...
7
by: greywire | last post by:
So I need to load lots of data into my database. So I discover LOAD DATA INFILE. Great! This little gem loads my CSV in blazing times (compared to parsing the file and doing INSERT for each...
8
by: rshivaraman | last post by:
Hi : I have a TableA with around 10 columns with varchar and numeric datatypes It has 500 million records and its size is 999999999 KB. i believe it is kb i got this data after running...
6
by: shawno | last post by:
Hi, We're running DB2 v8.1 on a windows platform and have a database that is quite large. It basically contains one table with a BLOB field (each blob is a zip file, maybe 500K to 1MB), and...
7
Dormilich
by: Dormilich | last post by:
lately, people have complained that the new layout is too narrow on most Computer/Laptop screens. Firefox users can make use of the Greasemonkey Addon to apply on-the-fly changes. (Opera users can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.