Jump to content
We've recently updated our Privacy Statement, available here ×

hussainian

Recommended Posts

Hi!

Please explain.

One line "One thing I found with reporting was that JasperReports uses the default fetch size of 25 rows for JDBC. " found at

http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=54133

by Sherman

and the other "JR reports need to be fully generated before being displayed in a viewer.  So the data will be entirely fetched by the time you see the first report page."  found at

http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=68911&topid=68919

by lucianc

I'm really confused.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

There's no conflict between the two statements you've quoted.  You are getting the entire dataset.  But as Sherman says, it's coming to you 25 rows at a time.  Increasing the fetch size is beneficial if 1) the rows are small, or 2) the latency to the DB server is high.  Increasing the fetch size may improve the performance, but only to a certain point.  I've used values as large as 1,000 for tiny row sizes (something like 4 ints), but after certain point, it tapers off, and there's no more benefit.  25 is a good compromise.

If you want to mess with the fetch size, you should run some benchmarks to prove that you are in fact improving anything.

Jerzy

Link to comment
Share on other sites

Jerzy's explanation and suggesions are correct.

I'll ellaborate my statement:

The fetch size value determines the way the records are retrieved from the DB.  The fetch size (if set explicitly or used by default by the JDBC driver) specifies how many records to get from the DB in one batch.

No matter what the fetch size is, JR needs to retrieve all records from the DB before displaying/exporting the first generated page.  That's because you can have elements with delayed evaluation on the first page, e.g. something like Page 1 of 400, and such elements are only generated when the report has ended filling.

Regards,

Lucian

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...