The Future of Performance: Scaling

Bradley Baetz bbaetz at acm.org
Mon Jan 5 22:38:25 UTC 2009


On Mon, Jan 5, 2009 at 4:27 PM, David Lawrence <dkl at redhat.com> wrote:

> What if we first did a select to see if there would be any cookies older
> than
> 30 days returned and only then do a delete? The select at least would not
> block like the delete would and if this worked it would only in theory run
> once every 30 days or I may be wrong.

I'd be depressed if that was true, but not really surprised :) Isn't
RH using postgres, though?

Anyway, an issue with this query is that "TO_DAYS(NOW()) -
TO_DAYS(lastused) > 30" isn't indexable. Something like 'WHERE
lastused < NOW()-30*24*60*60' would probably be better, although it
doesn't help the underlying problem. Do we really not want to make
people run a cron job? I guess it may be a bit tricky on windows, but
are there hosting companies that let users run cgi scripts but not
cron jobs?

Bradley



More information about the developers mailing list