Re: Very long deletion time on a 200 GB database - Mailing list pgsql-performance

From Marcin Mańk
Subject Re: Very long deletion time on a 200 GB database
Date
Msg-id CAK61fk6bSQtmDUzm2rNv33kN4Oar_dYZ-yFEa9zR_zLL8L9esQ@mail.gmail.com
Whole thread Raw
In response to Very long deletion time on a 200 GB database  ("Reuven M. Lerner" <reuven@lerner.co.il>)
Responses Re: Very long deletion time on a 200 GB database  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-performance
> DELETE FROM  B
> WHERE r_id IN (SELECT R.id
>     FROM R, B
>    WHERE r.end_date < (NOW() - (interval '1 day' * 30))
>      AND r.id = b.r_id
>

How about:

 DELETE FROM  B
 WHERE r_id IN (SELECT distinct R.id
     FROM R  WHERE r.end_date < (NOW() - (interval '1 day' * 30))

?

Greetings
Marcin

pgsql-performance by date:

Previous
From: Glyn Astill
Date:
Subject: Re: Very long deletion time on a 200 GB database
Next
From: Richard Huxton
Date:
Subject: Re: Very long deletion time on a 200 GB database