How to access Oracle table statistics, specifically NUM_ROWS and AVG_ROW_LEN, using JDBC?

Is there a way to access Oracle table level statistics in a Java application using JDBC? I am particularly interested in the values ​​of NUM_ROWS and AVG_ROW_LEN in order to estimate the size of the memory buffer and the sample size for my queries.

+3
source share
1 answer

If you are not interested in database independence

SELECT num_rows, avg_row_len
  FROM all_tables
 WHERE owner = '<<owner of the table>>'
   AND table_name = '<<name of the table>>'
+4
source

All Articles