#3 - fixes for attribute ordering in queries, the algorithm now matches ordering against index definitions