I have a reader query which fetches product ids from database.
My domain object contains several lists as well.
My commit count is 1000.
So, my sql fetches 1000 items (ie 1000 product ids) at a time.
However, in my rowmapper, I have 10 other queries which I run for each Product Id fetched in the chunk. These queries returns me a number of rows as result set. I parse these result sets to set the lists in my domain object.
This is the way one complete domain object gets created, which I then pass on to the writer for writing into a XML using suitable mapper.
However, since these queries in rowmapper run for every record fetch, my overall program performance is getting hit severely.
There is no way I can combine these queries with the main reader query.
Is there any solution for such a requirement to improve performance ? I there any way I can do some parallel processing with respect to the queries running in rowmapper to reduce the processing time ?
Thanks for reading!
To your specific questions:
Other options exist for parallelizing this type of scenario, however do keep in mind, running many little queries will beat up your database. Running them in parallel will only compound that problem. You may need to reconsider how those sub queries are structured.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.