Long query progress on database