urmalp
urmalp

Reputation: 382

getting row count in db2 using system tables?

I can get row count from system table in db2 using

select tabname,card from syscat.tables where tabname='?'

but this will give static row count,If I need to get dynamic one I need to run runstats on the table. is there any other way apart from using count(*) ?

Upvotes: 2

Views: 19251

Answers (1)

Fred Sobotka
Fred Sobotka

Reputation: 5332

A materialized query table (MQT) is another option, but it is only available for more expensive DB2 product licenses. Here's an overview: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0509melnyk/

Upvotes: 1

Related Questions