pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christian Paul B. Cosinas <cpc@cybees.com>
To: pgsql-performance@postgresql.org
Subject: Deleting Records
Date: Thu, 20 Oct 2005 08:43:34 -0000
Message-ID: <002701c5d552$5bc7ea30$1e21100a@ghwk02002147> (raw)
In-Reply-To: <16F953410A0F1346848DCB476A989CFE01D557@swtexchange2.technology.de>

Hi!

I'm experiencing a very slow deletion of records. Which I thin is not right.
I have a Dual Xeon Server with 6gig Memory.
I am only deleting about 22,000 records but it took me more than 1 hour to
finish this.

What could possibly I do so that I can make this fast?

Here is the code inside my function:

	FOR temp_rec IN SELECT * FROM item_qc_doer LOOP
		DELETE FROM qc_session WHERE item_id = temp_rec.item_id;
		DELETE FROM item_qc_doer WHERE item_id = temp_rec.item_id;
	END LOOP;

Item_qc_oder table contains 22,000 records.


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html    




view thread (6+ messages)  latest in thread

Message-ID: <002701c5d552$5bc7ea30$1e21100a@ghwk02002147>
Permalink:  ../002701c5d552$5bc7ea30$1e21100a@ghwk02002147/
Also on:    postgresql.org/message-id/002701c5d552$5bc7ea30$1e21100a@ghwk02002147

 · 

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: cpc@cybees.com
  Subject: Re: Deleting Records
  In-Reply-To: <002701c5d552$5bc7ea30$1e21100a@ghwk02002147>

* 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