Toad World® Forums

How do I find the best SQL?


#1

I have optimized a SQL and it has generated over 100 alternatives, how do I find the best SQL? Can I use the cost value to select the best SQL?


#2

Hi Tina,

The Cost is just an estimation on the performance of the query plan but it may not be accurate enough to reflect the real performance. If you relied on the Cost to determine the best alternative, then it would be essy to miss the fastest SQL.

The most accurate method to find the best alternative is to do a Batch Run. This is the most reliable way. To help user shorten the time to Batch Run, the product provides a Batch Run Criteria window for you to define when a SQL should stop running and when a Batch Run should terminate. You can adjust the settings according to your own need.

Let me know if you need more help. Thanks.