Re: Postgresql "FIFO" Tables, How-To ?

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Postgresql "FIFO" Tables, How-To ?
Дата
Msg-id 20030716165051.GD1263@wolff.to
обсуждение исходный текст
Ответ на Re: Postgresql "FIFO" Tables, How-To ?  ("Kirill Ponazdyr" <softlist@codeangels.com>)
Список pgsql-general
On Wed, Jul 16, 2003 at 18:18:09 +0200,
  Kirill Ponazdyr <softlist@codeangels.com> wrote:
>
> Ouch, this means that for every insert we would have to trigger a
> procedure which will:
>
> COUNT
> IF > Limit
> DELETE OLDEST
>
> This would be pretty much damn ressource intensive on a table with million
> of records, would not it ?

If you preload the database with the required number of records, then you
don't need to count. You can just delete the oldest record. You can use
a sequence or timestamp to order the records for this purpose. If you
don't to see the dummy records you can flag them somehow. But if you reach
the limit in a short time you might not really care about that enough
to add the extra overhead.

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

Предыдущее
От: Luis Magaña
Дата:
Сообщение: ODBC query problem
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: ODBC query problem