Stored procedure writing experience and optimization measures