Preserve order of jobs and queries, export query ids.