database request optimisations with eager loading