d2rq/d2rq — pull request #231 by arekinath (2013-10-09 01:03:39+00:00)
Title: Avoid unnecessary self-joins in TripleRelationJoiner

The keys in nodeSets.toMap() are actually Var objects, not Strings -- previously this lookup was always returning null, resulting in lots of unnecessary self-joins. Spurious self-joins are not optimised very well in many RDBMs (including Postgres and MySQL, which I've tested this on)

This patch also introduces the ability to fall back to primary keys as unique keys for JDBC drivers that don't return primary keys in the former.