RE: freelists

  • From: "Looney, Jason" <Jason.Looney@xxxxxxxxxxxx>
  • To: 'Lex de Haan' <lex.de.haan@xxxxxxxxxxxxxx>, Graeme.Farmer@xxxxxxxxxx, alavihamid@xxxxxxxxx
  • Date: Fri, 5 Nov 2004 11:34:22 -0700

Lex,

  Thanks for the correction.  The main point I was trying to make was that a
prime number of Free Lists is not a good idea, and in fact will lead to an
underutilized free list(s).  Oracle's Hash algorithm also doesn't care about
primes because it is based on a 2^n system.

Jason.

-----Original Message-----
From: Lex de Haan [mailto:lex.de.haan@xxxxxxxxxxxxxx] 
Sent: Friday, November 05, 2004 11:03 AM
To: Looney, Jason; Graeme.Farmer@xxxxxxxxxx; alavihamid@xxxxxxxxx
Cc: oracle-l@xxxxxxxxxxxxx; oracle-l-bounce@xxxxxxxxxxxxx
Subject: RE: freelists

Hi Jason,

if you ask for five partitions, all five will be used.
the algorithm will be based on eight partitions -- the next power of 2 --
and buckets 6-7-8 will be mapped to buckets 2-3-4 respectively.
additions/corrections welcome,

Lex.
 
-------------------------------
visit http://www.naturaljoin.nl 
-------------------------------
skype me <callto://lexdehaan> 


-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of Looney, Jason
Sent: Friday, November 05, 2004 18:52
To: 'Graeme.Farmer@xxxxxxxxxx'; alavihamid@xxxxxxxxx
Cc: oracle-l@xxxxxxxxxxxxx; oracle-l-bounce@xxxxxxxxxxxxx
Subject: RE: freelists


Graeme,
 
  From what I understand in regards to Oracle's Hash algorithm, the number
of possible outcomes from the Hash should be on a 2^n system.  So, the
possibilities are 1, 2, 4, 8, 16, 32, 64, 128, etc.  For example, if you
have a hash partitioned table and set the number of partitions to 5, the
fifth one will not be used.  The same is true with Freelists. Oracle does a
hash to determine which one you get, but if you have 5 freelists the fifth
one will not be used, but 1-4 will be fairly evenly distributed.  This
usually isn't a huge deal because when one freelist is exhausted, it
allocates more to that particular freelist, not to all of them.  So, the 5
freelist will always have the initial amount in it.

Jason.


-----Original Message-----
From: Graeme.Farmer@xxxxxxxxxx [mailto:Graeme.Farmer@xxxxxxxxxx] 
Sent: Thursday, November 04, 2004 5:24 PM
To: alavihamid@xxxxxxxxx
Cc: oracle-l@xxxxxxxxxxxxx; oracle-l-bounce@xxxxxxxxxxxxx
Subject: Re: freelists

When freelists is greater than 1, sessions are allocated to 
segment/process freelists based on a hash function and hash functions 
generally give more even spread (avoid collisions) when the hash table 
size is a prime number.
The hash function in this case is based on the session id of the 
connecting user. (mod(SID,FREELISTS)+1).

eg SID=10, FREELISTS=3, HASH = mod(10,3)+1 = 1+1 = 2

Oracle appears to allocate SIDs by choosing the "Least Recently Used" SID 
or allocating them sequentially if there are no "second hand" SIDs so to 
speak. I don't believe this combination of allocation mechanism along with 
the hashing function would be particularly susceptible to collisions, 
however it is usually safer to stick to prime numbers for most hash 
tables.

Of course, your need for configuring freelists in the first place should 
be well justified and evidenced.

Graeme 


oracle-l-bounce@xxxxxxxxxxxxx wrote on 04/11/2004 03:23:11 AM:

> List,
> 
> I have read that freelist must be a n even number like 1,2,3,5,7 etc 
> my question is what happen if you define freelist = 4, some thing
> wrong or what?
> any idea?
> 
> Thanks,
> --
> //www.freelists.org/webpage/oracle-l


-- 
This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please notify
the sender and delete the transmission. The contents of this e-mail are the
opinion of the writer only and are not endorsed by the Mincom Group of
companies unless expressly stated otherwise.



--
//www.freelists.org/webpage/oracle-l
--
//www.freelists.org/webpage/oracle-l
--
//www.freelists.org/webpage/oracle-l

Other related posts: