解释分析语句中的循环是什么意思?

What does loop in explain analyze statement mean?

我正在分析我的查询。

postgres=# explain analyze select * from student;
                                              QUERY PLAN
------------------------------------------------------------------------------------------------------
 Seq Scan on student  (cost=0.00..22.00 rows=1200 width=40) (actual time=0.005..0.005 rows=7 loops=1)
 Planning time: 0.035 ms
 Execution time: 0.019 ms
(3 rows)

我不知道 Seq Scan on student (cost=0.00..22.00 rows=1200 width=40) (actual time=0.005..0.005 rows=7 loops=1).

中的 loop=1 是什么意思

我搜索了 postgres 文档,但没有找到任何关于循环参数的好参考。

提前致谢。

PostgreSQL documentation 确实谈到了这个:

In some query plans, it is possible for a subplan node to be executed more than once. For example, the inner index scan will be executed once per outer row in the above nested-loop plan. In such cases, the loops value reports the total number of executions of the node, and the actual time and rows values shown are averages per-execution. This is done to make the numbers comparable with the way that the cost estimates are shown. Multiply by the loops value to get the total time actually spent in the node.