Hotfix/ddc 2346 tests

This is not rebased - don't merge it. I just wanted to PR to allow you to comment on the DDC2346 test case, which I cannot get to fix with your patch. Can you please comment on it so that I can see what I'm missing? So far, your patch doesn't reduce the N+1 queries.