Re: deletion of records

From: frbn <frbn(at)efbs-seafrigo(dot)fr>
To: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
Cc: Dorward Villaruz <dorwardv(at)ntsp(dot)nec(dot)co(dot)jp>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: deletion of records
Date: 2002-07-12 12:22:16
Message-ID: 3D2EC9F8.9040405@efbs-seafrigo.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 :)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff MacDonald 2002-07-12 12:29:52 Re: PostgreSQL in mission-critical system
Previous Message Roderick A. Anderson 2002-07-12 12:18:16 Re: PostgreSQL / Reporting tool