Mailing List Archive

event table - purging
Hello,

Is there any performance benefit to purging old records from the event table, like there is for the job table?

If so, has someone already written the SQL for this by chance, including the related tables?

Thank you,

Michael Fletcher
Re: event table - purging [ In reply to ]
On Dec 4, 2012, at 1:18 PM, "Fletcher, Michael" <michael.fletcher@cbs.com> wrote:

> Is there any performance benefit to purging old records from the event table, like there is for the job table?

Probably not, unless you often look at the events, and especially if you have an object with a gazillion events and you want to see them. How big is your events table? A query something like this should tell you:

SELECT pg_size_pretty(pg_total_relation_size(oid::regclass) from pg_class WHERE relname = 'event';

Best,

David
RE: event table - purging [ In reply to ]
On Tuesday, December 04, 2012 4:27 PM David E. Wheeler wrote:

> How big is your events table?

7995 MB
48462844 records
First record timestamp: 2009-09-29

Thanks,
Mike


-----Original Message-----
From: users@lists.bricolagecms.org [mailto:users@lists.bricolagecms.org] On Behalf Of David E. Wheeler
Sent: Tuesday, December 04, 2012 4:27 PM
To: users@lists.bricolagecms.org
Subject: Re: event table - purging

On Dec 4, 2012, at 1:18 PM, "Fletcher, Michael" <michael.fletcher@cbs.com> wrote:

> Is there any performance benefit to purging old records from the event table, like there is for the job table?

Probably not, unless you often look at the events, and especially if you have an object with a gazillion events and you want to see them. How big is your events table? A query something like this should tell you:

SELECT pg_size_pretty(pg_total_relation_size(oid::regclass) from pg_class WHERE relname = 'event';

Best,

David
Re: event table - purging [ In reply to ]
On Dec 5, 2012, at 1:14 PM, "Fletcher, Michael" <michael.fletcher@cbs.com> wrote:

>> How big is your events table?
>
> 7995 MB
> 48462844 records
> First record timestamp: 2009-09-29

8G is pretty big, but unless you look at it regularly, I don't think it would be in memory. I doubt that it causes much problem with your system, unless your database server is under-powered. How much RAM does it have? And how is PostgreSQL configured (see http://bricolagecms.org/docs/current/api/Bric::DBA#Tuning for details)?

That aside, if you really want to delete stuff, maybe remove events associated with deactivated objects, or event from, say, before 2011-01-01. I don’t think it will cause any harm, except to the extent that you will of course no longer have access to those older events. And unless you care about them for auditing purposes, or you access them in your templates for some reason (some folks search a story for the first publish event in order to display a data, for example), it should be fine.

Best,

David