sql: index based on position, not name

Joins now have different names than their sql counterparts
We index based on position rather than field name