02 October 2009

0 SQL Tutorial - Decrease the retrieval time from database using Multiple threads

SQL Tutorial - SQL Tip - Decrease the retrieval time from database using Multiple threads

How To  decrease the retrieval time while retrieving data from a table from database?

Normal retrieval query  :    

select  *  from user_info
     since user_info table having vast amount of data it will take lot of  time to retrieve entire data.

Query with Multi threading

select  /*+parallel(8)*/   *   from user_info
       8 in parenthesis represents number of threads. It will invoke 8 threads  and execution will happen on 8 threads in parallel. Comparatively this query using multiple threads will take less time  than the earlier query. Query with Multi threading will help us to reduce the execution time while fetching large number of records.


0 comments:

Feeds Comments

Please give your valuable comments.