# Where to store Foreign Key information

**URL:** <https://forum.flowable.org/t/where-to-store-foreign-key-information/7332>\
**Category:** Flowable Engine\
**Created:** [January 14, 2021, 2:53pm UTC](https://forum.flowable.org/t/where-to-store-foreign-key-information/7332 "2021-01-14T14:53:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stu](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@stu](https://forum.flowable.org/u/stu)\
**Post date:** [January 14, 2021, 2:53pm UTC](https://forum.flowable.org/t/where-to-store-foreign-key-information/7332/1 "2021-01-14T14:53:27Z")

</div>

We are using Flowable currently we use process variables to store the Foreign Key to the thing that the task relates to.

What we have found is that performance when getting tasks by process variable is fairly slow as it has to join the `ACT_RU_TASK` to `ACT_RU_VARIABLE` and we are then filtering on Type which doesn’t have an index.

Is there a field on 'ACT\_RU\_TASK` that would could use to store a Foreign Key information.

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [January 19, 2021, 9:34am UTC](https://forum.flowable.org/t/where-to-store-foreign-key-information/7332/2 "2021-01-19T09:34:27Z")

</div>

That would only work if you put the index on the variable table side, which is most likely the TEXT\_ column. And that column can have arbitrary values - so not feasable.
