且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否将SQL Server递归CTE视为循环?

更新时间:2023-02-05 23:29:17

它们是基于集合的。递归集仍然是集。

They are set based. Recursive sets are still sets.

但是,如果您使用足够强大的放大镜来观察,则所有设置操作都是循环的。最终,代码在CPU上运行,并且CPU执行在内存的离散区域上运行的串行指令流。换句话说,没有。 以设定为导向是一个逻辑概念。 所有 SQL操作最终使用某种形式的循环实现的事实是实现细节。

But all set operations are, if you look with a powerful enough magnifier glass, loops. Ultimately the code runs on CPUs and CPUs execute a stream of serial instructions that operate on discrete regions of memory. In other words, there is no set oriented hardware. Being 'set oriented' is a logical concept. The fact that all SQL operations are ultimately implemented using some form of a loop is an implementation detail.