Volcano iterator model

火山模型是一种经典的数据库查询执行策略,通过迭代方式处理数据流。每个关系代数运算符产生一个元组流,消费者逐层迭代输入流。这个过程就像火山,数据在底部密集,随着迭代向上减少。火山模型中,一些操作可能需要遍历大量数据才能找到结果,如查找最大值。这种模型强调了数据流的传递和过滤,导致效率取决于底层迭代的速度。
摘要由CSDN通过智能技术生成

Vectorized and Compiled Queries — Part 1
Imagine a volcano it is like a cone or at least it is drawn like that by most kids including me 😃. The below one is definitely not drawn by a kid.
在这里插入图片描述
As the shape of the volcano suggests lava(把岩浆比作data) is too much at the base and very less of it is fuming out of it.

Here is the non-fun wiki definition:

The Volcano model (originally known as the Iterator Model) is the ‘classical’ evaluation strategy of an analytical DBMS query: Each relational-algebraic operator produces a tuple stream, and a consumer can iterate over its input streams. The tuple stream interface is essentially: ‘open’, ‘next’ and ‘close’; all operators offer the same interface, and the implementation is opaque. Each ‘next’ call produces a new tuple from the stream, if one is available. To obtain the query output, one “next-next-next”s on the final RA operator; that one will in turn use “next”s on its inputs to pull tuples allowing it to produce output tuples, etc. Some “next”s will take an extremely long time, since many “next”s on previous operators will be required before they emit any output. Example: SELECT max(v) FROM t; may need to go trough all of t in order to find that maximum.

In easier words for the brain:

It is a chain of iterators and data flows through them when the topmost iterator calls next() on the iterator below it. Which results in propagation of .next() calls till the bottom-most iterator is called. Each iterator might apply some predicate or other operators. And as visualized in form of volcano data might get reduced as it flows up the iterator chain.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值