Re: deletion of records - Mailing list pgsql-general

From frbn
Subject Re: deletion of records
Date
Msg-id 3D2EC9F8.9040405@efbs-seafrigo.fr
Whole thread Raw
In response to deletion of records  ("Dorward Villaruz" <dorwardv@ntsp.nec.co.jp>)
List pgsql-general
Patrick Welche a écrit:
> On Fri, Jul 12, 2002 at 09:38:39AM +0200, frbn wrote:
>
>>DELETE FROM custinfo,custinfotemp
>>WHERE
>>    custinfo.UserID=custinfotemp.userid
>>    and
>>    custinfotemp.updateStatus='D'
>>;
>>should avoid the 2.10^6 selects
>
>
> Won't that delete rows from custinfotemp too?
>
> Patrick

no, as this is syntaxically incorrect. oops

I meant:

delete from custinfo
where custinfo.UserID=custinfotemp.userid
and
custinfotemp.updateStatus='D';

---------------------------------------------
    explain delete from t1 where t1.c1 = t2.c1;

Merge Join  (cost=200000139.66..200000164.66 rows=10000 width=14)
   ->  Sort  (cost=100000069.83..100000069.83 rows=1000 width=10)
         ->  Seq Scan on t1  (cost=100000000.00..100000020.00 rows=1000 width=10)
   ->  Sort  (cost=100000069.83..100000069.83 rows=1000 width=4)
         ->  Seq Scan on t2  (cost=100000000.00..100000020.00 rows=1000 width=4)


ps: An interesting notice in the errlog:

    NOTICE:  Adding missing FROM-clause entry for table "t2"

I don't know how to remove this *non*enoying notice :)


pgsql-general by date:

Previous
From: "Roderick A. Anderson"
Date:
Subject: Re: PostgreSQL / Reporting tool
Next
From: "Jeff MacDonald"
Date:
Subject: Re: PostgreSQL in mission-critical system