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));
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
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
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