PHOENIX-933 Local index support to Phoenix

Updated pull request after resolving conflicts and handling James review comments.
Not sure I understand this comment. This code applies to joins, I believe. Can you confirm/elaborate? Is the TODO still relavent?