sorting only for records in mnesia