Rewrite query() and sorted starred results by updated