0

Content Type A -Nid A -Field A

Content Type B -Nid B -Reference Nid A

How can I find in a view all As that have no reference in B ?

in sql this is

select A.field
FROM TABLE A
LEFT JOIN TABLE B
ON A.KEY = B.KEY 
WHERE B.key IS NULL

I have tried Views reference filter, but it is very slow and consume a lot of memory (the trick with this modules is not a join but a SELECT... NOT IN (...).

Which is very inefficient, because, i have 16.000 As and 14.000 Bs.

Is there any efficient solutions with views?

Thanks.

1 Answer 1

1

Well, maybe it is idiotic, but finally I understood the issue with the relationships and the "referenced vs referencing"

So, what I did was:

relationships : "Content referenCING Content from A_REFERENCE_IN_B" Fields A (the fields you want) Filter type = Type A Filter NID (using the relationship) , is null.

Amazing, and super fast.

The important part is REFERENCING not referenced.

Thanks.

1
  • Thanks for coming back with your solution. I was just about to post this. Commented Dec 10, 2016 at 2:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.