Hi,
If your’e interested in database structure etc, theres a few things you can look at. The database structure is described in [1]
You can also see the database creation scripts by looking in the pre-packaged distributions. For Tomcat, look at a folder sql/create.
To answer your specific questions;
There is a table called ACT_RU_TASK. This has the runtime tasks. Looking at the SQL script for Postgresql, there is an index ACT_IDX_TASK_ASSIGNEE on ACT_RU_TASK(ASSIGNEE_). Hence it looks like there is an index on task assignee.
Variables are a little more complex as the variable type may determine where it is actually stored.
There is an index on businessKey, hence if you use the businessKey to store the customer ID, you may get some traction from businessKey.
Apart from adding indexes in appropriate places if necesary, another technique to consider is add your own table which is an index into the engine. For example, using task or process lifecycle event listeners etc, you could keep a table up to date with lookup values. Hence you could keep a table of customer id and process or task ids, or a certain variable and task id etc. Once the tables are in place you could add customer sql or plugins to use the capability.
regards
Rob
[1] https://docs.camunda.org/manual/7.4/user-guide/process-engine/database/