Optimised daatabase set refrencing.