by hari » Tue Apr 21, 2009 11:34 pm
In order to fetch records from a database which is having large number of records, we need to optimize the table fields. To some extend, indexing can be used to reduce the time taken for fetching records in some 'search' criteria.
Stored procedures are mainly used for reducing the network traffic. In most of the cases we are sending request in the form of query to the database to get the desired data and after getting response, sending the second request based on the first one. It will take much time to complete the task. In such cases, we can use stored procedure, because it is stored in the database server and the response of the first request can be used as the request to the second, in the database server itself and no need to go back to the user for the second request.