Optimising search query I was wondering if there is a better way to do a query like this, it takes a long time to execute and I know setting the parent variable is where there's a problem but am not sure of an alternative way to do it. Appreciate any and all help!

{% set searchResults = craft.entries.section(['post']).search(searchQuery).with(['catalogue', 'postImage']).where({'field_show': 1}).limit(20) %}
{% paginate searchResults as pageInfo, pageEntries %}

&lt;div class="list"&gt;
  {% for item in pageEntries %}
        {% set image = item.postImage[0] ?? null %}
    {% set catalogue = item.catalogue[0] ?? null %}
    &lt;a href="{{ item.url }}" class="item row {{ loop.first ? 'active' }}"&gt;
            &lt;div class="col-8 col-sm"&gt;
              {{ item.title }}
            &lt;/div&gt;
        &lt;/a&gt;
    {% endfor %}
    &lt;div class="pagination"&gt;
        &lt;div class="row"&gt;
            &lt;div class="col"&gt;
                {% if pageInfo.prevUrl %}&lt;a href="{{ pageInfo.prevUrl }}"&gt;Previous&lt;/a&gt;{% endif %}
            &lt;/div&gt;
            &lt;div class="col text-center"&gt;
                Showing page {{ pageInfo.currentPage }} of {{ pageInfo.totalPages }} pages
            &lt;/div&gt;
            &lt;div class="col text-right"&gt;
                {% if pageInfo.nextUrl %}&lt;a href="{{ pageInfo.nextUrl }}"&gt;Next&lt;/a&gt;{% endif %}
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;div class="preview"&gt;
    {% for item in pageEntries %}
      {% set image = item.postImage[0] ?? null %}
      {% set catalogue = item.catalogue[0] ?? null %}
      {% set parent = craft.entries.section('parents').relatedTo({targetElement: catalogue, field: 'catalogue'}).one() %}
        &lt;h2&gt;{{ item.title }}&lt;/h2&gt;
        &lt;p&gt;&lt;a href="{{ parent.url }}" title="{{ parent.title }}"&gt;{{ parent.title }}&lt;/a&gt;&lt;/p&gt;
        &lt;p&gt;{{ parent.date|date('l jS F Y') }} {{ parent.time and parent.archived != '1'  ? parent.time|time('g:iA') }}&lt;/p&gt;
    {% endfor %}
&lt;/div&gt;
It's hard to see what you're actually trying to achieve here, but yes it's likely to do with the amount of queries you're doing on the page.
I would either re-consider the page layout (without knowing what you're trying to achieve by having two loops it's hard to judge) OR pull some, or all of the results asynchronously using javascript so the page rendering isn't blocked whilst the query is being processed.
The newly released sprig plugin may be of interest.