Thanks Mike Kristian for the tips on indexes.
Creating an index on multiple columns in my DB does indeed speed up the
original query, so Yay!
It would have been even cooler if I could just declare that combination of two
columns will be unique, rather than create an index (with its associated
Rick Hillegas wrote:
I would have thought that the DISTINCT is not redundant and actually
allows for the transformation into a normal join.
I think that, for instance, a problem arises when there are M tuples in
PROVIDES with name='Fred' but there are M distinct ids in those
tuples. In