retrieve data from mysql in java slow when there is large data
843859Feb 25 2008 — edited Jan 14 2015My program need to store the data and then retrieve it to do some processing. When i have around 10,000 rows inside my table, it works fast, around 2 sec and i'll get my result for both storing and retrieving. This works fast even i have select 5000 data from it.
Problem:
I have a large data, around 300,000 rows inside a table.
I'm using the following code
resultset1 = statement.executeQuery {
" Select 'attribute' from 'table' where ....
}
When i'm trying to select around 2000 rows data from 300,000 rows, this takes me quite long time, is there any other method to speed up my retrieving?
I've just solved my storing those data into my table by using : Load data infile
Really appreciate any of your help which can speed up the retrieving data.
Best Regards,
Kar Hong