Deleting Records - Mailing list pgsql-performance

From Christian Paul B. Cosinas
Subject Deleting Records
Date
Msg-id 002701c5d552$5bc7ea30$1e21100a@ghwk02002147
Whole thread Raw
In response to Re: Inefficient escape codes.  (Nörder-Tuitje, Marcus <noerder-tuitje@technology.de>)
Responses Re: Deleting Records  (Csaba Nagy <nagy@ecircle-ag.com>)
Re: Deleting Records  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Re: Deleting Records  (Matteo Beccati <php@beccati.com>)
Re: Deleting Records  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-performance
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


pgsql-performance by date:

Previous
From: Nörder-Tuitje, Marcus
Date:
Subject: Re: Inefficient escape codes.
Next
From: Csaba Nagy
Date:
Subject: Re: Deleting Records