X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5F0E9D80D7 for ; Tue, 6 Sep 2005 08:02:30 -0300 (ADT) 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 21293-02 for ; Tue, 6 Sep 2005 11:02:25 +0000 (GMT) Received: from sccrmhc14.comcast.net (sccrmhc14.comcast.net [204.127.202.59]) by svr1.postgresql.org (Postfix) with ESMTP id 89FF7D80B2 for ; Tue, 6 Sep 2005 08:02:25 -0300 (ADT) Received: from jafar.private.drule.org (c-24-8-249-24.hsd1.co.comcast.net[24.8.249.24]) by comcast.net (sccrmhc14) with ESMTP id <2005090611022701400ekmahe>; Tue, 6 Sep 2005 11:02:27 +0000 Received: from [192.168.0.51] (dhcp-51.private.drule.org [192.168.0.51]) by jafar.private.drule.org (Postfix) with ESMTP id C9C742A51; Tue, 6 Sep 2005 05:05:40 -0600 (MDT) Message-ID: <431D77F5.4070307@drule.org> Date: Tue, 06 Sep 2005 05:05:25 -0600 From: Kevin User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: arnaulist@andromeiberica.com Cc: pgsql-performance@postgresql.org Subject: Re: Advise about how to delete entries References: <43183AC9.1060704@andromeiberica.com> <431C0F48.5050809@andromeiberica.com> In-Reply-To: <431C0F48.5050809@andromeiberica.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 required=5 tests=[FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/83 X-Sequence-Number: 14391 Arnau wrote: > Hi all, > > > > > COPY FROM a file with all the ID's to delete, into a temporary > table, and do a joined delete to your main table (thus, only one query). > > > I already did this, but I don't have idea about how to do this join, > could you give me a hint ;-) ? > > Thank you very much maybe something like this: DELETE FROM statistics_sasme s LEFT JOIN temp_table t ON (s.statistic_id = t.statistic_id) WHERE t.statistic_id IS NOT NULL