Re: Select in FOR LOOP Performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Charles Joseph <khocuihu(at)yahoo(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Select in FOR LOOP Performance
Date: 2005-03-04 18:29:02
Message-ID: 28975.1109960942@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Charles Joseph <khocuihu(at)yahoo(dot)com> writes:
> I face problem when running the following pgplsql
> function. The problem is it takes more than 24hours to
> complete
> the calculation. The EMP table has about 200,000
> records.

Sure there are no infinite loops of PARENT links in your table?

Also, if CODE is supposed to be unique, you should probably declare
its index that way. Or at least make sure the planner knows it's
unique (have you ANALYZEd the table lately?)

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2005-03-04 18:29:11 Re: Help with tuning this query (with explain analyze finally)
Previous Message Charles Joseph 2005-03-04 17:53:28 Select in FOR LOOP Performance