Monday, 18 June 2012

Simple SQL tuning

In this post i will tell you how to perform a simple SQL tuning,SQL tuning is a very vast topic and there are various ways for doing it,but here is the simplest of the ways

follow these simple steps for tuning a timeconsuming SQL statement,screenshots are also provided for a better result

Step 1) Connect to the database and connect to particular user in database whose query is to be tuned


Step 2) Now fire the query which is taking time or sql query which you want to tune.


Step 3) Use autotrace utility by making traceonly option and again fire the query which you want to tune,this time the query will not display the output,rather it will display the execution plan of the query


Step 4) Now from the execution plan you can check full table access,consistent gets, physical reads, sorts to disk, recursive calls and sorts to memory and fine tune your query based on this


NOTE:-from the execution plan you can only get some statistics related to the SQL query,you will then have to use those statistics to tune the SQL


No comments:

Post a Comment