Forum OpenACS Q&A: Response to pg miscellanea

Collapse
2: Response to pg miscellanea (response to 1)
Posted by David Walker on
Assuming you have a battles_id field, how does the speed compare when doing
   
   
select max(battles_id) from battles where date_fought <  
now()::date - '48 hours'::interval;  
  
delete from battles where battles_id < $battles_id   
(That also makes the cutoff midnight instead of 48 hours prior to the current time due to the ::date line)