Currently all queries in non ES visibility are ordered by start_time which is very confusing for closed workflows where by close time ordering is expected.
It also applies to filtering. For closed workflows we have to change it to the close time (or add additional filter) as currently it is not possible to filter workflows by close time.
(Duplicate of 312, but this tracks making the changes to our SQL visibility stores)