Sort at db level.