Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to optimize this query?

Re: How to optimize this query?

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Thu, 07 Aug 2003 00:01:52 +0100
Message-ID: <1223jvomkc43md42gi5rem94mk32uvltkp@4ax.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US