Basic equijoin optimization

Summary:
Without optimization 700 users for cohort test takes ~350s.
With optimization 2000 users for cohort test takes ~25s.

Reviewers: marcua

Reviewed By: marcua

Differential Revision: http://phabricator.locu.com/D5079