Query & Plot 1 Million datapoint using Hibernate + Highcharts - spring

I have a table with 5 million records & need to run a query which will return minimum 1+ million records.
I tried to implement querying part to return 1 million records only using Spring Boot + Hibernate. It takes 5mins for querying 60K records for hibernate to query & map entity. But, from SQL developer it takes 0.03secs only. for querying 1M records, getting timeout error.
I cannot have Pagination, since i am going to plot result in chart (HighCharts). I need entire data for chart datasource.
Please suggest how to handle Querying of such big data & rendering plot

Related

Is it able to return data portion by portion

I have some client, REST web servise and database. Database has big tables (10 million rows).
I need search some data in db (1 million results), put it in excel file with apache poi and return to the client. The problem is retrieving data from database and forming file can be longer than 1h. Is it exists a way to return data portionally (retrieve 1000 rows, return, retrieve next 1000, return and so on)?

fetch 200k records in single jpa select query within 5 seconds

I want to fetch 200k records in single jpa select query within 5 seconds. I am selecting one column which is already indexed. Currently It is taking more than 5 minutes. is it possible to select over 100k of records in 5 seconds?
This is not possible with hibernate or normal native query since it has to create hundreds of thousands of objects in java side and results needs to be sent over the network (Serialization & de-serialization).
You could do below steps for fine tuning,
At DB side you could change the index method default is binery tree instead set it as "HASH" method.
Use Parallel threads to retrieve the results in paginated mode (Use native SQL).
Hope it gives some inputs for further fine tuning.
Use this property to retrieve lakh of records.
query.setHint(org.hibernate.fetchSize, 5000);

Querying from azure db using linq takes a lot of time

I am using Azure db and my table has over 120000 records.
Applied with paging of 10 records a page I am fetching data into IQueryable, but fetching 10 records only taking around 2 minutes. This query has no join and just 2 filters. While using Azure search I can get all the records within 3 seconds.
Please suggest me who to minimise my Linq search as azure search is costly.
Based on the query in the comment to your question, it looks like you are reading the entire db table to the memory of your app. The data is potentially transferred from one side of the data centre to another, thus causing the performance issue.
unitofwork.Repository<EntityName().GetQueriable().ToList().Skip(1).Take(10);
Without seeing the rest of the code, I'm just guessing your LINQ query should be something like this:
unitofwork.Repository<EntityName().GetQueriable().Skip(1).Take(10).ToList();
Skip and Take should be executed on the db Server, while .ToList() is at the end will materialize the entities.

How to retrieve huge set of dataset from Teradata using Spring 4

I am trying to get huge records from Teradata. Approximately 2 million records.
Whats the best approach to retrieve and process using Spring 4?
Is there any way to make split and make parallel request?

how to get next set of data using Hibernate

I have 50000 records in MySQL am using spring + hibernate, and am using data tables to display the data,
4000 is maxResults,i have to update the table with next 4000 thousand records for that particular date.
This link includes multiple ways to use hibernate's pagination feature - through HQL query, ScrollableResults API and with Hibernate Criteria

Resources