在hibernate中加载百万行 [英] Loading million rows in hibernate

查看:125
本文介绍了在hibernate中加载百万行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我想在hibernate中获取百万行,它将如何工作?会让hibernate崩溃吗?如何优化。

If I want to fetch million rows in hibernate, how would it work? Will hibernate crash? How can I optimize that.

推荐答案

如果你读一个/写一个它可能会工作正常。你确定这是你想要阅读1,000,000行的方式吗?这可能需要一段时间。

If you read one/write one it will probably work fine. Are you sure this the way you want to read 1,000,000 rows? It will likely take a while.

如果你想让所有对象同时在内存中,你可能会受到挑战。

If you want all the objects to be in memory at the same time, you might well be challenged.

你可以通过找到一种不同的方式来最优化它。例如,您可以使用数据库工具从使用数据库工具转储的速度比使用hibernate读取快得多。

You can optimize it best, probably, by finding a different way. For example, you can dump from the database using database tools much more quickly than reading with hibernate.

您可以选择数据库中的总和,最大值和计数,

You can select sums, maxes, and counts in the database without returning a million rows over the network.

你想完成什么?

这篇关于在hibernate中加载百万行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆