Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access Oracle table stats, 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'm specifically interested in values NUM_ROWS and AVG_ROW_LEN for the purpose of estimating optimal memory buffer size and fetch size for my queries.

like image 623
Olaf Avatar asked Oct 18 '25 15:10

Olaf


1 Answers

If you're not concerned with database independence

SELECT num_rows, avg_row_len
  FROM all_tables
 WHERE owner = '<<owner of the table>>'
   AND table_name = '<<name of the table>>'
like image 113
Justin Cave Avatar answered Oct 21 '25 05:10

Justin Cave