Re: [GENERAL] recursive query too big to complete. are there any strategies to limit/partition? - Mailing list pgsql-general

From Jonathan Vanasco
Subject Re: [GENERAL] recursive query too big to complete. are there any strategies to limit/partition?
Date
Msg-id F8FA8713-F8AB-4AEB-8E14-664D8A2C01C2@2xlp.com
Whole thread Raw
In response to Re: [GENERAL] recursive query too big to complete. are there anystrategies to limit/partition?  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general

On Jan 26, 2017, at 7:07 PM, David G. Johnston wrote:

​Thinking aloud - why doesn't just finding every record with 5 descendants not work?  Any chain longer than 5 would have at least 5 items.

Oh it works. This is why I ask these questions -- new perspectives!

​Even without recursion you could build out a five-way self-join and any records that make it that far are guilty.  I suppose this assumes your setup is non-cyclic.

There could be cyclic records, but that's easy to filter out.  A first approach took 40 seconds to run.  A little tweaking is necessary, but this is a great start.

THANK YOU!  You saved me!

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [GENERAL] recursive query too big to complete. are there anystrategies to limit/partition?
Next
From: Göran Hasse
Date:
Subject: [GENERAL] Postgres ODBC on Windows 10