I moved a table from TS with page size 4K to another TS with page size 16K. For some reason the size of the table changes (table gets smaller). Here is the query I use to calculate the size:
db2 “select substr(t.tabschema,1,10)||’.’||substr(t.tabname,1, 20) as table ,char(date(t.stats_time)) as statsdate ,char(time(t.stats_time)) as statstime ,T.CARD as rows_per_tbl, t.fpages as used_pages ,decimal(float(t.npages)/(1024/ (ts.pagesize/1024)),9,2) as used_mb ,decimal(float(t.fpages)/(1024/(ts.pagesize/1024)),9,2) as allocated_mb from SYSCAT.TABLES T ,SYSCAT.TABLESPACES TS where t.tbspace=ts.tbspace and T.tabname=’BS_AAA‘ and T.TYPE=’T’”
size before move (in TS with 4K page size):
TABLE STATSDATE STATSTIME ROWS_PER_TBL USED_PAGES USED_MB ALLOCATED_MB
-------------------------- ---------- --------- ------------- ----------- ----------- ------------
DBA .BS_AAA 12/15/2009 10:35:57 71182908 16249848 63475.96 63475.96
size after move (in TS with 16K page size):
TABLE STATSDATE STATSTIME ROWS_PER_TBL USED_PAGES USED_MB ALLOCATED_MB
------------------------- ---------- --------- ------------- ------------ ---------- ------------
DBA .BS_AAA 12/14/2009 09:59:17 71182908 3571295 55801.48 55801.48
What is wrong here? Is this the query or something else?
Thanks in advance