Home » RDBMS Server » Server Administration » Buffer Cache Hit Ratio - 1235%, what happened?
Buffer Cache Hit Ratio - 1235%, what happened? [message #59043] Fri, 24 October 2003 14:34 Go to next message
Dennis Bustos
Messages: 5
Registered: October 2003
Junior Member
The buffer cache hit ratio went up to 1235%. The Physical reads direct was 4298177707. All indexes are parallel. Any clue as to why it is happening? Thanks.

SQL> select p.value, d.value, l.value,s.value,(1 - (p.value - d.value - l.value) / (s.value))*100 fr
om
2 v$sysstat p,
3 v$sysstat d,
4 v$sysstat l,
5 v$sysstat s
6 where
7 p.name = 'physical reads' and
8 d.name = 'physical reads direct' and
9 l.name = 'physical reads direct (lob)' and
10 s.name = 'session logical reads'
11 /

VALUE VALUE VALUE VALUE (1-(P.VALUE-D.VALUE-L.VALUE)/(S.VALUE))*100
---------- ---------- ---------- ---------- -------------------------------------------
9928699 4298177707 0 377659638 1235.47983
Re: Buffer Cache Hit Ratio - 1235%, what happened? [message #59044 is a reply to message #59043] Fri, 24 October 2003 15:31 Go to previous messageGo to next message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
What version are you using. I've heard of certain bugs that make certain statistics very high..probably your physical reads direct in this case.
Re: Buffer Cache Hit Ratio - 1235%, what happened? [message #59045 is a reply to message #59044] Fri, 24 October 2003 17:28 Go to previous messageGo to next message
Dennis Bustos
Messages: 5
Registered: October 2003
Junior Member
Thanks for the reply, Here's the version:

SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production
Re: Buffer Cache Hit Ratio - 1235%, what happened? [message #59051 is a reply to message #59045] Sat, 25 October 2003 16:51 Go to previous messageGo to next message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
hmm.. Whats Statspack report telling you ? I tend to rely more on that . Also its beneficial to get the statistics over a well defined time interval , instead of getting the cumulative statistics.

I dont generally rely on the buffer cache hit ratio ,becos it may not actually tell you if the database is performing good or not. I've seen databases with hit ratio of 80% performing much better than those that have about 99% hit ratio..

-Thiru
Re: Buffer Cache Hit Ratio - 1235%, what happened? [message #59074 is a reply to message #59051] Mon, 27 October 2003 09:07 Go to previous messageGo to next message
Dennis Bustos
Messages: 5
Registered: October 2003
Junior Member
Thank you.

I found out that the SQL Statement I ran consumes a lot of physical reads direct. When I tried to use /*+ rule */ then it was quick. Because my SQL statement was doing a count(*), do you think that a full-table-scan will be more appropriate.

This is the execution plan from CHOOSE (CBO)

Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2959 Card=4 Bytes=24)
1 0 SORT* (GROUP BY) (Cost=2959 Card=4 Bytes=24) :Q402100 3
2 1 SORT* (GROUP BY) (Cost=2959 Card=4 Bytes=24) :Q402100 2
3 2 HASH JOIN* (SEMI) (Cost=988 Card=1716060 Bytes=1029636 :Q402100 0) 2
4 3 INDEX* (FAST FULL SCAN) OF 'COMPLAINTLEVELS_LEVELID_ :Q402100 IDX' (NON-UNIQUE) (Cost=494 Card=1716060 Bytes=5148180) 0
5 3 INDEX* (FAST FULL SCAN) OF 'COMPLAINTLEVELS_LEVELID_ :Q402100 IDX' (NON-UNIQUE) (Cost=494 Card=1716060 Bytes=5148180) 1

This is the plan when I put the hint /*+ RULE */

Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=HINT: RULE
1 0 SORT (GROUP BY)
2 1 NESTED LOOPS
3 2 VIEW OF 'VW_NSO_1'
4 3 SORT (UNIQUE)
5 4 TABLE ACCESS (FULL) OF 'COMPLAINTLEVELS'
6 2 INDEX (RANGE SCAN) OF 'COMPLAINTLEVELS_LEVELID_IDX' (NON-UNIQUE)
Re: Buffer Cache Hit Ratio - 1235%, what happened? [message #59075 is a reply to message #59074] Mon, 27 October 2003 10:49 Go to previous messageGo to next message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
Whats the sql statement ? Did you analyze all the objects involved ? RULE optimizer has been desupported in the latest release and hence shouldnt be used.
A full table scan is not required for count(*).It should be satisfied by an Index scan(Primary key or a Not NULL column).
Re: Buffer Cache Hit Ratio - 1235%, what happened? [message #59076 is a reply to message #59074] Mon, 27 October 2003 12:09 Go to previous messageGo to next message
Dennis Bustos
Messages: 5
Registered: October 2003
Junior Member
Thanks,

The SQL Statement was
select count(*) from complaintlevels
where levelid in (
select distinct levelid from complaintlevels)
group by levelid

Is this a good approach of viewing efficiency

Should the total of db block gets + consistent gets + physical reads be less than the combined total blocks of all base objects?

I have this in my autotrace statistics:
4 db block gets + 155909 consistent gets + 8665 physical reads = 164578

The total blocks in all base objects is 73216 blocks.

Is this not efficient because it reads 2.247 times as many blocks, eventhough the performance of the report is less than 5 seconds? thanks

Thanks
Re: Buffer Cache Hit Ratio - 1235%, what happened? [message #59077 is a reply to message #59075] Mon, 27 October 2003 12:13 Go to previous messageGo to next message
Dennis Bustos
Messages: 5
Registered: October 2003
Junior Member
The SQL Statement was
select count(*) from complaintlevels
where levelid in (
select distinct levelid from complaintlevels)
group by levelid

Is this a good approach of viewing efficiency

Should the total of db block gets + consistent gets + physical reads be less than the combined total blocks of all base objects?

I have this in my autotrace statistics:
4 db block gets + 155909 consistent gets + 8665 physical reads = 164578

The total blocks in all base objects is 73216 blocks.

Is this not efficient because it reads 2.247 times as many blocks, eventhough the performance of the report is less than 5 seconds? thanks

Thanks
Re: Buffer Cache Hit Ratio - 1235%, what happened? [message #59078 is a reply to message #59076] Mon, 27 October 2003 12:23 Go to previous message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
I am not sure what you are trying to get here ..but you are rereading the same blocks in consistent mode multiple times and hence the high consistent gets and high hit ratio.
Previous Topic: ORA-00600: internal error code, arguments: [kksscl-inf-inl-loop], [1500], [0], [2], [19], [19]
Next Topic: drop datafile
Goto Forum:
  


Current Time: Fri Sep 20 15:34:38 CDT 2024