• sarat_reddy (9/19/2014)


    Remember trying this a while back. updates took a long time. also correcting data was difficult. Prefer an adjacency list with a lineage column method

    That's why the article suggests using all 3 hierarchy types. The Adjacency List makes it easy to maintain. The Lineage Column provides the right kind of sortability and other performance features. The Nested Sets provide extreme performance for most lookups and aggregations. And it all takes less than a minute to update a million node hierarchy because it doesn't use a RBAR push-stack to rebuild any of it.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)