Querying for a processes/tasks that are identified by some variable value

I think that external database is the only solution in this case. I’m describing the situation here: ACT_RU_TASK.PARENT_TASK_ID_ missing index?