The [SQL Server documentation](https://learn.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/ms186243), which mentions *T<sub>i</sub>* and *T<sub>i+1</sub>*, is neither very understandable, nor an accurate description of the actual implementation. The basic idea is that the recursive part of the query looks at all previous results, but *only once*. It might be helpful to look how other databases implement this (to get the *same* result). The [Postgres documentation](https://www.postgresql.org/docs/current/queries-with.html) says: > **Recursive Query Evaluation** > > 1. Evaluate the non-recursive term. For `UNION` (but not `UNION ALL`), discard duplicate rows. Include all remaining rows in the result of the recursive query, and also place them in a temporary *working table*. > 2. So long as the working table is not empty, repeat these steps: > 1. Evaluate the recursive term, substituting the current contents of the working table for the recursive self-reference. For `UNION` (but not `UNION ALL`), discard duplicate rows and rows that duplicate any previous result row. Include all remaining rows in the result of the recursive query, and also place them in a temporary *intermediate table*. > 2. Replace the contents of the working table with the contents of the intermediate table, then empty the intermediate table. > > **Note** > Strictly speaking, this process is iteration not recursion, but `RECURSIVE` is the terminology chosen by the SQL standards committee. The [SQLite documentation](https://www.sqlite.org/lang_with.html#recursivecte) hints at a slightly different implementation, and this one-row-at-a-time algorithm might be the easiest to understand: > The basic algorithm for computing the content of the recursive table is as follows: > > 1. Run the <kbd>initial-select</kbd> and add the results to a queue. > 2. While the queue is not empty: > 1. Extract a single row from the queue. > 2. Insert that single row into the recursive table > 3. Pretend that the single row just extracted is the only row in the recursive table and run the <kbd>recursive-select</kbd>, adding all results to the queue. > > The basic procedure above may modified by the following additional rules: > > * If a UNION operator connects the <kbd>initial-select</kbd> with the <kbd>recursive-select</kbd>, then only add rows to the queue if no identical row has been previously added to the queue. Repeated rows are discarded before being added to the queue even if the repeated rows have already been extracted from the queue by the recursion step. If the operator is UNION ALL, then all rows generated by both the <kbd>initial-select</kbd> and the <kbd>recursive-select</kbd> are always added to the queue even if they are repeats. > […]