Removing data from ACT_HI_DETAIL securely

Hi all,
We’re in need to save space in our database and main tables consuming data are ACT_HI_DETAIL and ACT_GE_BYTERRAY…Our current use of Flowable engine implies we keep quite a few historic processes (HI tables)…So, we want to keep that processes (and their variables) but we dont need all VariableUpdate data in ACT_HI_DETAIL (and their related Bytearrays that does not have other uses).

So, the question is to confirm if we can securely delete that data in ACT_HI_DETAIL and how to proceed?

Our hypothesis are:

  • ACT_HI_DETAIL (at least VariableUpdate) has not relevant use for closed processes (by the engine and/or REST API) so we dont loose any critical functionality or we’re going to leave inconsistent Flowable.

  • Any Bytearray_id in ACT_HI_DETAIL (for process variables) is not in ACT_H_VARINST, and so, we can delete these byterrays when removing a ACT_HI_DETAIL row (TYPE_ = VariableUpdate)

  • If previous statement is wrong, it’s secure then to remove byterrays referenced by ACT_HI_DETAIL but not by ACT_HI_VARINST (always bytearrays references by ACT_HI_DETAIL as VariableUpdate)???

Many thanks!

1 Like

Hi!

It’s safe to remove the ACT_HI_DETAIL data if you don’t need that information anymore. You won’t break anything. This is generally true for any HI table.

The same bytearrays can be referenced by ACT_HI_DETAIL and ACT_HI_VARINST. You can follow our database schema documentation in order to design the delete strategy. Just be careful with the references to the bytearray table.

Hi Jorge,
Thanks for the info. We were unable to find a bytearray_id in ACT_HI_VARINST that appears in ACT_HI_DETAIL (we dont tested this in PROD as the database is huge but in INTEGRATION where we have more than 100K ACT_HI_VARINST rows with bytearrays ref). We can try to repeat this test in PROD but we may need hours or day to complete the query and in anycase your comment concern us.

  • Could you double check that the behaviour of the engine is create separate bytearrays for the same variable in ACT_HI_VARINST and ACT_HI_DETAIL?? We’re using 6.2.1, but interested in knowing if this changes in 6.5.
  • If we restrict to “process variables” in ACT_HI_DETAIL (TYPE_ = VariableIUpdate), do you think we need to check other tables (apart from ACT_HI_VARINST) to avoid delete shared bytearrays?

Thanks.

Hi Jaime,

On behalf of @tijs:

The historic variable instance table and the historic detail table don’t share byte array id values. The byte arrays values are copied to separate byte array entries. There are also no other tables sharing the byte array id values with the historic detail table.

Thanks Tijs!