Variables History Table Growing and Perfomance Degrades

Hi,

I have more than 5 million records to be migrated as a process instances and each instance is having 130 variables.

I just started migration and completed 300k records and table act_hi_varinst is around 20GB in which actual table size is around 12GB but index on other columns is having 8GB space occupancy.

Currently I am using default query of flowable but seems like when we are trying to search on any archieved instance variables, query is not responding in few minutes as well and have to kill the query manually as it does impact on overall postgres server.

I found the issues with index on columns having UUID is very heavy. I don’t know how it will respond if I do migrate 5 million records.

Anyone has any solution on this? if yes then guide.

Thanks