deletion of records

From: "Dorward Villaruz" <dorwardv(at)ntsp(dot)nec(dot)co(dot)jp>
To: "Postgres General" <pgsql-general(at)postgresql(dot)org>
Subject: deletion of records
Date: 2002-04-12 00:24:24
Message-ID: 01df01c1e1b8$66453c10$043d1cac@speed
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

can anybody help me with this one

i want to delete rows from one table based values from another table.

here is the scenario

i have a table named custinfo which contain 2000000 records and a table custinfotemp which contain 30000 records. i want to delete all records in custinfo where the cust_id is found on custinfotemp where it's update status is 'D'

here is my sql statement

psql -h $HOSTNAME -d $DBNAME -c "DELETE FROM custinfo WHERE custinfo.UserID IN (SELECT custinfotemp.userid FROM custinfotemp where updateStatus='D')";

is it possible that this query statement takes 24 hours and still running to execute?

is there a way to achieve the same result faster?

thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Post 2002-04-12 00:55:15 Is there a way to look at the interactive Documentation for older versions?
Previous Message Bruce Momjian 2002-04-11 23:19:17 Re: What are functional indices good for?