Re: How should I phrase this?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul Tomblin <ptomblin(at)xcski(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How should I phrase this?
Date: 2001-07-08 20:55:06
Message-ID: 7018.994625706@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Actually, I'd recommend

DELETE FROM generators WHERE started <= now() - '30 minutes'::interval;

This might or might not seem more natural than the other way, but it
has the advantage that there's at least a potential to make use of an
index on the "started" column. In practice, because now() is considered
a non-constant-foldable function by the optimizer, you have to cheat a
little bit to make the righthand side reduce to a constant so that
indexing will actually work. See past discussions in the archives.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lee Harr 2001-07-08 21:01:08 Re: Postgres and C/C++
Previous Message Brent R. Matzelle 2001-07-08 20:05:58 Re: Bad news for Open Source databases, acording to survey