need help with a table shrinker
| От | Medi Montaseri |
|---|---|
| Тема | need help with a table shrinker |
| Дата | |
| Msg-id | 3DB7484C.2020009@intransa.com обсуждение исходный текст |
| Ответы |
Re: need help with a table shrinker
|
| Список | pgsql-general |
I have a table that is getting 500 inserts per minute. Currently application is keeping track of the size of this table and purging down to 80% of some Max and vacuum-ing right after. I'm looking for a solution to deligate this task to the PG engine itself. Is this possible? One solution (I suppose) would be to implement a cron emulator, how I don't know but its an interesting task. Another would be to implement a trigger on INSERT, that gets the COUNT of records and proceeds to trim or not. But getting the COUNT using built-in aggregate function might be too expensive for every INSERT. Is there any system table that can be querried for the number of records in a given table ? I'm sure this is a common problem and have been solved many many times over. Hence this email. Thanks
В списке pgsql-general по дате отправления: