I have a complicated problem with Java8 and Oracle. Our API with Java8 is responsible for providing 1000 records per call from Oracle DB. We are using JDBC Spring. Into DB design , we have 2 table.
- Merchant : Id | name | and other columns Total columns into this table is 11
- Merchant contact : This is table with Merchant contact information for 3 different contact type So , we have 3 rows per merchant into this table
- Merchant relationship : This table keep the information about Merchant Id and parent Merchant Id
Our API needs to provide all the merchant information belongs to requested parent merchant id.
We have joins into Oracle Stored Proc and we have indexes as well. When we reduce the number of columns to return from DB, this API perform well. As long as the number of columns increases, the API performance slowing down. To get 1000 records , this API is taking around 2.5 seconds in average. Whether the smaller set of information from DB with 1000 records is taking around 500 milliseconds [ good performance ]
We also have fetch-size defined during the data read operation from JDBC to Oracle. Oracle version is 12.x and API is in Java Vertx
Please suggest.