AnsweredAssumed Answered

Cleanup Activiti history tables and act_ge_bytearray

Question asked by ifischer on May 30, 2013
Latest reply on May 31, 2016 by jbarrez
We are using Activiti for quite a long time now (since 2011), version 5.9. Now our Activiti database is getting larger and larger (currently ~22GB).
Due to some unfortunate circumstances, I cannot use the Activiti Java API to cleanup the history, I can only use SQL.

I found out that these are the tables that consume most space:
public.act_ge_bytearray 11 GB
public.act_hi_detail 5671 MB
public.act_hi_actinst 5003 MB

Now we want to remove history data to reduce the size of the database, which should be save according to this post if we are not using the HistoryService, which is the case.

I already know how I can cleanup the hi_detail and hi_actinst tables - there I guess I can remove all rows that link to finished processes using the query:
select min(start_time_) from act_hi_actinst p where exists (select * from act_ru_execution e where p.proc_inst_id_=e.proc_inst_id_);
…so I will remove all hi_detail and hi_actinst entries older than the result of this query.

But I found no way to cleanup public.act_ge_bytearray as the schema does not link to any process or act_inst.

So my questions are:
is it possible at all to find a safe way to cleanup the act_ge_bytearray table via SQL? Or is it only possible via the HistoryService API?
What can happen in general if we manually cleanup the activiti history and the one bytearray rows?

Thanks in advance!