title: Performance and indexes in Camunda process repository
body: <p>I've been evaluating camunda to use <em>embedded</em> in my Tomcat application for a couple of days but I'm raising some performance worries regarding <strong>assignees and variables</strong>, to further filter my repository. There are some simple use case scenarios that will be of practical use to me:</p>
  
  <p>1) Filter all active tasks assigned to an specific user.</p>
  
  <p>2) Filter all active process instances associated to a customer.</p>
  
  <p>3) Filter all active tasks from process instances associated to a customer.</p>
  
  <p>So my bigger concerns are:</p>
  
  <p>a - Can I rely on use case 1 having <strong>database indexes</strong> on assignees that will nicely perform with a highly populated task table in the future?</p>
  
  <p>b - To accomplish use case 2, I'll add the customer id as a <strong>process level variable</strong> to my process instances to further filter them. Are <em>variables</em> subject to be indexed as well - supposing assignees are? (say I need to query 20 processes in a 1 million process table which have a given variable set)</p>
  
  <p>c - Finally, from a performance point of view, should I <strong>replicate the customer id variable</strong> in each task and then filter them without checking the corresponding process instances?</p>
  
  <p>ps1: I'm using postgres database as repository and have no complete understanding of the underlying structure and indexes beneath the BPM engine. If some understanding is necessary to create indexes not available by default, I would appreciate some clues on which tables/columns I should work on.</p>
  
  <p>ps2: I'm not dealing with a critical concurrent software, but potentially will have a big database load in the near future.</p>