Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Record Pre Fetch Size

 
Malli Raman
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.What is the advantage of using Record Prefetch size?
2. At what situation we can use this option?
Case study:
Consider that I am using Weblogic / Servlets in the application. The default prefetch size is 10.
And let say that the number of records available in the table is 100.
So if i want to get the 100 Records, how many calls i have to make?
--> if the answer is 10 , whether it won't affect the performance of the system.
Regards,
M.S.Raman
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Minor performance gains can be achieved through using setFetchSize
2. The larger the number of results, the more noticeable the performance difference may be. For fetching a 100 rows, you probably won't notice a difference. But the only way to know is to do a couple of test cases. NOTE: many drivers just ignore this feature. Even though you set the fetch size, they still may just ignore the request without any notification to you.
"Normally, the most efficient fetch size is already the default for the driver. The method setFetchSize() simply allows a programmer to experiment to see if a certain fetch size is more efficient than the default for a particular application." ch. 26 pg. 588, JDBC API Tutorial and Reference, Second Edition - Universal Data Access for the Java 2 Platform
Jamie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic