Re: SELECT all the rows where id is children of other node.

2019-08-21 Thread Rob Sargent
> On Aug 21, 2019, at 3:35 AM, Francisco Olarte wrote: > > Pablo: > > On Tue, Aug 20, 2019 at 6:49 PM pabloa98 wrote: >> Thank you for your responses Rob. Appreciated. The problem with recursive >> queries is that they are executed several times and it has and impact in >> performance. >> I

Re: SELECT all the rows where id is children of other node.

2019-08-21 Thread Francisco Olarte
Pablo: On Tue, Aug 20, 2019 at 6:49 PM pabloa98 wrote: > Thank you for your responses Rob. Appreciated. The problem with recursive > queries is that they are executed several times and it has and impact in > performance. > I need a subset of those rows and I want them in one pass. > I discovere

Re: SELECT all the rows where id is children of other node.

2019-08-20 Thread pabloa98
Thank you for your responses Rob. Appreciated. The problem with recursive queries is that they are executed several times and it has and impact in performance. I need a subset of those rows and I want them in one pass. I discovered that ltree extension could be useful. I will play with it today.

Re: SELECT all the rows where id is children of other node.

2019-08-20 Thread Rob Sargent
> On Aug 19, 2019, at 7:42 PM, pabloa98 wrote: > > Hello, > > I have a huge table (100 million rows) of relations between nodes by id in a > Postgresql 11 server. Like this: > > CREATE TABLE relations ( > pid INTEGER NOT NULL, > cid INTEGER NOT NULL, > ) > > This table has parent-c

Re: SELECT all the rows where id is children of other node.

2019-08-19 Thread Rob Sargent
> On Aug 19, 2019, at 7:42 PM, pabloa98 wrote: > > Hello, > > I have a huge table (100 million rows) of relations between nodes by id in a > Postgresql 11 server. Like this: > > CREATE TABLE relations ( > pid INTEGER NOT NULL, > cid INTEGER NOT NULL, > ) > > This table has parent-c

Re: SELECT all the rows where id is children of other node.

2019-08-19 Thread Rob Sargent
> On Aug 19, 2019, at 7:42 PM, pabloa98 wrote: > > Hello, > > I have a huge table (100 million rows) of relations between nodes by id in a > Postgresql 11 server. Like this: > > CREATE TABLE relations ( > pid INTEGER NOT NULL, > cid INTEGER NOT NULL, > ) > > This table has parent-c

Re: SELECT all the rows where id is children of other node.

2019-08-19 Thread Rob Sargent
> On Aug 19, 2019, at 7:42 PM, pabloa98 wrote: > > Hello, > > I have a huge table (100 million rows) of relations between nodes by id in a > Postgresql 11 server. Like this: > > CREATE TABLE relations ( > pid INTEGER NOT NULL, > cid INTEGER NOT NULL, > ) > > This table has parent-