Reputation: 11023
In Solr DIH data-config.xml, is it better to fetch as many fields as possible with the query in the main entity with JOIN like:
<entity name="Lists"
pk="l.list_id"
query="SELECT l.list_id AS id, l.user_id, lo.is_votable FROM lists l
INNER JOIN list_options lo ON lo.list_id = l.list_id">
or use a separate sub-entity like:
<entity name="Lists"
pk="l.list_id"
query="SELECT l.list_id AS id, l.user_id FROM lists l">
<entity name="ListOptions"
query="SELECT lo.is_votable FROM list_options lo
WHERE lo.list_id=${Lists.id}" />
</entity>
Upvotes: 5
Views: 2627
Reputation: 52799
Few Pointers that may help you to decide :-
Upvotes: 7