X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 384A353355 for ; Wed, 6 Apr 2005 18:33:38 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32953-06 for ; Wed, 6 Apr 2005 17:33:33 +0000 (GMT) Received: from uead1.campusvirtual.br (unknown [200.222.48.40]) by svr1.postgresql.org (Postfix) with ESMTP id A427352808 for ; Wed, 6 Apr 2005 18:33:31 +0100 (BST) Received: from silvio (unknown [10.40.0.27]) by uead1.campusvirtual.br (Postfix) with SMTP id 76EAE192736; Wed, 6 Apr 2005 17:15:39 +0000 (UTC) Message-ID: <00e301c53ace$ab400260$1b00280a@ugf.br> From: =?iso-8859-1?Q?Ricardo_Valen=E7a_de_Assis?= To: "Bruno Wolff III" Cc: References: <006701c53ac8$014b27e0$1b00280a@ugf.br> <20050406173137.GA19739@wolff.to> Subject: Re: delete to slow Date: Wed, 6 Apr 2005 14:32:55 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Campus_Virtual-UGF-MailScanner-Information: Please contact the ISP for more information X-Campus_Virtual-UGF-MailScanner: Found to be clean X-MailScanner-From: valenca@campusvirtual.br X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.554 tagged_above=0 required=5 tests=AWL, RCVD_IN_XBL X-Spam-Level: * X-Archive-Number: 200504/79 X-Sequence-Number: 17092 I´ve tried... It takes the same time. I used explain and I saw it... Exactly the same time. ----- Original Message ----- From: "Bruno Wolff III" To: "Ricardo Valença de Assis" Cc: Sent: Wednesday, April 06, 2005 2:31 PM Subject: Re: delete to slow > On Wed, Apr 06, 2005 at 13:45:13 -0300, > Ricardo Valença de Assis wrote: > > Hello Everybody! > > > > I´m trying to use delete to remove data from one table based on another. The query is this: > > > > DELETE FROM table1 WHERE column1 IN (SELECT column2 FROM table2); > > > > but my table is big, so it takes a lot o time... > > Is there a way to use DELETE with INNER JOIN in PostGreSQL? > > Yes. You should be able to do something like: > DELETE FROM table1 WHERE column1 = table2.column2;