[GENERAL] recursive query too big to complete. are there any strategies to limit/partition?

Поиск
Список
Период
Сортировка
От Jonathan Vanasco
Тема [GENERAL] recursive query too big to complete. are there any strategies to limit/partition?
Дата
Msg-id 682C14D4-B6CE-4969-8EF8-71A68DB90882@2xlp.com
обсуждение исходный текст
Ответы Re: [GENERAL] recursive query too big to complete. are there anystrategies to limit/partition?
Список pgsql-general
There are over 20 million records in a self-referential database table, where one record may point to another record as
adescendant. 

Because of a bug in application code, there was no limit on recursion.  The max was supposed to be 4.  A few outlier
recordshave between 5 and 5000 descendants (there could be more.  I manually found one chain of 5000. 

I need to find all the chains of 5+ and mark them for update/deletion.  While the database is about 10GB, the recursive
searchis maxing out on diskspace and causing a failure (there was over over 100GB of workspace free) 

Is there any way to make a recursive query work, or will I have to use another means and just iterate over the entire
dataset(either in postgres or an external service) 








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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: [GENERAL] Transaction apply speed on the standby
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: [GENERAL] recursive query too big to complete. are there anystrategies to limit/partition?