Re: [PROPOSAL] Max recursion depth in WITH Queries (Common Table Expressions)

Поиск
Список
Период
Сортировка
От Valery Popov
Тема Re: [PROPOSAL] Max recursion depth in WITH Queries (Common Table Expressions)
Дата
Msg-id 5630E28E.6070409@postgrespro.ru
обсуждение исходный текст
Ответ на Re: [PROPOSAL] Max recursion depth in WITH Queries (Common Table Expressions)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [PROPOSAL] Max recursion depth in WITH Queries (Common Table Expressions)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

28.10.2015 16:33, Tom Lane пишет:
> Valery Popov <v.popov@postgrespro.ru> writes:
>> Recursive queries are typically used to deal with hierarchical or
>> tree-structured data.
>> In some conditions when data contain  relationships with cycles recursive query will loop
>> unlimited and significantly slows the client's session.
> The standard way of dealing with that is to include logic in the query to
> limit the recursion depth, for example
>
> WITH RECURSIVE t(n) AS (
>      SELECT 1
>    UNION ALL
>      SELECT n+1 FROM t WHERE n < 10
> )
> SELECT n FROM t;
>
Yes, I agree with this thesis.  But I think in some cases would be 
better to receive error message and stop execution than results will 
incomplete.

-- 
Regards,
Valery Popov
Postgres Professional http://www.postgrespro.com
The Russian Postgres Company




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kouhei Kaigai
Дата:
Сообщение: Re: [DESIGN] ParallelAppend
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PROPOSAL] Max recursion depth in WITH Queries (Common Table Expressions)