I have content type A with a field that references nodes of type B. This is field with multiple values.
I need to show all the values of content type A, and include one of the fields of the referenced content type B (an image). So I created a view showing these fields.
The problem is that I just want to show the first result of content type B and eliminate the duplicates of content type A. So according to the post Only show first entity reference in views, I used the module Views Distinct. And it works, the problem is that I have more than 2000 nodes and the query is very very slow.
So the next thing I thought was to use the Infinite Scroll module to make it faster. And this works, but the problem now is that I need to group the results by a field, and with this module the header of each group is being repeated, every time results are loaded.
So I thought I could use the Delta for the reference field, and filter it to the nodes with delta = 0, but I don't know why the first value is not 0 is a different number. So this option is not valid.
Does anyone know how to show only the first reference with a good performance?