cancel
Showing results for 
Search instead for 
Did you mean: 

How do I efficiently compute approximate table row counts in 16.0.0.2127?

Breck_Carter
Participant
0 Kudos
1,729

The following statement is blindingly fast:

   SELECT count FROM SYSTAB WHERE table_name = 'whatever'
but the result can be wildly incorrect if many rows have been inserted or deleted since the last CHECKPOINT.

Forcing a CHECKPOINT is a simple solution in some contexts (e.g., single-user embedded database) but it is a [cough] unattractive solution for a heavily-used network database.

Is there any other way to obtain an approximately-correct table row count? ( surely the query optimizer knows the answer 🙂

Accepted Solutions (0)

Answers (0)