Re: [SQL] More efficient DELETE ... ?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [SQL] More efficient DELETE ... ?
Дата
Msg-id 200001221756.MAA22581@candle.pha.pa.us
обсуждение исходный текст
Ответ на More efficient DELETE ... ?  (The Hermit Hacker <scrappy@hub.org>)
Список pgsql-sql
> 
> 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,
Pennsylvania19026
 


В списке pgsql-sql по дате отправления:

Предыдущее
От: The Hermit Hacker
Дата:
Сообщение: More efficient DELETE ... ?
Следующее
От: Mark Stosberg
Дата:
Сообщение: geo_distance radius question