Skip navigation
24708 Views 7 Replies Latest reply: Feb 17, 2011 5:00 AM by didsnz RSS
Sarma VSBL Somina New Enzee 2 posts since
Feb 16, 2010
Currently Being Moderated

Feb 16, 2010 6:03 AM

SQL Tuning query

I am working on some Oracle SQL queries migrated to Netezza SQLs. While running execution plan I came accross the following nodes Project Node and HashNode. What exatcly happens to the queries having these kind of nodes. How do we know  which node is consuming more resources, I am sure there is order of priority for these nodes to improve the performane......appreciate your inputs.

  • David Shuttleworth Active Enzee 270 posts since
    May 14, 2008
    Currently Being Moderated
    1. Feb 16, 2010 6:49 AM (in response to Sarma VSBL Somina)
    Re: SQL Tuning query

    Projection and hashing are a normal part of how a Netezza system handles a query... to get full details on this you need to read the documentation and/or take a class.

     

    Do you have a specific problem with a given query running slowly? If so, can you post the query together with an indication of data volumes, and the EXPLAIN text?

     

    There may be some issues if you have taken SQL that was tuned for ORACLE and moved it directly across to Netezza 'as-is'..

     

    D.

  • Superuser Rookie 90 posts since
    Sep 19, 2008
    Currently Being Moderated
    2. Feb 16, 2010 8:45 AM (in response to David Shuttleworth)
    Re: SQL Tuning query

    question which cannot be answered in a single post!!!!!! probably you need to learn more on netezza sql execution plans....(advanced concepts), or else knowing little and tweaking can mess up the things.. for now "How do we know  which node is consuming more resources" for this you can see the cost and estimated rows related to that step. review the part of the plan files consuming more cost. it might help. but still, dnt tweak anything untill you understand and go thru the advanced concepts class ..all d best!

  • David Birmingham Active Enzee 429 posts since
    Sep 24, 2007
    Currently Being Moderated
    3. Feb 16, 2010 11:09 AM (in response to Sarma VSBL Somina)
    Re: SQL Tuning query

    Oracle queries may translate syntactically and functionally but not really with the same performance profile. The SMP/RDBMS is not the same architecture as Netezza.

     

    Those who spend time directly porting from an RDBMS into Netezza with one-for-one query/stored-proc etc have not only created a mess, but lost an important opportunity to leverage Netezza's power in context of massively parallel. Often when people build structures and queries in an SMP/RDBMS they are constrained to use index structures and table constructs that align with the RDBMS constraints or weaknesses. Those same constraints and weaknesses do not exist in Netezza, so porting one from the other "as is" is a lot like moving from one house to another and taking all the furniture, trash and even the dust on the floor from the old house to the new, and upon arriving failing to use the jacuzzi, microwave or fireplaces because they didn't exist in the old house. it is also virtually guaranteed that as the old system started running out of power, engineers swarmed to prop it up. We don't want to take any of those performance props with us, either.

     

    That's a long introduction to a short point - analyze what you are trying to accomplish and then shape the data and the queries to make it go. Ignore the performance props from the old system. Configure the Netezza machine to fulfill (one or more) functional mission(s), not just "do what the old system did".

     

    A simple example of this that you will see talked about, is taking a common cursor based query (or series of queries) that perform multiple rules on one-row-at-a-time. Most stored procs in an RDBMS are one-row-at-a-time processes. There is no such thing as one-row-at-a-time in Netezza. In one case, a single process applied four rules to each of 3500 counterparties, costing 30 seconds or more for each and running for hours. A Netezza version of this would "lay the process on its side" and run all 3500 counterparties through one rule, then the next etc. What used to take hours now takes less than a minute.

     

    What this means, is that performance tuning IS NOT IN THE QUERY. In the SMP RDBMS we are constrained to shape the general-purpose hardware's activity by using query tricks. But when you submit a query to Netezza, it is immediately snipped apart and dispatched to leverage the machine's physics. So in a Netezza machine, you can really pull your hair out trying to tweak and tune a query to get just a little more. But in the end, you are much better off in distributing the data, leveraging zone maps and other performance-model features than fiddling with the query. The question you have asked is useful in context of fixing the data so that the query runs faster. It is rarely suitable to spend a lot of time on the the query itself.

     

    This means all of your SQL should be configured for VLDB, not just a common SMP/RDBMS implementation. And avoid those 100-page SQL statements. Netezza has set you free.

  • bmasna New Enzee 12 posts since
    Mar 6, 2009
    Currently Being Moderated
    5. Mar 4, 2010 6:56 PM (in response to Sarma VSBL Somina)
    Re: SQL Tuning query

    Are you referring to Netezza administrators guide? Is there any Netezza advanced concepts document??

    Mostly, order of joins in query should not really matter. I would be very much interested to see how order of join gets impacted if you provide query. I had a discussion with Netezza TAM recently, and understanding is order of joins should not matter as the Netezza planner takes care of how to do joins.

  • Superuser Rookie 90 posts since
    Sep 19, 2008
    Currently Being Moderated
    6. Mar 5, 2010 12:08 AM (in response to bmasna)
    Re: SQL Tuning query

    Netezza Advanced Concepts is avaialble as a webcourse at https://syberworks.com/netezza. if you register for the course you will able to access the digital manual (document) too. the adv concepts discusses more about plan file analyzation and tuning parameters

  • didsnz New Enzee 13 posts since
    Aug 23, 2010
    Currently Being Moderated
    7. Feb 17, 2011 5:00 AM (in response to Superuser)
    Re: SQL Tuning query

    How to understand Explain Plan in Netezza? Any documentatoin available?

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

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