We need to improve performance of the reports obtained from the PostgreSQL view. It takes around 2-5 minutes for the select to happen for the 10k rows and this is the most time consuming part of the report generation. They are running on the same view, Hibernate is used to connect to db, query is executed as a SQL query
SQLQuery query = session.createSQLQuery(query);
List<Object> data = query.list();
Three queries for the reports are similar with many columns selected:
SELECT amount, rate, channel, date ...etc
FROM view
WHERE channel = 'name'
AND invoice_id = '1'
AND date < 12 Oct
Is it worth to run those selects in parallel or performance of those calls may degrade even more with a larger dataset?
I read that a different connections has to be used for the selects in parallel. Can somebody advise how this can be achieved with Hibernate?