使用PL / SQL,将大量数据发送到客户端代码有什么好的选择?

时间:2021-07-24 03:41:39

Using PL/SQL, what are good options for sending large amounts of data to client side code?

使用PL / SQL,将大量数据发送到客户端代码有什么好的选择?

To elaborate, server side PL/SQL operates on a request and generates a response with a large amount of data that must be sent to the client side code. Are there "good options" for sending down large amounts of data? What types of Oracle pros/cons are important to consider here?

详细说明,服务器端PL / SQL对请求进行操作,并生成包含大量数据的响应,这些数据必须发送到客户端代码。发送大量数据有“好的选择”吗?在这里需要考虑哪些类型的Oracle优缺点?

2 个解决方案

#1


The two problems you have when you want to return large amounts of data are:

想要返回大量数据时遇到的两个问题是:

  • bandwidth issues
  • memory issues (both at the server and the client)
  • 内存问题(在服务器和客户端)

If in any way possible, you should attempt to stream the data instead of returning it all at once. You will occupy the same bandwidth but there is less peak usage and you prevent memory issues (at least at the server, it depends on your client implementation how memory is used over there).

如果以任何可能的方式,您应该尝试流式传输数据,而不是一次性返回所有数据。您将占用相同的带宽,但峰值使用率较低,并且可以防止内存问题(至少在服务器上,这取决于您的客户端实现如何使用内存)。

Oracle provides streaming support through pipelined functions. You can find examples here and here.

Oracle通过流水线功能提供流媒体支持。你可以在这里和这里找到例子。

#2


there are no good options, always try to send the smallest amount of data to the client. your database and network will thanks you!

没有好的选择,总是尝试向客户端发送最少量的数据。您的数据库和网络将感谢您!

if you can send small chunks spread over time, that would be better that dumping everything at once.

如果你可以发送随时间推移的小块,那么最好立刻抛弃所有东西。

#1


The two problems you have when you want to return large amounts of data are:

想要返回大量数据时遇到的两个问题是:

  • bandwidth issues
  • memory issues (both at the server and the client)
  • 内存问题(在服务器和客户端)

If in any way possible, you should attempt to stream the data instead of returning it all at once. You will occupy the same bandwidth but there is less peak usage and you prevent memory issues (at least at the server, it depends on your client implementation how memory is used over there).

如果以任何可能的方式,您应该尝试流式传输数据,而不是一次性返回所有数据。您将占用相同的带宽,但峰值使用率较低,并且可以防止内存问题(至少在服务器上,这取决于您的客户端实现如何使用内存)。

Oracle provides streaming support through pipelined functions. You can find examples here and here.

Oracle通过流水线功能提供流媒体支持。你可以在这里和这里找到例子。

#2


there are no good options, always try to send the smallest amount of data to the client. your database and network will thanks you!

没有好的选择,总是尝试向客户端发送最少量的数据。您的数据库和网络将感谢您!

if you can send small chunks spread over time, that would be better that dumping everything at once.

如果你可以发送随时间推移的小块,那么最好立刻抛弃所有东西。