thinkaurelius/titan — pull request #287 by zachkinstner (2013-05-22 23:23:03+00:00)
Title: Allow IN-unique and OUT-unique edges to have primary keys

I tested this change on a local Berkeley database and on my EmbeddedCassandra cluster -- it was successful for both. I'm sure this would need more thorough review, but these early tests show that it works for simple scenarios.

The following use case explains why this change is important to me:
> One million Factors all "use" Artifact X. Each Factor may "use" only one Artifact (OUT unique). Along a user's traversal path, they hit Artifact X. They want to find all Factors which "use" Artifact X and have a FactorType property value of 123. If I added FactorType as a primary key to the "use" edge, the documentation shows that I would see a dramatic performance improvement. However, because the "use" edge is OUT unique, I can't add a primary key.

The test results show that this *does* provide a dramatic performance improvement.

I can't get Titan tests to pass in Eclipse (for any branch), so I don't know if this change will cause any existing tests to fail.

Tests and details:
https://gist.github.com/zachkinstner/5630877

Discussion on this topic:
https://groups.google.com/forum/#!topic/aureliusgraphs/KFVtfC9Xy94