Efficient way to go over result set in Java

前端 未结 4 1476
我寻月下人不归
我寻月下人不归 2021-01-19 10:54

I am running a select command which returns 1,000,000 rows iterating over the ResultSet. The below code takes 5 minutes to execute.

Is there a faster way of iteratin

4条回答
  •  温柔的废话
    2021-01-19 11:36

    I don't think there is a more efficient way to iterate over a resultset. Have you checked how fast the query actually runs, e.g. in SQLDeveloper or some other database tool? My assumption is, that the table is not indexed or some other performance bottleneck on the database end exists.

提交回复
热议问题