From: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
To: Christian Paul B. Cosinas <cpc@cybees.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Deleting Records
Date: Thu, 20 Oct 2005 16:57:31 +0800
Message-ID: <43575BFB.5050800@familyhealth.com.au> (raw)
In-Reply-To: <002701c5d552$5bc7ea30$1e21100a@ghwk02002147>
References: <002701c5d552$5bc7ea30$1e21100a@ghwk02002147>
> 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'd check to see if i have foreign keys on those tables and if the
columns that refer to them are properly indexed. (For cascade delete or
even just checking restrict)
Chris
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: chriskl@familyhealth.com.au, cpc@cybees.com
Subject: Re: Deleting Records
In-Reply-To: <43575BFB.5050800@familyhealth.com.au>
References: <002701c5d552$5bc7ea30$1e21100a@ghwk02002147> <43575BFB.5050800@familyhealth.com.au>
* 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