Re: [PERFORM] Two "equivalent" WITH RECURSIVE queries, one of them slow.

2010-07-07 Thread Merlin Moncure
On Mon, Jul 5, 2010 at 2:07 AM, Octavio Alvarez wrote: > Hello. > > I have a tree-like table with a three-field PK (name, date, id) and one > parent field. > It has 5k to 6k records as of now, but it will hold about 1 million records. > > I am trying the following WITH RECURSIVE query: > > WITH RE

Re: [PERFORM] Two "equivalent" WITH RECURSIVE queries, one of them slow.

2010-07-06 Thread Robert Haas
On Mon, Jul 5, 2010 at 2:07 AM, Octavio Alvarez wrote: > Hello. > > I have a tree-like table with a three-field PK (name, date, id) and one > parent field. > It has 5k to 6k records as of now, but it will hold about 1 million records. > > I am trying the following WITH RECURSIVE query: > > WITH RE

[PERFORM] Two "equivalent" WITH RECURSIVE queries, one of them slow.

2010-07-05 Thread Octavio Alvarez
Hello. I have a tree-like table with a three-field PK (name, date, id) and one parent field. It has 5k to 6k records as of now, but it will hold about 1 million records. I am trying the following WITH RECURSIVE query: WITH RECURSIVE t AS ( SELECT par.id AS tid, par.name, p