2

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(*) ?

1
  • +1 for anyone else getting here from Google trying to figure out how to do a select count(*) on a massive table! Thanks for your answer! Commented Feb 2, 2014 at 17:26

1 Answer 1

1

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/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.