Check if a Relationship field has a relationship without extra query Is there any way to check if a relationship field has a value/is assigned to other elements (assets/entries) without having to add an extra query?

I have a Channel with an Asset field assigned to it. Now let's say I have a list of 100 entries. This list should show a thumbnail and the entry title. I only want to "fetch" the related image thumbnail if the user has choosen to select any image to reduce the amount of queries used.

The "standard" way which results in ~100 queries

{% set image = entry.image.first() %}
{% if image %}
    &lt;img src="{{ image.url }}"/&gt;
{% endif %}


The way I tried it, but |length adds (1) query making it ~100 queries + the queries for each found thumbnail

{% if entry.image|length &gt; 0 %}
    {% set image = entry.image.first() %}
    &lt;img src="{{ image.url }}"/&gt;
{% endif %}


Is there a third option I can use to check (without a query) is the entry.image has any related content assigned to it?

Thank you
There isn’t currently, but it’s on our list to make it possible.

UPDATE

As of Craft 2.5, you can set relational field params to 'not :empty:' or ':notempty:' to only show elements where something is selected within the field; and you can set them to ':empty:' to only show elements where nothing is selected within the field.