[TYPO3-dev] Typo3 Performance

Dmitry Dulepov 9f4eetb02 at sneakemail.com
Fri Mar 2 17:05:18 CET 2007


Hi!

Martin Kutschker wrote:
> Can you explain this model in short or give me a pointer to an online 
> resource?

This model was proposed by Oracle DB expert Joe Celko. Generally it 
marks branches of the tree with consecutive numbers so that when you 
want to fetch root path or get the whole branch, you just need to issue 
query with two numbers. Example:

                     |- C (3,4)
         |- B (2, 7)-|
A(1,14)-|           |- D (5,6)
         |           |
         |- E (8,13)-|- F (9,10)
                     |
                     |- G (11,12)

For example, to get a root line of F, exec this simple sql:

select t2.uid from table t2, table t1 where t1.num1 between t2.num1 and 
t2.num2 and t1.num1=9

Here num1 is the first number (i.e. 1 for A) and num2 is the second (14 
for A).

That's all. Now imagine if you have index that consists from 
(uid,num1,num2)...

Celko's article:
http://www.intelligententerprise.com/001020/celko.jhtml?_requestid=235427

-- 
Dmitry Dulepov

Web: http://typo3bloke.net/
Skype: callto:liels_bugs

"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)




More information about the TYPO3-dev mailing list