Problem/Motivation
Similar issue as #2940755: block_content block derivatives do not scale to thousands of block_content entities but a different approach to a fix
Steps to reproduce
Have 1000s of reusable block content entities.
See your site die with OOM on plugin definition rebuild.
Proposed resolution
Use an aggregate query instead of ::loadMultiple