Xero Interview Question

How would you optimise a stored procedure?