数据库:流水线函数 [英] Database: Pipelined Functions

查看:120
本文介绍了数据库:流水线函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是管道函数的新概念。我有一些关于



的问题:从数据库的角度:





  • 使用管道功能解决了什么挑战?

  • 使用管道功能的优化优点是什么?



解决方案

引用fomAsk Tom Oracle:


流水线函数只是你可以假装的代码是数据库表



流水线函数给你>

select * from PLSQL_FUNCTION;



使用它 - 从函数中选择*,而不是表,它
可能是有用的。


至于优点:使用管道功能的一大优点是,您的函数可以一个接一个地返回行,而不是在返回之前将整个结果集作为一个整体在内存中构建。



上面给出了明显的优化 - 否则会返回大结果集的内存节省。



一个非常有趣的例子使用流水线函数在这里



什么似乎很好地利用了它们是ETL(提取/转换/加载) - 例如参见这里


I am new to the concept of Pipeline Functions. I have some questions regarding

From Database point of view:

  • What actually is Pipeline function ?
  • What is the advantage of using Pipeline Function ?
  • What challenges are solved using Pipeline Function ?
  • Are the any optimization advantages of using Pipeline Function ?

Thanks.

解决方案

To quote fom "Ask Tom Oracle":

pipelined functions are simply "code you can pretend is a database table"

pipelined functions give you the (amazing to me) ability to

select * from PLSQL_FUNCTION;

anytime you think you can use it -- to select * from a function, instead of a table, it might be "useful".

As far as advantages: a big advantage of using a Pipeline function is that your function can return rows one-by-one as opposed to building the entire result set in memory as a whole before returning it.

The above gives the obvious optimization - memory savings from something that would otherwise return big result set.

A fairly interesting example of using pipelined functions is here

What seems to be a good use of them is ETL (extract/transform/load) - for example see here

这篇关于数据库:流水线函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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