Re: [GENERAL] Defer a functional index calculation?

2009-03-24 Thread Randall Lucas
On Mon, Mar 23, 2009 at 4:46 AM, Sam Mason wrote: > On Fri, Mar 20, 2009 at 05:37:33PM -0700, Randall Lucas wrote: > > I added a functional index. > > > > create table example (id serial primary key, stuff text, parent_id > int); > > create index example_root_idx on example (get_root_id(id));

Re: [GENERAL] Defer a functional index calculation?

2009-03-23 Thread Sam Mason
On Fri, Mar 20, 2009 at 05:37:33PM -0700, Randall Lucas wrote: > I added a functional index. > > create table example (id serial primary key, stuff text, parent_id int); > create index example_root_idx on example (get_root_id(id)); > > (get_root_id(id) pulls an example row and recurses onto p

Re: [GENERAL] Defer a functional index calculation?

2009-03-21 Thread Sergey Burladyan
Randall Lucas writes: > I am holding hierarchical data in a table and often need to calculate the > "root" of a hierarchy.  Initially, > a recursive plpgsql function worked just fine.  But performance started to > lag when I got to scale. > > So, I added a functional index. > >   create table

[GENERAL] Defer a functional index calculation?

2009-03-20 Thread Randall Lucas
Hi folks, I am holding hierarchical data in a table and often need to calculate the "root" of a hierarchy. Initially, a recursive plpgsql function worked just fine. But performance started to lag when I got to scale. So, I added a functional index. create table example (id serial primary key