udpating query to speed join of changes_queue