If you look at your docs., you'll find that table stats. include
FPAGES: Total number of pages to hold the table
NPAGES: Number of page holding at least one row.
The ratio of npages over fpages is an indication of the amount of "fluff" in
your table.
If FPAGES is 0 then CARD should be 0 also.
You can use Google to find stuff like that. I did a google search on: db2
size estimate.
HTH, Pierre.
Here's what Craig Tobias from IBM suggests;
estimate size
Posted by: Craig Tobias, 2004 March 29 02:21 PM
Jean-Marc,
In v8.1, we created some stored procedures to capture and save storage
snapshots. Snapshots can be captured for Databases, Table spaces,
Tables,
Indexes, and Database Partition Groups. To capture storage data
(including
estimated size) for all objects (including tables) in a database, you
should
capture a database snapshot.
Before capturing a snapshot, you must create the storage management
tables
(where all snapshot data is stored). Run the following command to
create the
storage tables, and specify a table space for the tables.
db2 connect to
db2 call create_storagemgmt_tables('')
Now, capture a snapshot at the database level... this can take a while
for
large databases. You may also want to update your table statistics
using
the Runstats utility before running the storage snapshot. To capture a
snapshot, run the following command:
db2 call capture_storagemgmt_info(0, ' ', '')
The table related data is stored in the SYSTOOLS.STMG_TABLE table. You
also
need to do a name lookup in the SYSTOOLS.STMG_OBJECT table. To query
the
storage management tables for estimated table size, run the following
command...
SELECT
MAX(tables.STMG_TIMESTAMP) as SNAPSHOT_TIMESTAMP,
tables.OBJ_ID,
object.OBJ_NAME,
object.obj_schema,
tables.ESTIMATED_SIZE
FROM
SYSTOOLS.STMG_TABLE tables
INNER JOIN
SYSTOOLS.STMG_OBJECT object
ON tables.obj_id = object.obj_id AND tables.stmg_timestamp =
object.stmg_timestamp
GROUP BY tables.STMG_TIMESTAMP, tables.ESTIMATED_SIZE, tables.obj_id,
object.obj_name, object.obj_schema
The number of bytes used by the table is displayed in the
ESTIMATED_SIZE
column.
You can also delete historical snapshots by deleting entries from the
SYSTOOLS.STMG_ROOT_OBJECT table. To delete all historical data, run
the
following query:
DELETE FROM SYSTOOLS.STMG_ROOT_OBJECT
There is also a stored procedure which will drop all of the storage
management tables.
db2 call drop_storagemgmt_tables(0)
All of the snapshot data can easily be viewed using the storage
management
tool which is launched from the DB2 Control Center, Database > Manage
Storage...
The storage management tool provides detailed historical analysis of
the
captured snapshot data for all storage related objects in the
database, as
well as a way to schedule regular snapshots, and delete historical
snapshots.
Craig Tobias
DB2 Admin. Tools Development
IBM Toronto Lab
--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
"dunleav1" <jm*@dunleavyenterprises.com> a écrit dans le message de
news:11********************@f14g2000cwb.googlegrou ps.com...
Yes, I am relying on my statistics to be current.
Thanks for card definition to equal the number of rows.
Since fpages may by 0, what is the best way to calculate the size for
the table and index?