Yes it is safe to purge the log table. Some people like to purge it by a
specific filter type, but I just purge it for anything more than 1m records
(set it to whatever number you want). Feel free to use my code below. It's
for MSSQL, but shouldn't be difficult to update as needed. I run it as a
nightly scheduled task (in a file called
[project]/system/dmCron/purgeFarLogTable.cfm).
When you first run it, I suggest running it with higher numbers and whittling
it down until you get it near the number you want to do nightly.
<cfsetting enablecfoutputonly="true" requesttimeout="1800" />
<!--- @@displayname: Purge farLog Table (leaving only the last 1m records) --->
<!--- @@author: Jeff Coughlin (jeff [at] jeffcoughlin.dot.com) --->
<cftransaction>
<cfquery name="qPurgeFarLog" datasource="#application.dsn#">
delete from farLog
where ObjectID not in (
select top 1000000 ObjectID
from farLog
order by datetimecreated desc)
</cfquery>
</cftransaction>
<cfoutput>
<h2>Purge complete</h2>
</cfoutput>
<cfsetting enablecfoutputonly="false" />
--
Jeff Coughlin
On Jan 9, 2012, at 10:18 AM, Colin Jones wrote:
> Our farLog table is now exceeding 2.5 million rows, which is starting
> to have a noticeable effect on access in the webtop with some queries
> taking 2-3 seconds to run. A few questions...
>
> Is it safe to "prune" farLog?
> Can we just pick an arbitrary date and delete records from it before
> that date?
> Do we also need to delete associated refObjects entries for the farLog
> data?
> What are the conseuqences of doing this (simply removal of audit
> data?)
>
> Cheers,
> Colin.
>
> --
> You received this message cos you are subscribed to "farcry-dev" Google group.
> To post, email: [email protected]
> To unsubscribe, email: [email protected]
> For more options: http://groups.google.com/group/farcry-dev
> --------------------------------
> Follow us on Twitter: http://twitter.com/farcry
--
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: [email protected]
To unsubscribe, email: [email protected]
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry