To be honest, I find an easier method is to add a formula field (called “X” or whatever) which is just the value true.
Then create a self-relation (many-to-many) which uses automatic linking where X = X. Now, every entity is linked to every other entity in its own database, and you can do formula queries on the whole db easily.