简体   繁体   English

如何在春季提高具有更大结果集的查询执行的性能

[英]How to improve the performance of a query execution with bigger resultset in spring

I have a native query inside my Java Spring application that hits an oracle DB and fetches a large resultset (close to 20000 records). 我在Java Spring应用程序中有一个本机查询,该查询命中oracle数据库并获取大结果集(接近20000条记录)。 Current approach is that I used Spring's JdbcTemplate to execute the query, which takes about few minutes to execute the query. 当前的方法是我使用Spring的JdbcTemplate执行查询,执行查询大约需要几分钟。 What will be the better approach to improve the performance in executing this query? 有什么更好的方法来提高执行此查询的性能?

I guess pagination is not an option right?. 我想分页不是一种选择吗?

http://www.javacodegeeks.com/2013/01/spring-data-jpa-and-pagination.html http://www.javacodegeeks.com/2013/01/spring-data-jpa-and-pagination.html

In any case you gonna have a bottleneck since you´re not using BigData tecnologies as NoSQL DB as Mongo or Casandra. 无论如何,您都会遇到瓶颈,因为您没有像Mongo或Casandra那样将BigData技术用作NoSQL DB。

Take a look just in case if it´s possible. 看一下,以防万一。

http://www.springio.net/creating-big-data-applications-with-spring-xd/ http://www.springio.net/creating-big-data-applications-with-spring-xd/

Find the bottleneck before optimizing. 在优化之前找出瓶颈。 If 90% time is spent materializing results, 9% transferring data over your network and 1% in simple Java operations there is no point to optimize Java. 如果将90%的时间用于实现结果,9%的数据通过网络传输和1%的简单Java操作,则没有必要优化Java。

Oracle docs chapter "21 Using Application Tracing Tools" explains database server side tracing. Oracle文档第21章“使用应用程序跟踪工具”介绍了数据库服务器端跟踪。 This and EXPLAIN statement is a good starting point. 这和EXPLAIN语句是一个很好的起点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM