For process instances our main use case is to retrieve a list of active process instances sorted by creation time.
For this we could theoretically use the history, but the history space is much larger and there is no index on start_time there.
Further the history is not guaranteed to be present (if people choose to omit it from being created in the first case)
We can work around it, but we do have certain process definitions where we intentionally do not create history.
Everything is more complicated with external tasks.
"act_hi_ext_task_log_pkey" PRIMARY KEY, btree (id_)
"act_hi_ext_task_log_proc_def_key" btree (proc_def_key_)
"act_hi_ext_task_log_procdef" btree (proc_def_id_)
"act_hi_ext_task_log_procinst" btree (proc_inst_id_)
"act_hi_ext_task_log_rm_time" btree (removal_time_)
"act_hi_ext_task_log_root_pi" btree (root_proc_inst_id_)
"act_hi_ext_task_log_tenant_id" btree (tenant_id_)
"act_idx_hi_exttasklog_errordet" btree (error_details_id_)
We can't efficiently retrieve a single task, becuase there is no index on the task id.
We can't get a list of active tasks with creation date because they are stored in different log entries. We would have to get all start and end events and manually find out if a task has a start log entry but no end log entry.
Having the timestamps on the active instances (the ones we need to operate on) would make life much easier for us (let us actually implement features...)
For external tasks I have a hacky workaround. I get the lock time by requesting the "lockExpirationTime" and than substract the lock time from the external task client. A lock time or create time without workaround would be awesome.