Re: Finding latest record for a number of groups in an INSERT-only table

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: Finding latest record for a number of groups in an INSERT-only table
Дата
Msg-id 02798E69-30C6-4DB5-AB73-A22F8C7D8A76@solfertje.student.utwente.nl
обсуждение исходный текст
Ответ на Re: Finding latest record for a number of groups in an INSERT-only table  (David Johnston <polobo@yahoo.com>)
Ответы Re: Finding latest record for a number of groups in an INSERT-only table  (Daniel Farina <daniel@heroku.com>)
Список pgsql-general
On 5 Jul 2011, at 3:23, David Johnston wrote:

>> Does anyone have fresh thoughts or suggestions for dealing with
>> INSERT-mostly tables conceived in this manner?

You're struggling with read-performance in an INSERT-mostly table? Where are your performance priorities, on INSERT or
onSELECT? 

> Setup a materialized view.


Basically that means moving the tracking of the last row to the INSERT phase. If you go this way, a few approaches keep
a"latest records" table are: 
1. Replace the record with the same key with the latest one from your INSERT-mostly table, or
2. Update a foreign key reference to the latest record in your INSERT-mostly table.

The new table should probably have a UNIQUE constraint on the key field.

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,4e12b56712091122515968!



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

Предыдущее
От: Yan Cheng CHEOK
Дата:
Сообщение: Difference between inet and cidr
Следующее
От: Daniel Farina
Дата:
Сообщение: Re: Finding latest record for a number of groups in an INSERT-only table