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)


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to