Skip navigation
12469 Views 5 Replies Latest reply: May 24, 2011 5:49 PM by NetezzaRocks RSS
Amit Shete New Enzee 6 posts since
Jun 6, 2010
Currently Being Moderated

Sep 8, 2010 4:00 PM

Hierarchy resolution

Hi All,

 

Is there any clause in Netezza similar to CONNECT BY PRIOR.

  • Shawn Fox Enzee Exraordinaire 1,326 posts since
    Aug 15, 2006
    Currently Being Moderated
    1. Sep 8, 2010 4:15 PM (in response to Amit Shete)
    Re: Hierarchy resolution

    Netezza does not support CONNECT BY or the recursive version of the WITH statement at this time (not in 6.0 either).  The best way to resolve the issue is at data load time.  Just create multiple tables instead of shoving everything into a single table... the performance is better using that method anyway.  Alternatively you can create a view that uses multiple self joins but the queries are going to run slower that way.  This is of course assuming that you have a set number of hierarchy levels which I've found to almost always be the case.

  • David Shuttleworth Active Enzee 270 posts since
    May 14, 2008
    Currently Being Moderated
    3. Sep 9, 2010 4:09 AM (in response to Amit Shete)
    Re: Hierarchy resolution

    Even if the data is already loaded, it should be very quick and simple to restructure the data as suggested by Shawn above on the Netezza system.. give it a try!

     

    D.

  • gbronner New Enzee 9 posts since
    Jul 1, 2009
    Currently Being Moderated
    4. Sep 24, 2010 6:44 PM (in response to David Shuttleworth)
    Re: Hierarchy resolution

    There was a presentation on this at Enzee Universe.

     

    I'd disagree about this being a good solution, however: If you have a small number of hierarchy levels, the multiple table strategy works IF you ensure that the index columns are properly distributed to the same node.

     

    If you have an arbitrarily deep hierarchy, the self joins rapidly become very very complex  You can use a series of temp tables instead possibly.

  • NetezzaRocks New Enzee 1 posts since
    Mar 14, 2011
    Currently Being Moderated
    5. May 24, 2011 5:49 PM (in response to Amit Shete)
    Re: Hierarchy resolution

    Can we do this with ragged hierarchies as well?

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points