I'm trying to show the nutrition information for restaurants using the following snippet
{% set nutrition = craft.entries.section('nutrition').Ids() %}
{% set entries = craft.entries ({
section: 'restaurants',
orderBy: 'title',
limit: 50,
relatedTo: nutrition
}) %}
The nutriton channel has around 300k entries and around 200k entries in restaurants channel. Dedicated server with 16gb ram and 8 vcpus can't really handle it. Load average is above 4 and CPU utilization by mysql is 100%-300%. Page loads forever with 550 ram used according to dev toolbar.
Is there a way to speed the things up?
:notempty:
work on the related field instead? That would eliminate having to pull down 300K entry IDs right off the bat...