There are orphaned entries in the BPM_ERRORS table that need to be deleted to improve performance.
Run the following query to determine how many records in the BPM_ERRORS table are orphaned.
SELECT count(1)
FROM bpm_errors
WHERE process_instance_id not in (select id from bpm_run_processes)
Run the following query to delete the orphaned records:
DELETE
FROM bpm_errors
WHERE process_instance_id not in (select id from bpm_run_processes)
The number of records should match the one you had as result for the SELECT statement above
Commit;