Question

I tried getting the number of tables of a particular tablespace and database from SYSIBM.SYSTABLES using the select query. This number is more than the number of tables for the same tablespace and database stored in the SYSIBM.SYSTABLESPACE table under the NTABLES column. Why is this so?

Was it helpful?

Solution

It could be the fact that systables stores entries for each table, view or alias, in fact a large number of objects that may not necessarily be included within a tablespace.

You could confirm this by only listing those where type = 'T' (or some other combination of the allowed values).

If you select count(*) from systables (for a given tablespace) and group it by type, you may find it reasonably easy to assign some of those types to the tablespace.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top