RE: difference between child and parent latches?

  • From: Paul Drake <discgolfdba@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Mon, 22 Mar 2004 23:34:24 -0800 (PST)

--- Tanel Poder <tanel.poder.003@xxxxxxx> wrote:
> > Not quite true. (at least starting from 9i). The
> shared pool is
> > divided
> > in to multiple sub-pools if it is greater than
> 250MB and/or if your
> > cpu_count > 4. In this case the shared pool is
> covered by multiple
> > shared pool latches.
> 
> I use my chance here to throw in an undocumented
> parameter _kghdsidx_count, which you could modify to
> manually control into how many heaps shared pool
> will be divided. 
> 
> Each heap has it's own freelist and lru lists and
> the latch protecting operations on them, this means
> you could relieve shared pool latch contention in
> extremely poorly written applications, but also you
> might introduce unnecessary ORA-4031 problems, when
> most allocations happen to be non-uniformly
> distributed to some specific heap resulting in out
> of memory error, while others heaps have might have
> enough (but unusable) space in them..
> 
> About parent vs child latches. There is no
> fundamental low level difference between parent and
> child latches, they are all small regions of memory
> modified with atomic test-and-set style opcodes.
> 
> You see parent (and solitary) latches from x$ksllt
> where kslltcnm = 0 and child latches have kslltcnm >
> 0 (their child number is stored there).
> 
> V$LATCH_PARENT shows all latches with kslltcnm 0,
> V$LATCH_CHILDREN shows all latches with cnm > 0.
> V$LATCH just summarizes & groups all statistics up
> using the latch number, it doesn't care about parent
> vs child latches.
> 
> It's up to Oracle, how it uses the child and parent
> latches, normally when child latches are used,
> parent latches don't get used much (or at all),
> since all resources to be protected have been spread
> between child latches already.
> 
> However, there is a case with library cache parent
> latch (as mentioned also in Steve Adams book), it
> doesn't get used normally, but when you flush the
> shared pool, it get's used for example.
> 
> 
> Tanel.
> 

does anyone know the rules of thumb for how many
latches would be used for amounts less than 250 MB?

> this means
> you could relieve shared pool latch contention in
> extremely poorly written applications

bingo. sign me up.


Tanel,

sorry that I missed your presentation at Hotsos on
small table tuning.

I tend to keep the shared pool somewhat smaller.
I just didn't think that it was worth keeping 250MB of
non-reusable statements around, but if that is what it
takes to kick in the multiple latches without having
to resort to underscore parameters ... so be it.

what if the cpu_count=4, not > 4?

thanks,

Paul



__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: