Received: from candle.pha.pa.us (root@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA74109 for ; Sat, 22 Jan 2000 13:04:23 -0500 (EST) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id MAA22581; Sat, 22 Jan 2000 12:56:59 -0500 (EST) From: Bruce Momjian Message-Id: <200001221756.MAA22581@candle.pha.pa.us> Subject: Re: [SQL] More efficient DELETE ... ? In-Reply-To: from The Hermit Hacker at "Jan 22, 2000 01:20:06 pm" To: The Hermit Hacker Date: Sat, 22 Jan 2000 12:56:59 -0500 (EST) CC: pgsql-sql@postgreSQL.org X-Mailer: ELM [version 2.4ME+ PL66 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > > This looks painful ... > > DELETE FROM webhit_referer_raw > WHERE oid IN ( SELECT w.oid > FROM webhit_referer_raw w, referrer_data r > WHERE stat_date < 'Jan 17 2000 15:05:00' > AND w.referrer_url = r.referrer ); > > But, reading through the man page, it looks like this about the only way > of doing it? Or am I missing something as obvious as the UPDATE I asked > about the other day? :( Read chapter 8 from my book. That is the only way for DELETE. You could to EXISTS and that may be faster. -- Bruce Momjian | http://www.op.net/~candle pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026