pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: doc: clarify recursion internal behavior
11+ messages / 4 participants
[nested] [flat]
Commits from this thread:
2022-09-28 2a66b9bfb7 994c5ceabe 86f2ee2e27 1981553763 ce4e8606ca 517fab6a40 81c094bd93 doc: clarify internal behavior of RECURSIVE CTE queries
* pgsql: doc: clarify recursion internal behavior
@ 2022-09-03 01:58 Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 11+ messages in thread
From: Bruce Momjian @ 2022-09-03 01:58 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
doc: clarify recursion internal behavior
Reported-by: Drew DeVault
Discussion: https://postgr.es/m/20211018091720.31299-1-sir@cmpwn.com
Backpatch-through: 10
Branch
------
REL_14_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/3eef32c58b438e08071acb22580162976bce680b
Modified Files
--------------
doc/src/sgml/queries.sgml | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
^ permalink raw reply [nested|flat] 11+ messages in thread
* pgsql: doc: clarify recursion internal behavior
@ 2022-09-03 01:58 Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 11+ messages in thread
From: Bruce Momjian @ 2022-09-03 01:58 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
doc: clarify recursion internal behavior
Reported-by: Drew DeVault
Discussion: https://postgr.es/m/20211018091720.31299-1-sir@cmpwn.com
Backpatch-through: 10
Branch
------
REL_13_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/0f590f0064b3a6f1a7492dcc2370819cda0a12c9
Modified Files
--------------
doc/src/sgml/queries.sgml | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
^ permalink raw reply [nested|flat] 11+ messages in thread
* pgsql: doc: clarify recursion internal behavior
@ 2022-09-03 01:58 Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 11+ messages in thread
From: Bruce Momjian @ 2022-09-03 01:58 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
doc: clarify recursion internal behavior
Reported-by: Drew DeVault
Discussion: https://postgr.es/m/20211018091720.31299-1-sir@cmpwn.com
Backpatch-through: 10
Branch
------
REL_15_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/170704da68c5150776c0ee4ed51350acde47b4a5
Modified Files
--------------
doc/src/sgml/queries.sgml | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
^ permalink raw reply [nested|flat] 11+ messages in thread
* pgsql: doc: clarify recursion internal behavior
@ 2022-09-03 01:58 Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 11+ messages in thread
From: Bruce Momjian @ 2022-09-03 01:58 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
doc: clarify recursion internal behavior
Reported-by: Drew DeVault
Discussion: https://postgr.es/m/20211018091720.31299-1-sir@cmpwn.com
Backpatch-through: 10
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/8ec6a4ef3c3a6aa08f2cc235fab8c691a8b2f341
Modified Files
--------------
doc/src/sgml/queries.sgml | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
^ permalink raw reply [nested|flat] 11+ messages in thread
* pgsql: doc: clarify recursion internal behavior
@ 2022-09-03 01:58 Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 11+ messages in thread
From: Bruce Momjian @ 2022-09-03 01:58 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
doc: clarify recursion internal behavior
Reported-by: Drew DeVault
Discussion: https://postgr.es/m/20211018091720.31299-1-sir@cmpwn.com
Backpatch-through: 10
Branch
------
REL_10_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/b9dce0d8aeb369f57a0480356fce8b6cb33fc86c
Modified Files
--------------
doc/src/sgml/queries.sgml | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
^ permalink raw reply [nested|flat] 11+ messages in thread
* pgsql: doc: clarify recursion internal behavior
@ 2022-09-03 01:58 Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 11+ messages in thread
From: Bruce Momjian @ 2022-09-03 01:58 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
doc: clarify recursion internal behavior
Reported-by: Drew DeVault
Discussion: https://postgr.es/m/20211018091720.31299-1-sir@cmpwn.com
Backpatch-through: 10
Branch
------
REL_12_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/92cad1439f2b775211d34c7b8f42b87e02c68ace
Modified Files
--------------
doc/src/sgml/queries.sgml | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
^ permalink raw reply [nested|flat] 11+ messages in thread
* pgsql: doc: clarify recursion internal behavior
@ 2022-09-03 01:58 Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 11+ messages in thread
From: Bruce Momjian @ 2022-09-03 01:58 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
doc: clarify recursion internal behavior
Reported-by: Drew DeVault
Discussion: https://postgr.es/m/20211018091720.31299-1-sir@cmpwn.com
Backpatch-through: 10
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/1525711588c87b80965594ff2249773d8d1ee5c9
Modified Files
--------------
doc/src/sgml/queries.sgml | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: pgsql: doc: clarify recursion internal behavior
@ 2022-09-08 11:24 Peter Eisentraut <peter.eisentraut@enterprisedb.com>
parent: Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 11+ messages in thread
From: Peter Eisentraut @ 2022-09-08 11:24 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; pgsql-committers@lists.postgresql.org
On 03.09.22 03:58, Bruce Momjian wrote:
> doc: clarify recursion internal behavior
- Strictly speaking, this process is iteration not recursion, but
- <literal>RECURSIVE</literal> is the terminology chosen by the SQL
standards
- committee.
+ While <literal>RECURSIVE</literal> allows queries to be specified
+ recursively, internally all queries are evaluated iteratively.
Is that true? Surely there is some recursive behavior in the executor.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: pgsql: doc: clarify recursion internal behavior
@ 2022-09-08 15:15 Robert Haas <robertmhaas@gmail.com>
parent: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
0 siblings, 1 reply; 11+ messages in thread
From: Robert Haas @ 2022-09-08 15:15 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: Bruce Momjian <bruce@momjian.us>; pgsql-committers <pgsql-committers@lists.postgresql.org>
On Thu, Sep 8, 2022 at 7:24 AM Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
> On 03.09.22 03:58, Bruce Momjian wrote:
> > doc: clarify recursion internal behavior
>
> - Strictly speaking, this process is iteration not recursion, but
> - <literal>RECURSIVE</literal> is the terminology chosen by the SQL
> standards
> - committee.
> + While <literal>RECURSIVE</literal> allows queries to be specified
> + recursively, internally all queries are evaluated iteratively.
>
> Is that true? Surely there is some recursive behavior in the executor.
I haven't read the patch, but I think the claim shown here is correct.
The executor does recurse in general in that ExecProcNode() is reached
over and over again at different levels of the call stack, but I don't
think that recursive queries cause that to happen any more than it
would otherwise. I think we allocate the first branch of the recursive
query once and then the second one over and over in a loop until we're
done.
--
Robert Haas
EDB: http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: pgsql: doc: clarify recursion internal behavior
@ 2022-09-08 15:30 Tom Lane <tgl@sss.pgh.pa.us>
parent: Robert Haas <robertmhaas@gmail.com>
0 siblings, 1 reply; 11+ messages in thread
From: Tom Lane @ 2022-09-08 15:30 UTC (permalink / raw)
To: Robert Haas <robertmhaas@gmail.com>; +Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; Bruce Momjian <bruce@momjian.us>; pgsql-committers <pgsql-committers@lists.postgresql.org>
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Sep 8, 2022 at 7:24 AM Peter Eisentraut
> <peter.eisentraut@enterprisedb.com> wrote:
>> On 03.09.22 03:58, Bruce Momjian wrote:
>>> + While <literal>RECURSIVE</literal> allows queries to be specified
>>> + recursively, internally all queries are evaluated iteratively.
>> Is that true? Surely there is some recursive behavior in the executor.
> I haven't read the patch, but I think the claim shown here is correct.
I'd be happier if it read "such queries" instead of "all queries".
The latter is an extremely broad claim, and you have to ignore cases
like recursive SQL functions in order to even argue it's true.
regards, tom lane
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: pgsql: doc: clarify recursion internal behavior
@ 2022-09-28 17:14 Bruce Momjian <bruce@momjian.us>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 11+ messages in thread
From: Bruce Momjian @ 2022-09-28 17:14 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Robert Haas <robertmhaas@gmail.com>; Peter Eisentraut <peter.eisentraut@enterprisedb.com>; pgsql-committers <pgsql-committers@lists.postgresql.org>
On Thu, Sep 8, 2022 at 11:30:04AM -0400, Tom Lane wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
> > On Thu, Sep 8, 2022 at 7:24 AM Peter Eisentraut
> > <peter.eisentraut@enterprisedb.com> wrote:
> >> On 03.09.22 03:58, Bruce Momjian wrote:
> >>> + While <literal>RECURSIVE</literal> allows queries to be specified
> >>> + recursively, internally all queries are evaluated iteratively.
>
> >> Is that true? Surely there is some recursive behavior in the executor.
>
> > I haven't read the patch, but I think the claim shown here is correct.
>
> I'd be happier if it read "such queries" instead of "all queries".
> The latter is an extremely broad claim, and you have to ignore cases
> like recursive SQL functions in order to even argue it's true.
Done in the attached applied patch.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
Indecision is a decision. Inaction is an action. Mark Batterson
Attachments:
master.diff (text/x-diff, 464B) download
diff --git a/doc/src/sgml/queries.sgml b/doc/src/sgml/queries.sgml
index 4c5a83c9cb..95559ef1ac 100644
--- a/doc/src/sgml/queries.sgml
+++ b/doc/src/sgml/queries.sgml
@@ -2173,7 +2173,7 @@ SELECT sum(n) FROM t;
<note>
<para>
While <literal>RECURSIVE</literal> allows queries to be specified
- recursively, internally all queries are evaluated iteratively.
+ recursively, internally such queries are evaluated iteratively.
</para>
</note>
^ permalink raw reply [nested|flat] 11+ messages in thread
end of thread, other threads:[~2022-09-28 17:14 UTC | newest]
Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-09-03 01:58 pgsql: doc: clarify recursion internal behavior Bruce Momjian <bruce@momjian.us>
2022-09-08 11:24 ` Re: pgsql: doc: clarify recursion internal behavior Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-09-08 15:15 ` Re: pgsql: doc: clarify recursion internal behavior Robert Haas <robertmhaas@gmail.com>
2022-09-08 15:30 ` Re: pgsql: doc: clarify recursion internal behavior Tom Lane <tgl@sss.pgh.pa.us>
2022-09-28 17:14 ` Re: pgsql: doc: clarify recursion internal behavior Bruce Momjian <bruce@momjian.us>
2022-09-03 01:58 pgsql: doc: clarify recursion internal behavior Bruce Momjian <bruce@momjian.us>
2022-09-03 01:58 pgsql: doc: clarify recursion internal behavior Bruce Momjian <bruce@momjian.us>
2022-09-03 01:58 pgsql: doc: clarify recursion internal behavior Bruce Momjian <bruce@momjian.us>
2022-09-03 01:58 pgsql: doc: clarify recursion internal behavior Bruce Momjian <bruce@momjian.us>
2022-09-03 01:58 pgsql: doc: clarify recursion internal behavior Bruce Momjian <bruce@momjian.us>
2022-09-03 01:58 pgsql: doc: clarify recursion internal behavior Bruce Momjian <bruce@momjian.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox