on 2017 Jun 15 6:24 AM
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 🙂
Request clarification before answering.
User | Count |
---|---|
46 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.