sort at db-side