Add sorting in DB side.