HPCC-9786 Optimize looking up associations

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>