newdb: Fix sorting of view not stable