FoundationDB/sql-layer — pull request #1197 by tjoneslo (2014-02-04 15:42:34+00:00)
Title: Large query part 3: Expand column equivalents

Part 3 of the large query processing: Add more items to the ColumnEquivelents. In this case review the tables contained in the query and if the child table FK references the parent table PK, add the columns as a equivelent. This goes up the entire chain of FK references, even if the tables are not included in the query.

Expand the check in the GroupJoinFinder for the FKs to be more aggressive about using the expanded equivalents to mark more joins as FK joins. This, in turn, falls through to the JoinAndIndexFinder for the shortcut join processing more frequently.

Add the full query from the original bug report to verify it does go through the shortcut processing (at least in the debugger).