Re: How should I phrase this?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How should I phrase this?
Дата
Msg-id 7018.994625706@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How should I phrase this?  (Paul Tomblin <ptomblin@xcski.com>)
Список 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

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

Предыдущее
От: "Brent R. Matzelle"
Дата:
Сообщение: Re: Bad news for Open Source databases, acording to survey
Следующее
От: missive@frontiernet.net (Lee Harr)
Дата:
Сообщение: Re: Postgres and C/C++