Sunday, March 7, 2010

Explain Sql- Part II

In one of my previous post I mentioned about creating a plan table and how to insert the plan of sql execution statement to the table. Bud I really did not get time analyze the plan.

Couple of days back I noticed that one of the sql statements that I had to execute to retrieve data was taking more than 3 minutes. So I created a plan for the same and analyzed the sql. First thing I noticed from the plan was SQL was doing a FULL SCAN on table S_CALL_LST_CON which had millions of records and it was costing more. I was thinking of constraints that would reduce the cost based on the user key of S_CALL_LST_CON ..Hurray!! it did work .Now the time it took to retrieve data was less than a second. That's it for now..Later..

No comments:

Post a Comment