Menu

#16 ora.properties - invalid selectRowCountSql

Unstable (example)
open
nobody
None
5
2014-06-20
2014-06-04
Mark Berger
No

Hi John

We use Oracle with some large tables and want to show the number of rows in the SchemaSpy output. However, scanning these tables to count number of rows takes too long.

The solution offered for different dbTypes is great. However, the selectRowCountSql included in the default ora.properties is not quite correct.

The following does the trick and works with Oracle 11.

selectRowCountSql=select num_rows row_count from all_tables where table_name=:table and owner = :owner

Would it be possible to get the default ora.properties updated?

Thanks
Mark

Discussion

  • John Currier

    John Currier - 2014-06-20

    The existing query is:
    selectRowCountSql=select table_rows row_count from information_schema.tables where table_name=:table

    Is it returning incorrect results?

    Thanks,
    John

     
  • Mark Berger

    Mark Berger - 2014-06-20

    Hi John

    I am using oracle 11g and oracle 12c and the table 'information_schema.tables' doesn't exist.

    It exists in mysql, which, even though 'oracle corporation' owns both, is quite a separate product family from oracle databases.

    So the net effect is that code falls back to doing select count(*) which takes too long on the large tables.

    Hope this helps.

    Regards
    Mark

     

Log in to post a comment.