Need help on tune query

  • Hi All,

    I need your help on tune the attached SP. Here with attaching the SP,function script and the query plan. Inside the SP it is calling one function fnOSIGetProgrmmingKeys is costing 66% on the over all process. Do we need to tune the particular function or the SP.

  • Based on a quick look at the mTVF you are using, one quick suggestion, try rewriting it as a stored procedure and use the stored procedure to load a temporary table that you then use in your query. To dig deeper and determine if the code you have could be rewritten as an iTVF will take more time than I currently have, plus with the loop instide the procedure, I'm not sure if it can be.

    Would need the table definitions (CREATE TABLE statement(s)) for the table(s) involved, sample data (as a series of INSERT INTO statements) to load the tables, and expected results based on the sample data to even know if the rewrite worked properly.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply