RE: Tuning By cardinality Estimates

From: Desai, Bhavik \(MLITS\) <"Desai,>
Date: Fri, 6 Mar 2009 15:18:45 +0530
Message-ID: <>


I am not seeing any difference between estimated and actual cardinalities.
FYI...For NESTED LOOPS, START * ESTIMATED_CARDINALITY=ACTUAL CARDINALITY. (Actual cardinality is an cumulative number) This is because, START field defines how many times LOOPS iterates.

Bhavik Desai

-----Original Message-----

[] On Behalf Of hrishy Sent: Friday, March 06, 2009 3:12 PM
Subject: Tuning By cardinality Estimates


I am trying to tune a query which is attached along with the plan. In some of the steps the estimated cardinality and actual rows is way off .

esp step 7,8,9,10,11

As a result of the wrong cardinality estimation instead of a hash join the optimizer chooses Nested Loops and the query takes almost 7 minutes to complete.

I resort to use_hash hint and the query completes in 2 minutes.

My question how do i make the optimizer aware of the correct cardinalities.
I have collected stats fresh .


This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. References to "Merrill Lynch" are references to any company in the Merrill Lynch & Co., Inc. group of companies, which are wholly-owned by Bank of America Corporation. Secur  ities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this E-communication may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: By messaging with Merrill Lynch you consent to the foregoing.

-- Received on Fri Mar 06 2009 - 03:48:45 CST

Original text of this message