Skip to Main Content

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, John.

Asked: August 18, 2016 - 8:37 pm UTC

Last updated: August 19, 2016 - 3:56 am UTC

Version: oracle11 G

Viewed 1000+ times

You Asked

I have a table that is partitioned on a date column.
When I insert rows into the table and commit all is well.
When I select from the table => select * from tableA partition(xyz); I get the number of rows I expect.
Also if i select from the table using the partition key i get the correct number of rows.
However when I select from all_tab_partitions for that table i see the partitions but the num_rows column is null why.

and Connor said...

NUM_ROWS is only populated when you gather statistics on the table.

Try running:

dbms_stats.gather_table_stats('owner','table_name')

and see how you go.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

John Murphy, August 19, 2016 - 11:40 am UTC

Thank you for a quick and effective responce.

More to Explore

DBMS_STATS

More on PL/SQL routine DBMS_STATS here