Switch back to using indices for feature discrimination;
Improve index generation to match join structures;