Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: What's fast way to get total of records
Daniel Roy wrote:
>Thanx Richard for your reply. I didn't think that analyzing would make
>a difference in that case (I know, Iknow, I should always analyze my
>tables under CBO). I analyzed the table, and the exec plan in fact
>changed to using the index, even without a hint. Anyone has an idea
>why the plan would change according to how many rows Oracle thinks
>there are in the table (before I analyzed the table, Oracle thought
>that there were 41 rows in the table)?
>
>Daniel
>
>
If the cost of reading the index blocks plus reading the table blocks is
higher than the cost of just
reading the table blocks using the index costs more.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Fri Sep 26 2003 - 18:40:07 CDT