Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to optimize this query?
On Wed, 06 Aug 2003 10:44:28 GMT, "Edward J. Prochak"
<ed.prochak_at_magicinterface.com> wrote:
>My understanding is that the optimizer can decide that if it can answer
>COUNT(*) from table statistics, then it will do so. I hadn't thought about
>using it as a wrapper around the actual query. In that case you are right,
>cause there's no statistics for the optimizer to look at.
But optimiser statistics (user_tables.num_rows) cannot be used as the basis for COUNT(*), since they are only refreshed periodically; so after the first insert/delete after gathering stats, it would give the wrong answer.
It's going to have to scan _something_; most likely an index.
-- Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk) Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)Received on Wed Aug 06 2003 - 18:01:52 CDT
![]() |
![]() |