pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Charles Joseph <khocuihu@yahoo.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Select in FOR LOOP Performance
Date: Fri, 04 Mar 2005 13:29:02 -0500
Message-ID: <28975.1109960942@sss.pgh.pa.us> (raw)
In-Reply-To: <20050304175328.92960.qmail@web54301.mail.yahoo.com>
References: <20050304175328.92960.qmail@web54301.mail.yahoo.com>

Charles Joseph <khocuihu@yahoo.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



view thread (2+ messages)

Message-ID: <28975.1109960942@sss.pgh.pa.us>
Permalink:  ../28975.1109960942@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28975.1109960942@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, khocuihu@yahoo.com
  Subject: Re: Select in FOR LOOP Performance
  In-Reply-To: <28975.1109960942@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox